diff --git a/flow/scripts/synth_preamble.tcl b/flow/scripts/synth_preamble.tcl index 18e27b4aa5..7c392e9beb 100644 --- a/flow/scripts/synth_preamble.tcl +++ b/flow/scripts/synth_preamble.tcl @@ -6,16 +6,30 @@ erase_non_stage_variables synth # If using a cached, gate level netlist, then copy over to the results dir with # preserve timestamps flag set. If you don't, subsequent runs will cause the # floorplan step to be re-executed. +# +# Plain cp + touch -r rather than cp -p: -p also preserves mode, which makes +# cp copy ACLs. That fails with EOPNOTSUPP when the source is on an NFSv4 +# mount (every file there carries a system.nfs4_acl xattr) and the +# destination filesystem, e.g. ext4 or tmpfs, cannot store it. Only the +# timestamps matter for make's up-to-date checks; touch -r preserves them +# with nanosecond precision and, unlike cp --preserve=timestamps, is +# portable to macOS/BSD. if { [env_var_exists_and_non_empty SYNTH_NETLIST_FILES] } { if { [llength $::env(SYNTH_NETLIST_FILES)] == 1 } { - log_cmd exec cp -p $::env(SYNTH_NETLIST_FILES) $::env(RESULTS_DIR)/1_2_yosys.v + log_cmd exec cp $::env(SYNTH_NETLIST_FILES) $::env(RESULTS_DIR)/1_2_yosys.v + log_cmd exec touch -r $::env(SYNTH_NETLIST_FILES) \ + $::env(RESULTS_DIR)/1_2_yosys.v } else { # The date should be the most recent date of the files, but to # keep things simple we just use the creation date log_cmd exec cat {*}$::env(SYNTH_NETLIST_FILES) > $::env(RESULTS_DIR)/1_2_yosys.v } if { [env_var_exists_and_non_empty CACHED_REPORTS] } { - log_cmd exec cp -p {*}$::env(CACHED_REPORTS) $::env(REPORTS_DIR)/. + foreach report $::env(CACHED_REPORTS) { + set dst $::env(REPORTS_DIR)/[file tail $report] + log_cmd exec cp $report $dst + log_cmd exec touch -r $report $dst + } } exit }