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
feat(manifest/bazel): customer flag passthrough for matrix builds and non-conventional hubs
Adds three repeatable CLI flags so customers can drive the underlying
bazel invocations without having to fork the orchestrator:
--bazel-flag=<arg> appended to every subcommand (cquery, query,
mod show_extension, mod dump_repo_mapping)
after the orchestrator's own flags. Use for
matrix-cell selectors:
--bazel-flag=--repo_env=SCALA_VERSION=2.13.18
--bazel-flag=--config=ci-scala-2-13
--bazel-flag=--platforms=//tools:linux_x86_64
--bazel-startup-flag=<arg> injected into the startup-flag prefix BEFORE
the subcommand, after the orchestrator's
startup flags (--bazelrc, --output_user_root,
--output_base). Use for host-side knobs:
--bazel-startup-flag=--host_jvm_args=-Xmx2g
--bazel-maven-repo=<name> appended to the candidate Maven hub list. Use
on legacy WORKSPACE workspaces whose hubs
use non-conventional names that the
conventional probe list doesn't cover, or on
custom Bzlmod extensions `mod show_extension`
doesn't enumerate:
--bazel-maven-repo=my_jars
--bazel-maven-repo=test_maven (repeatable)
`BazelQueryOptions` gains `extraBazelFlags` and `extraBazelStartupFlags`;
the centralised `buildStartupFlags` and the new `userBazelFlags`
helpers thread them through every argv builder uniformly (probe
cquery, metadata cquery in bazel-cquery, query, mod show_extension,
mod dump_repo_mapping). `ExtractBazelOptions` gains the matching three
fields, defaulted to undefined when no CLI override was supplied.
Flag passthrough is verbatim — Bazel's last-wins precedence handles
conflicts between socket.json defaults (`bazelFlags`) and CLI overrides
(`extraBazelFlags`). No allowlist; the trust model is the same as
running `bazel` directly, and per-invocation `--output_user_root`
isolation prevents a hostile flag from poisoning shared state.
Tests cover argv shape for both extra-flag arrays (placement before
subcommand for startup flags; placement after standard subcommand
flags for trailing flags), the cquery argv-shape test, and the
extraMavenRepoNames threading end-to-end.
0 commit comments