Skip to content

bazel: take sv-elab from the BCR, turn exact version pins into floors - #12112

Merged
vvbandeira merged 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:bazel/sv-elab-from-bcr
Nov 4, 2026
Merged

vvbandeira merged 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:bazel/sv-elab-from-bcr

Conversation

@oharboe

@oharboe oharboe commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Makes OpenROAD more idiomatic as a Bazel module and easier to depend
on from other Bazel modules: one submodule fewer, and version floors
that reach the modules that depend on openroad.

sv-elab from the BCR; its submodule is deleted

The BCR now carries sv-elab 2026-10-29, six commits past the
third-party/sv-elab submodule's 3e152133 (slang 12.1, fixed operand
evaluation order, localparams on blackboxes ignored for export).
The README's third-party rule puts a BCR module first and keeps
submodules for real forks, so a plain bazel_dep replaces the
local_path_override, and the submodule is deleted.

Bazel honours local_path_override only in the root module. A
module that depends on openroad therefore resolved sv-elab to a
version that does not exist on the BCR, unless it wrote its own
override and kept that on the submodule's commit by hand. With a
plain bazel_dep, it resolves with nothing to copy.

If you would rather delete the submodule in a follow-up PR, this
splits cleanly: Bazel no longer reads third-party/sv-elab, and
.bazelignore already keeps it out of //....

Exact pins become floors

The new sv-elab raises the floors on flex and readline. That moves
bison to 3.8.2.bcr.13, which needs rules_cc_autoconf 0.32.0 or
later, and the exact single_version_override pins kept for the
gnulib/hermetic-llvm fixes no longer agree with each other. They were
minimum versions written as exact pins, so this writes them as
minimums:

module before after why
rules_cc_autoconf pinned 0.23.0 no pin graph resolves 0.34.0
m4 pinned 1.4.21.bcr.4 no pin graph resolves 1.4.21.bcr.8
sed pinned 4.9.bcr.5 no pin no longer in the graph
gawk pinned 5.4.0.bcr.2 bazel_dep 5.4.0.bcr.2 graph alone resolves 5.3.2.bcr.3

A single_version_override also applies only in the root module, so
a module depending on openroad never got these fixes. The gawk
floor is now a direct bazel_dep, as freetype already is, so
minimum version selection carries it to them too.

Smaller

  • The bazel-lock and web-bundle workflows checked out submodules
    only because module resolution needed sv-elab; they no longer do.
  • .bazelignore keeps third-party/sv-elab/ among the former
    submodules that git leaves on disk in existing checkouts and
    reused runners, as for third-party/abc/.
  • Comments in elab_diag_test.cc that named the submodule path.

Testing

In a checkout without third-party/sv-elab:

  • bazel test //src/syn/... //:openroad: 16/16 pass
  • bazel build --nobuild //...: analysis clean
  • bazel mod deps --lockfile_mode=update: no warnings; lockfile
    included
  • buildifier v8.2.1 (the version CI pins): format and lint clean

The remaining submodule

src/sta stays. OpenSTA is OpenROAD's own fork and is not on the
BCR, so it fits the README's rule. GitHub's /archive/<sha>.tar.gz
leaves submodules out, though, so a module that depends on openroad
through an archive_override still has to fetch OpenSTA into
src/sta itself. Publishing OpenSTA as a Bazel module would remove
that last submodule, and is a separate discussion.

🤖 Generated with Claude Code

https://claude.ai/code/session_018PFLaEsHEYMYe38QpoJAPo

The BCR now carries sv-elab 2026-10-29, six commits past the
third-party/sv-elab submodule's 3e152133 (slang 12.1, fixed operand
evaluation order, blackbox localparams). README's third-party rule
puts a BCR module first and keeps submodules for real forks, so the
submodule and its local_path_override go, and a plain bazel_dep
replaces them.

That also helps every module that depends on openroad: a
local_path_override is ignored outside the root module, so a
consumer had to write its own override for sv-elab and keep it on
the submodule's commit by hand.

sv-elab raises the floors on flex and readline, which moves bison to
3.8.2.bcr.13, and that needs rules_cc_autoconf 0.32.0 or later. The
exact pins held for the gnulib/hermetic-llvm fixes no longer agree
with each other, so they become what they were meant to be, floors:

- rules_cc_autoconf, m4: the graph alone resolves above the pinned
  version (0.34.0, 1.4.21.bcr.8), so the pins go.
- sed: no longer in the graph at all; the override did nothing.
- gawk: the graph alone resolves 5.3.2.bcr.3, below the fix, so it
  becomes a direct bazel_dep at 5.4.0.bcr.2, as freetype already is,
  which also reaches downstream consumers.

The bazel-lock and web-bundle workflows checked out submodules only
because module resolution needed this one, so they no longer do.
.bazelignore keeps third-party/sv-elab/ among the former submodules
that git leaves behind in existing checkouts.

Tested: bazel test //src/syn/... //:openroad (16/16 pass) and
bazel build --nobuild //..., in a checkout without third-party/sv-elab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018PFLaEsHEYMYe38QpoJAPo
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@github-actions github-actions Bot added the size/M label Nov 3, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the third-party/sv-elab git submodule and transitions the sv-elab dependency to a standard Bazel module dependency (bazel_dep) retrieved from the Bazel Central Registry (BCR). It cleans up related overrides in MODULE.bazel (such as rules_cc_autoconf, m4, and sed), updates .bazelignore and .gitmodules, updates the lockfile, and updates comments in elab_diag_test.cc to reflect this change. There are no review comments, and I have no feedback to provide.

@oharboe

oharboe commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

@hzeller @maliberty Trying to get one more git submodule rock in my shoe out... 🤞

@oharboe

This comment was marked as outdated.

@oharboe
oharboe marked this pull request as ready for review November 3, 2026 21:48
@oharboe
oharboe requested review from a team as code owners November 3, 2026 21:48
@oharboe

oharboe commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

pr-merge is green, so good to go. pr-head doesnt matter

@QuantamHD

Copy link
Copy Markdown
Collaborator

We just made this same change internally.

@oharboe

oharboe commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

Deleting the sv-elab submodule makes CI more reliable and the module more idiomatic:

  • Bazel retries and caches every fetch. With a plain bazel_dep, sv-elab comes from the BCR through Bazel's HTTP downloader. The download is checked against the hash in the registry, stored in the repository cache, and fetched again on the next build if it was cut off. It can also be sent through the mirrors in bazel/downloader.cfg. A submodule is checked out by git before Bazel starts, from a single remote, and nothing Bazel caches helps if that checkout fails partway.
  • Builds start from a plain checkout. Two workflows no longer need submodules: recursive. On a reused runner, an old third-party/sv-elab directory left on disk can't affect the build, because .bazelignore keeps it out of //... and Bazel now reads sv-elab only from the BCR.
  • Bazel's own guidance points this way. Bazel's git_repository docs say "Prefer http_archive to git_repository", because the HTTP downloader has no system dependencies, takes a list of mirror URLs and works with the repository cache (bazel.build/rules/lib/repo/git). A BCR module gets all three.
  • Modules that depend on openroad resolve sv-elab with nothing to copy. local_path_override applies only in the root module. A plain bazel_dep reaches the modules that depend on openroad through minimum version selection, as the rest of the dependency graph does.

@vvbandeira
vvbandeira merged commit 80a6c68 into The-OpenROAD-Project:master Nov 4, 2026
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants