Skip to content

clicommand/agent_start.go: Use /usr/bin/env bash as default shell#3661

Merged
zhming0 merged 1 commit intobuildkite:mainfrom
sundbry:env-bash
Jan 13, 2026
Merged

clicommand/agent_start.go: Use /usr/bin/env bash as default shell#3661
zhming0 merged 1 commit intobuildkite:mainfrom
sundbry:env-bash

Conversation

@sundbry
Copy link
Contributor

@sundbry sundbry commented Jan 12, 2026

Description

Use /usr/bin/env bash rather than /bin/bash to locate bash for the default shell in a Linux agent.

This improves portability for running agents on NixOS and GNU Guix hosts, where /bin/bash is not present, but /usr/bin/env is present.

Context

"Hello world" builds failed on an agent running on GNU Guix, and presumably it would also fail on NixOS for the same reason:

🚨 Error: error running "/bin/bash -e -c \"echo \\\"Hello world\\\"\"": error starting pty: fork/exec /bin/bash: no such file or directory

Changes

Uses /usr/bin/env bash to instantiate the bash shell based on the $PATH rather than presuming /bin/bash

The presence of /usr/bin/env at that location is a de-facto standard which can be relied on for portability.

Testing

  • Tests have run locally (with go test ./...). Buildkite employees may check this if the pipeline has run automatically.
  • Code is formatted (with go tool gofumpt -extra -w .)

Disclosures / Credits

I did not use AI tools at all

Use `/usr/bin/env bash` rather than `/bin/bash` to locate bash for
the default shell in a Linux agent.

This improves portability for running agents on NixOS and GNU Guix
hosts, where /bin/bash is not present, but /usr/bin/env is present.
Copy link
Contributor

@zhming0 zhming0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you @sundbry for the contribution!

@zhming0 zhming0 enabled auto-merge January 13, 2026 01:43
@zhming0 zhming0 merged commit 651e9bc into buildkite:main Jan 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants