task icon indicating copy to clipboard operation
task copied to clipboard

`task -l` fails with invalid memory address

Open i4o opened this issue 7 years ago • 1 comments

  • Task version : 2.7 ( just downloaded deb pkg from github )
  • OS: linux
  • Example Taskfile showing the issue below
$ go version
go version go1.13.1 linux/amd64

Executed command:

$ task -l
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x6bb611]

goroutine 1 [running]:
github.com/go-task/task/v2/internal/taskfile/read.Taskfile(0x0, 0x0, 0x797e0e, 0xc, 0xc0000f9d00, 0xc0000a6010, 0x0)
	/Users/andrey/code/andrey/task/internal/taskfile/read/taskfile.go:64 +0x5c1
github.com/go-task/task/v2.(*Executor).Setup(0xc0000b82c0, 0xc0000b82c0, 0x1)
	/Users/andrey/code/andrey/task/task.go:95 +0x89
main.main()
	/Users/andrey/code/andrey/task/cmd/task/task.go:124 +0x879

Taskfile.yml

version: '2'

tasks:
  default:
    cmds:
      - task: build

  builddir:
    desc: create dir build and set permissions
    cmds:
      - mkdir -p build 
      - chmod 700 build
    silent: true
    status:
      - test -d build

  build:
    desc: build sbot
    deps: [builddir]
    cmds:
      - go build -o build/sBot-{{.GOOS }}-{{ .GOARCH }}
    silent: true
    env:
      GOOS: linux
      GOARCH: amd64


  build_openbsd:
    desc: build sbot for OpenBSD
    deps: [builddir]
    cmds:
      - go build -o build/sBot-{{.GOOS }}-{{ .GOARCH }}
    silent: true
    env:
      GOOS: openbsd
      GOARCH: amd64

  build_win:
    desc: build sbot for Windows amd64
    deps: [builddir]
    cmds:
      - go build -o build/sBot-{{.GOOS }}-{{ .GOARCH }}.exe
    silent: true
    env:
      GOOS: windows
      GOARCH: amd64

  clean:
    desc: rm dir build 
    cmds:
      - rm -rf build 
    silent: true

  build_freebsd:
    desc: build sbot for FreeBSD
    cmds:
      - go build -o build/sBot-{{.GOOS }}-{{ .GOARCH }}
    silent: true
    env:
      GOOS: freebsd
      GOARCH: amd64

  build_mac:
  clean:
    desc: build sbot for Mac ( nie je sucastou buildAll )
    cmds:
      - go build -o build/sBot-{{.GOOS }}-{{ .GOARCH }}
    silent: true
    env:
      GOOS: darwin
      GOARCH: amd64

  buildAll:
    desc: multibuild linux, freebsd, windows a openbsd
    deps:
      - build
      - build_win
      - build_freebsd
      - build_openbsd
    silent: true

  slack:
    desc: otestuj spravy do slacku
    cmds:
      - echo todo
    silent: true

i4o avatar Oct 25 '19 06:10 i4o

Oh, I finally see my stupidity.

While copying task I kept there clean: as second "label" for build_mac:.

Now it's showing list of task properly.

i4o avatar Oct 25 '19 06:10 i4o