You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This results in errors when running the method in minimal environments like containers:
build cache is required, but could not be located: GOCACHE is not defined and neither $XDG_CACHE_HOME nor $HOME are defined
This can be fixed by ensuring that the inherited OS environment is prepended before applying custom environment variables.
Also to improve the debugging process the combined output (stdout + stderr) should be included in the error when the command execution fails.
The text was updated successfully, but these errors were encountered:
Before the `Install` method of the `gobin` task runner [1] has set the
environment of the command that gets executed initially to
`os.Environ()` [2], but has overwritten it later on with custom
variables configured through the `WithEnv(map[string]string)`
option [3].
This resulted in errors when running the method in minimal environments
like containers:
```raw
build cache is required, but could not be located: GOCACHE is not
defined and neither $XDG_CACHE_HOME nor $HOME are defined
```
This commit fixes it by ensuring that the inherited OS environment is
prepended before applying custom environment variables.
Also to improve the debugging process the combined output
(`stdout` + `stderr`) is now included in the error when the command
execution fails.
[1]: https://pkg.go.dev/github.com/svengreb/[email protected]/pkg/task/gobin#Runner.Install
[2]: https://pkg.go.dev/os/#Environ
[3]: https://pkg.go.dev/github.com/svengreb/[email protected]/pkg/task/gobin#WithEnvGH-62
…#63)
Before the `Install` method of the `gobin` task runner [1] has set the
environment of the command that gets executed initially to
`os.Environ()` [2], but has overwritten it later on with custom
variables configured through the `WithEnv(map[string]string)`
option [3].
This resulted in errors when running the method in minimal environments
like containers:
```raw
build cache is required, but could not be located: GOCACHE is not
defined and neither $XDG_CACHE_HOME nor $HOME are defined
```
This commit fixes it by ensuring that the inherited OS environment is
prepended before applying custom environment variables.
Also to improve the debugging process the combined output
(`stdout` + `stderr`) is now included in the error when the command
execution fails.
[1]: https://pkg.go.dev/github.com/svengreb/[email protected]/pkg/task/gobin#Runner.Install
[2]: https://pkg.go.dev/os/#Environ
[3]: https://pkg.go.dev/github.com/svengreb/[email protected]/pkg/task/gobin#WithEnvFixesGH-62
Currently the
Install
method of thegobin
task runner sets the environment of the command that gets executed initially toos.Environ()
, but overrides it later on with custom variables configured through theWithEnv(map[string]string)
option.This results in errors when running the method in minimal environments like containers:
This can be fixed by ensuring that the inherited OS environment is prepended before applying custom environment variables.
Also to improve the debugging process the combined output (
stdout
+stderr
) should be included in the error when the command execution fails.The text was updated successfully, but these errors were encountered: