Repository navigation
Conversation
The `1_synth.sdc` is copied from a template from the bazel input files, which are read-only. The `exec cp` then will copy the file which then is still read-only, thus the subsequent write will fail. Make the file writable. (this was discovered attempting to run in an RBE environment where the readonlyness of the inputs is very strict). Signed-off-by: Henner Zeller <h.zeller@acm.org>
056d4a3 to
463c959
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces a new patch, 0036-fix-sdc-readonly.patch, which ensures that the target SDC file is writable before attempting to write to it in synth_odb.tcl. The review feedback suggests using Tcl's built-in file attributes command instead of spawning an external chmod process to improve efficiency and portability.
| # the user could have dependencies, such as sourcing util.tcl, | ||
| # which are read in here and a canonicalized version is written | ||
| # out by OpenSTA that has no dependencies. | ||
| +catch {exec chmod +w $::env(RESULTS_DIR)/1_synth.sdc} |
There was a problem hiding this comment.
There was a problem hiding this comment.
This is just to fix the build, I am leaving this tweak up to @oharboe when he applies the fix upstream.
There was a problem hiding this comment.
I don't see any downside to this change
|
@oharboe looks good ? |
It makes no sense to me. Show the exact steps where this is a problem? Why is this needed or useful and why is it not a much broader problem? |
|
If you run the following test for instance: ... and look at the log, you see that the ... and then later attempted to be overwritten. Of course, the original source-code is not writable, and it fact it is coming from a read-only filesystem when compiling in an RBE environment, so there is no write-bit on the input file. When copying, the non-set write bit is retained, and now we have a This is why we have to set the write-bit. Maybe there is something wrong in the logic and the first sdc file should never have been written, but I leave that test logic question to you. All i needed to make the test work is to make sure that the write call then can succeed. The above-mentioned test is one of them, but since this code is used in other tests, about 25 tests fail to build on an RBE (and accidentally work when compiling locally). |
|
@hzeller You're using the ORFS idempotency tests I made 🥳 I'll have a look at this... |
|
I see what is going on... Fix coming up... This PR should be closed, it is trying to treat a symptom of the underlying problem. |
|
Closing, awaiting proper fix. |
|
@hzeller Root cause found: Proper fix is up as The-OpenROAD-Project/bazel-orfs#754: the yosys stage no longer produces Once that merges, |
|
I see #10823 was closed without merge. |
|
|
Even with grepping anything that looks like 1_synth it looks like there is still the copy of the |
|
The fix is in ORFS not bazel-orfs |
|
@hzeller bazel-orfs != ORFS, you bumped bazel-orfs, fix is in ORFS. Claude ran the test locally, confirmed your problem and that bumping ORFS fixes it. |
ORFS afad87da includes OpenROAD-flow-scripts#4333: yosys' synth.tcl no longer copies SDC_FILE over 1_synth.sdc, so synth_odb.tcl's write_sdc is the sole writer and no longer fails when bazel inputs are read-only (RBE; cp preserves the missing write bit). Follow-up to #10818. Drop 0035-orfs-bazel-orfs-visible-non-root.patch: upstreamed, @orfs now declares its bazel-orfs bazel_dep non-dev. Verified with chmod a-w test/orfs/gcd/constraint.sdc to emulate RBE's read-only inputs: //test/orfs/gcd:gcd_synth fails before this change with "cannot write file .../1_synth.sdc" and passes after. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Ah, this was because I followed #10896 (comment) |
Yes, |
|
Fix: The-OpenROAD-Project/bazel-orfs#768 — |
Running bazelisk run @bazel-orfs//:bump inside OpenROAD bumped bazel-orfs but intentionally skipped ORFS, so picking up an ORFS fix still required hand-editing ORFS_COMMIT (the sucker-punch behind The-OpenROAD-Project/OpenROAD#10818 / #10907). Drop the project-type gate on the ORFS bump and dispatch on the override shape instead: - git_override(orfs): unchanged. - archive_override(orfs), literal commit in urls/strip_prefix (bazel-orfs's own MODULE.bazel): unchanged behavior, plus support for sha256-hex digests alongside SRI integrity. - archive_override(orfs), commit held in a top-level variable concatenated into strip_prefix/urls (OpenROAD's shape): rewrite the variable assignment and the digest, leaving the concatenation intact. The assignment rewrite is anchored at line start because BAZEL_ORFS_COMMIT contains ORFS_COMMIT as a substring and an unanchored substitution would clobber the just-bumped bazel-orfs pin. A mixed shape (only one field referencing the variable) fails loudly rather than half-updating. This also fixes a latent failure where a downstream project pinning orfs via archive_override hit the git_override expectation and raised. OpenROAD still never bumps its own commit: the tools loop only touches an openroad bazel_dep, which OpenROAD's own MODULE.bazel doesn't have. Its yosys dev_dependency pin now follows ORFS tools/yosys like any other consumer. (Follow-up idea: bump abc from YOSYS_ABC_PAIRS in lockstep when both yosys and abc are declared.) Verified against OpenROAD's real MODULE.bazel: with ORFS_COMMIT and sha256 reset to stale values, bump restores exactly the values hand-committed upstream, and a second run is a no-op. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
The
1_synth.sdcis copied from a template from the bazel input files, which are read-only. Theexec cpthen will copy the file which then is still read-only, thus the subsequent write will fail.Make the file writable.
(this was discovered attempting to run in an RBE environment where the readonlyness of the inputs is very strict).