Skip to content

Commit ead9a54

Browse files
committed
fix(flow): copy cached netlists with --preserve=timestamps
cp -p preserves mode, which makes coreutils cp copy ACLs too. From an NFSv4 mount (every file carries a system.nfs4_acl xattr) to a filesystem that cannot store it (ext4, tmpfs), the ACL copy fails with EOPNOTSUPP and cp exits 1, aborting the build. Timestamps alone are enough to keep make from re-running floorplan. Signed-off-by: Joao Luis Sombrio <sombrio@sombrasoft.dev>
1 parent 0fd7a71 commit ead9a54

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎flow/scripts/synth_preamble.tcl‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,24 @@ 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+
# --preserve=timestamps rather than -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.
915
if { [env_var_exists_and_non_empty SYNTH_NETLIST_FILES] } {
1016
if { [llength $::env(SYNTH_NETLIST_FILES)] == 1 } {
11-
log_cmd exec cp -p $::env(SYNTH_NETLIST_FILES) $::env(RESULTS_DIR)/1_2_yosys.v
17+
log_cmd exec cp --preserve=timestamps $::env(SYNTH_NETLIST_FILES) \
18+
$::env(RESULTS_DIR)/1_2_yosys.v
1219
} else {
1320
# The date should be the most recent date of the files, but to
1421
# keep things simple we just use the creation date
1522
log_cmd exec cat {*}$::env(SYNTH_NETLIST_FILES) > $::env(RESULTS_DIR)/1_2_yosys.v
1623
}
1724
if { [env_var_exists_and_non_empty CACHED_REPORTS] } {
18-
log_cmd exec cp -p {*}$::env(CACHED_REPORTS) $::env(REPORTS_DIR)/.
25+
log_cmd exec cp --preserve=timestamps {*}$::env(CACHED_REPORTS) \
26+
$::env(REPORTS_DIR)/.
1927
}
2028
exit
2129
}

0 commit comments

Comments
 (0)