Skip to content

Commit f4b9d7d

Browse files
authored
Merge pull request #4394 from The-OpenROAD-Project-staging/fix-cached-netlist-cp-nfs4-acl
fix(flow): copy cached netlists with --preserve=timestamps
2 parents 9fae12c + 4b68882 commit f4b9d7d

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

‎flow/scripts/synth_preamble.tcl‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,30 @@ erase_non_stage_variables synth
66
# If using a cached, gate level netlist, then copy over to the results dir with
77
# preserve timestamps flag set. If you don't, subsequent runs will cause the
88
# floorplan step to be re-executed.
9+
#
10+
# Plain cp + touch -r rather than cp -p: -p also preserves mode, which makes
11+
# cp copy ACLs. That fails with EOPNOTSUPP when the source is on an NFSv4
12+
# mount (every file there carries a system.nfs4_acl xattr) and the
13+
# destination filesystem, e.g. ext4 or tmpfs, cannot store it. Only the
14+
# timestamps matter for make's up-to-date checks; touch -r preserves them
15+
# with nanosecond precision and, unlike cp --preserve=timestamps, is
16+
# portable to macOS/BSD.
917
if { [env_var_exists_and_non_empty SYNTH_NETLIST_FILES] } {
1018
if { [llength $::env(SYNTH_NETLIST_FILES)] == 1 } {
11-
log_cmd exec cp -p $::env(SYNTH_NETLIST_FILES) $::env(RESULTS_DIR)/1_2_yosys.v
19+
log_cmd exec cp $::env(SYNTH_NETLIST_FILES) $::env(RESULTS_DIR)/1_2_yosys.v
20+
log_cmd exec touch -r $::env(SYNTH_NETLIST_FILES) \
21+
$::env(RESULTS_DIR)/1_2_yosys.v
1222
} else {
1323
# The date should be the most recent date of the files, but to
1424
# keep things simple we just use the creation date
1525
log_cmd exec cat {*}$::env(SYNTH_NETLIST_FILES) > $::env(RESULTS_DIR)/1_2_yosys.v
1626
}
1727
if { [env_var_exists_and_non_empty CACHED_REPORTS] } {
18-
log_cmd exec cp -p {*}$::env(CACHED_REPORTS) $::env(REPORTS_DIR)/.
28+
foreach report $::env(CACHED_REPORTS) {
29+
set dst $::env(REPORTS_DIR)/[file tail $report]
30+
log_cmd exec cp $report $dst
31+
log_cmd exec touch -r $report $dst
32+
}
1933
}
2034
exit
2135
}

0 commit comments

Comments
 (0)