Skip to content

bazel: bump bazel-orfs for single-writer 1_synth.sdc (fixes RBE)#10823

Closed
oharboe wants to merge 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:bump-bazel-orfs-single-writer-sdc
Closed

bazel: bump bazel-orfs for single-writer 1_synth.sdc (fixes RBE)#10823
oharboe wants to merge 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:bump-bazel-orfs-single-writer-sdc

Conversation

@oharboe

@oharboe oharboe commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Root-cause replacement for #10818.

1_synth.sdc had two writers in ORFS: yosys' synth.tcl copied the user's SDC_FILE into place (a leftover from before SDC canonicalization existed), then synth_odb.tcl overwrote it in place with the OpenSTA-canonicalized version. cp preserves mode bits, so with read-only inputs (RBE) the copy is read-only and the canonicalization write fails — locally it only accidentally worked.

  • Bump BAZEL_ORFS_COMMIT to the head of bazel-orfs#754 (created ahead of its merge so this PR can bake; will be updated to the merged SHA if it differs). Besides carrying the ORFS fix, it stops bazel-orfs from touch-stubbing missing primary synth artifacts — a silently-missing output now fails the bazel action with "declared output was not created" instead of flowing downstream as an empty file, which the gcd idempotency tests would have compared as "identical".
  • Mirror the ORFS-side fix (ORFS#4333) as bazel/bazel-orfs-patches/0036, adapted to the pinned ORFS_COMMIT (no synth_syn.tcl there) plus the flow/BUILD.bazel exports_files(scripts/synth.tcl) newer bazel-orfs needs. Both evaporate at the next ORFS bump.
  • Mirror bazel-orfs's sed single_version_override (gnulib memchr.c vs glibc 2.41+): non-root overrides don't apply when OpenROAD is the root module — same story as the existing scip tinycthread patch. No-op on the older-glibc CI runners.

Testing

bazelisk test //test/orfs/gcd/... — 9/9 pass, including all six gcd_idempotent_test_* stages.

Supersedes #10818: no chmod +w needed since nothing overwrites a file copied from a read-only input anymore, and this class of bug now fails hard and early on all machines, not just RBE.

🤖 Generated with Claude Code

1_synth.sdc had two writers in ORFS: yosys' synth.tcl copied the
user's SDC_FILE into place, then synth_odb.tcl overwrote it in place
with the OpenSTA-canonicalized version. cp preserves mode bits, so
with read-only inputs (RBE) the copy is read-only and the write
fails; locally it only accidentally worked. Supersedes The-OpenROAD-Project#10818's
chmod +w workaround.

- Bump BAZEL_ORFS_COMMIT to bazel-orfs#754, which fixes this and
  also stops touch-stubbing missing primary synth artifacts, so a
  silently-missing output fails the action instead of flowing
  downstream as an empty file (which the gcd idempotency tests
  would happily compare as "identical").
- Mirror the ORFS-side fix (ORFS#4333) as bazel-orfs-patches/0036,
  adapted to the pinned ORFS_COMMIT, plus the flow/BUILD.bazel
  exports_files(scripts/synth.tcl) newer bazel-orfs needs. Both
  drop at the next ORFS bump.
- Mirror bazel-orfs's sed single_version_override (gnulib memchr.c
  vs glibc 2.41+); non-root overrides don't apply, same story as
  the existing scip tinycthread patch. No-op on older glibc (CI).

bazelisk test //test/orfs/gcd/...: 9/9 pass, including all six
gcd_idempotent_test_* stages.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe oharboe requested a review from a team as a code owner July 6, 2026 10:29
@oharboe oharboe requested a review from osamahammad21 July 6, 2026 10:29
@github-actions github-actions Bot added the size/M label Jul 6, 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 updates the pinned bazel-orfs commit, adds a patch to ensure a single writer for 1_synth.sdc during synthesis, and introduces a workaround override for sed to fix compilation issues on glibc 2.41+ with clang. The review feedback correctly identifies that the sed -i command used in the sed override is not portable to macOS (BSD sed) and suggests a portable alternative using a backup extension.

Comment thread MODULE.bazel
@oharboe oharboe requested a review from hzeller July 6, 2026 10:32
@oharboe

oharboe commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

@hzeller I'm running Ubuntu 26 so Claude relitigated the memchr.c incompatibility fix

BCR's yosys-slang 0.0.0 source.json pins the GitHub tarball of
povik/sv-elab@6760afa2; after the repo's rename GitHub
regenerated that tarball (new bytes, top-level dir now
sv-elab-<sha>), so any fresh fetch fails the integrity check
(Check-Bazel-Lock). archive_override the same commit with the
corrected integrity and strip_prefix; extracted content verified
byte-identical to the upstream git tree. Drop once BCR publishes
a fixed entry.

Use sed -i.bak in the sed override's patch_cmds so BSD sed on
macOS accepts it (review feedback).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe

oharboe commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@oharboe

oharboe commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@oharboe

oharboe commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

bazel-orfs#754 squash-merged as 90ad965f (identical tree to the
PR-head commit pinned before); pin the SHA that stays reachable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe

oharboe commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@maliberty

Copy link
Copy Markdown
Member

@codex review

Comment thread MODULE.bazel
Comment on lines +172 to +173
archive_override(
module_name = "yosys-slang",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How is this related to the sdc? I think you have another PR for this change

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

FYI, I also filed povik/sv-elab#362 to have stable hashes.
I will create a new updated BCR module.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Created new BCR release for sv-elab: bazelbuild/bazel-central-registry#9571

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@hzeller I take it you will create a PR when it lands?

Claude added that slang noice to this PR because it failed locally, not because it was related to bumping bazel-orfs.

Your problem goes away if you create a PR with bazelisk run @bazel-orfs//:bump, though you may want to hold off on that until this strom of bazel bcr upgrades is done....

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: ebf04d5f61

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@oharboe

oharboe commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

never mind, will be picked up by next bazel-orfs bump.

@oharboe oharboe closed this Jul 6, 2026
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