Skip to content

Regression: task fails when a source file doesn't exist. #131

@smyrman

Description

@smyrman

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.10.3 darwin/amd6

Does this issue reproduce with the latest release?

Yes, this issue occurs with release 2.1.0. It works without error for v2.0.3.

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/smyrman/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/smyrman/.local"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10.3/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10.3/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/sj/d5g1dfkd3g75ccz83k505v3r0000gn/T/go-build554140985=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

If running a task with checksum up to-date calculation, and a source file that does not exist, the task doesn't run. As a reproduction, I copied testdata/checksum to a new folder with the following Taskfile.yml:

version: "2"

tasks:
  build:
    cmds:
      - cp ./source.txt ./generated.txt
    sources:
      - ./source.txt
      - ./**/*.random  # This file dooes not exist
    generates:
      - ./generated.txt
    method: checksum

What did you expect to see?

One of:

$ task build
cp ./source.txt ./generated.txt
$ task build
task: Task "build" is up to date

What did you see instead?

$ task build      
file does not exist

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions