-
-
Notifications
You must be signed in to change notification settings - Fork 763
Closed
Labels
state: can't reproNot enough information was given to reproduce the issue described.Not enough information was given to reproduce the issue described.
Description
In some cases, dynamic vars that worked in <= v3.38.0 result in a go panic in >= v3.39.0.
Version Info
- Task version:
- v3.39.0
- v.3.39.1
- v3.39.2
- Operating system: MacOS Sonoma 14.6.1
To Reproduce
# create test yaml file
echo 'name: foobar' > example.yaml
# create taskfile
cat <<EOF > Taskfile.yaml
version: '3'
vars:
NAME:
sh: yq .name example.yaml
tasks:
default: echo {{.NAME}}
EOFThe above works fine in version v3.38.0 - the NAME variable is dynamically populated with the result of the yq command and the task prints foobar as expected:
$ task --version
Task version: v3.38.0 (h1:O7kgA6BfwktXHPrheByQO46p3teKtRuq1EpGnFxNzbo=)
$ task
task: [default] echo foobar
foobarIn version v3.39.0 and greater, it panics:
$ task --version
Task version: v3.39.0 (h1:Loe6ppP1x38Puv1M2wigp91bH/garCt0vLWkJsiTWNI=)
$ task
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x28 pc=0x1007a06ec]
goroutine 1 [running]:
github.com/mikefarah/yq/v4/cmd.processStdInArgs({0x140000649c0?, 0x2, 0x2})
github.com/mikefarah/yq/v4/cmd/utils.go:224 +0x3c
github.com/mikefarah/yq/v4/cmd.processArgs({0x140000649c0?, 0x23?, 0x0?})
github.com/mikefarah/yq/v4/cmd/utils.go:256 +0x90
github.com/mikefarah/yq/v4/cmd.initCommand(0x14000127a68?, {0x140000649c0, 0x2, 0x2})
github.com/mikefarah/yq/v4/cmd/utils.go:26 +0xa0
github.com/mikefarah/yq/v4/cmd.evaluateSequence(0x14000012900?, {0x140000649c0, 0x2, 0x2})
github.com/mikefarah/yq/v4/cmd/evalute_sequence_command.go:65 +0x74
github.com/spf13/cobra.(*Command).execute(0x14000012900, {0x14000064960, 0x2, 0x2})
github.com/spf13/[email protected]/command.go:940 +0x5c8
github.com/spf13/cobra.(*Command).ExecuteC(0x14000012600)
github.com/spf13/[email protected]/command.go:1068 +0x35c
github.com/spf13/cobra.(*Command).Execute(0x1400005b450?)
github.com/spf13/[email protected]/command.go:992 +0x1c
main.main()
github.com/mikefarah/yq/v4/yq.go:22 +0x1b0
task: Command "yq .name example.yaml" failed: exit status 2Although the panic is from the yq binary, it must be something to do with the way the args are passed to the binary from go-task or the way the binary is invoked.
Metadata
Metadata
Assignees
Labels
state: can't reproNot enough information was given to reproduce the issue described.Not enough information was given to reproduce the issue described.