Make bazel command and worker-thread count configurable - #12
Merged
Conversation
Add two macro parameters on `refresh_compile_commands`: - `bazel_command`: path or name of the bazel binary used by the generated refresh script (defaults to "bazel"). Useful when bazel lives under a non-default name (e.g. "bazelisk") or an absolute path. - `max_threads`: max worker threads for the action conversion pool (defaults to the previous heuristic of min(32, cpu_count + 4)). Plumbed through `_expand_template` substitutions; `refresh.template.py` exposes `_bazel()` / `_threads()` helpers and uses them at the three bazel-subprocess call sites and the executor configuration. Backport of hedronvision#215 (sthornington). Supersedes hedronvision#191 (custom bazel binary only).
helly25
force-pushed
the
backport/215-configurable-bazel-and-threads
branch
from
May 17, 2026 11:46
0c98622 to
3e9270d
Compare
This was referenced May 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
Adds two macro parameters on
refresh_compile_commands:bazel_command"bazel"bazelisk) or an absolute path.max_threadsmin(32, cpu_count + 4)Wired through
_expand_templatesubstitutions;refresh.template.pyexposes_bazel()/_threads()helpers and uses them at the threesubprocess.run([...'bazel'...])call sites and at the executor configuration.Upstream context
Backport of hedronvision#215 (sthornington), reworked slightly:
bazel_commandis a macro/rule parameter rather than a--define BAZEL_COMMAND=...build var — keeps it explicit per-target and easier to discover.max_threadsuses an int attr with0sentinel rather than a nullable attr.Supersedes hedronvision#191 (
bazelbinary only) per maintainer decision.Skipped the unrelated
print_args.cppcosmetic rewrite that was bundled with the upstream PR.Test plan
bazel run @hedron_compile_commands//:refresh_allwith default args (regression check)bazel_command = "bazelisk", run from a non-bazel-on-PATH shellmax_threads = 1, confirm single-threaded execution