fix(crate_universe): pass OUTPUT_BASE as --output_base startup flag to bazel info - #4183
Merged
UebelAndre merged 1 commit intoJul 30, 2026
Conversation
UebelAndre
approved these changes
Jul 30, 2026
UebelAndre
left a comment
Collaborator
There was a problem hiding this comment.
Good catch, thank you!
georgesfarah
force-pushed
the
fix/pass-output-base-startup-flag-to-bazel-info
branch
5 times, most recently
from
July 30, 2026 18:14
f0cb03b to
821555f
Compare
…o bazel info
The OUTPUT_BASE env var was added to let CI environments supply the
output_base without relying on `bazel info`. However, the override
was applied after parsing the output, so it only worked when
`bazel info` itself succeeded — defeating its purpose.
When `bazel info` fails (e.g. the default output_base path is not
writable in a sandboxed CI environment), the function bails before
the override is ever reached.
Fix by passing OUTPUT_BASE as a `--output_base` Bazel startup flag
(which must precede the subcommand):
bazel --output_base=/path/to/base info release output_base
Bazel uses the caller-specified path from the start and never
touches the default path. The post-parsing override is removed,
along with a formatting bug it carried (it inserted
`"output_base: /path"` as the map value instead of `"/path"`).
georgesfarah
force-pushed
the
fix/pass-output-base-startup-flag-to-bazel-info
branch
from
July 30, 2026 18:17
821555f to
4cf1549
Compare
UebelAndre
enabled auto-merge
July 30, 2026 18:23
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.
Problem
The
OUTPUT_BASEenv var was added to let CI environments supply the output_base without relying onbazel info. However, the override is applied after parsing thebazel infooutput:When
bazel infofails (e.g. the default~/.cache/bazel/...is not writable in a sandboxed CI), the function bails beforeOUTPUT_BASEis ever checked — making the env var useless for its intended purpose.Fix
Pass
OUTPUT_BASEas a--output_baseBazel startup flag (before the subcommand):Startup flags take effect before Bazel accesses any path, so it never touches the default (possibly non-writable) output_base. The
bazel infosubprocess runs normally and the post-parsing override is no longer needed.Changes
crate_universe/src/cli/vendor.rs: restructureBazelInfo::try_newto optionally inject--output_baseas a startup flag; remove the post-parsingOUTPUT_BASEoverride.test_parse_bazel_info_output_base_env_overridesinceparse_bazel_infono longer handles theOUTPUT_BASEoverride — the existingtest_bazel_infoalready covers the parsing logic.