Replace touch with bash builtin to fix NixOS compatibility#101
Open
DhashS wants to merge 1 commit intobuildbuddy-io:mainfrom
Open
Replace touch with bash builtin to fix NixOS compatibility#101DhashS wants to merge 1 commit intobuildbuddy-io:mainfrom
touch with bash builtin to fix NixOS compatibility#101DhashS wants to merge 1 commit intobuildbuddy-io:mainfrom
Conversation
Use `: >` (bash builtin) instead of `touch` (external command) to create output files. On NixOS with bazelisk, shell actions run with a stripped environment where external commands are not on PATH. Fixes buildbuddy-io#100 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
touch "$1"with: > "$1"in_bazel_env_rule_impltouch $@with: > $@in the toolchain genruleProblem
Fixes #100.
bazel_envfails on NixOS when using bazelisk (unpatched Bazel binaries). Bazel runsrun_shellactions with a stripped environment (exec env -), sotouch— an external command — is not found. On NixOS, tools live in the Nix store and are only reachable viaPATH.Fix
: >is a bash builtin (:is equivalent totrue) combined with output redirection, which creates/truncates a file identically totouchwithout requiring any external command onPATH. This is a no-op change on other platforms.Tested locally: 26/27 → 27/27 targets building with bazelisk on NixOS.
This PR was entirely vibe coded with Claude Code.