Fix writability of 1_synth.sdc#10818
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, |
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).