Torture bazel benchmark#121
Merged
brianmcgee merged 2 commits intomainfrom Apr 15, 2026
Merged
Conversation
Introduce a side-by-side Bazel vs Nix incremental rebuild benchmark on
the torture fixture (14-module Go monorepo, ~497 third-party deps).
Benchmark tool interface
------------------------
Extract a buildTool interface (Name/Build/Cleanup) so the harness can
compare arbitrary build systems on equal footing. nixTool implements
it as before; a new bazelTool drives Bazel in two phases — loading +
analysis (analogous to nix-instantiate) then execution (nix-store
--realise) — and reports action counts from Bazel's INFO summary line.
Nix setup is now skipped entirely when only non-Nix tools are
requested, saving ~30 s of cold resolution time on bazel-only runs.
Bazel workspace for torture-project
------------------------------------
Add a complete bzlmod workspace so Bazel can build the fixture:
MODULE.bazel rules_go 0.60.0, gazelle 0.42.0, go_sdk.host(),
200+ use_repo entries for external Go modules,
gazelle_override for etcd proto dirs
BUILD.bazel custom gazelle_binary (avoids dev-only
bazel_skylib_gazelle_plugin dependency)
.bazelversion pins Bazel 7.6.0
.bazelrc sandboxed strategy, no remote cache
go.work / go.work.sum workspace-level replace directives to resolve
version conflicts between conflict-a and conflict-b
Per-module BUILD.bazel files generated by Gazelle for all 18 modules
The hasBazel flag on fixtureConfig gates bazel availability per
fixture; requesting --tools bazel on a fixture without BUILD files
produces a descriptive error.
Cleanup uses `bazel clean --expunge` before shutdown so read-only
sandbox artifacts that os.RemoveAll cannot delete are removed cleanly.
devshell / flake
-----------------
Add pkgs.bazel_7 to devshell packages and to the bench-incremental
nix run wrapper's makeBinPath so bazel is on PATH in both environments.
Also updated the lock file to ensure we're using nix 2.34.5.
Benchmark Regression Check
Baseline: |
aldoborrero
approved these changes
Apr 15, 2026
This was referenced Apr 16, 2026
aldoborrero
added a commit
that referenced
this pull request
Apr 16, 2026
The dag-mode plugin sets GOWORK=off (resolve.rs:382); dynamic-mode resolve.go didn't. With a go.work present, workspace MVS ignores per-module replace directives, so it may select a version the per-module lockfile doesn't have. The torture fixture (which gained go.work in #121 for gazelle) hits this with gin v1.9.1 (replace) vs v1.12.0 (workspace MVS). :house: Remote-Dev: homespace
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.
Adds bazel to
bench-incrementalfor comparison.Also updates nixpkgs input to bring in nix 2.34.5.