Self-execute the path from os.Executable in more places #3338
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Remove
checkBinaryPaths
, and self-execute using the result fromos.Executable
in more places.Unfortunately we can't yet totally solve the sorry-Mario-your-
buildkite-agent
-is-in-another-castle problem (buildkite-agent
within a command or script run as part of a step can still be a separate binary).Context
checkBinaryPaths
creates the need for some ugly workarounds elsewhere for those who build the agent themselves.https://linear.app/buildkite/issue/PS-732
Changes
self
internal package for managing path to self, and provide a way to override during testsself.Path
for artifact phase, setting metadata, and the credential helper.self.OverridePath
within the bootstrap subcommand, if a magic combination of undocumented env vars is presentTesting
go test ./...
). Buildkite employees may check this if the pipeline has run automatically.go fmt ./...
)