From ead9a5429e2d941b319518e93088374f98924ea2 Mon Sep 17 00:00:00 2001 From: Joao Luis Sombrio Date: Wed, 5 Aug 2026 02:20:17 -0300 Subject: [PATCH 1/2] 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 --- flow/scripts/synth_preamble.tcl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/flow/scripts/synth_preamble.tcl b/flow/scripts/synth_preamble.tcl index 18e27b4aa5..fd24e8e97f 100644 --- a/flow/scripts/synth_preamble.tcl +++ b/flow/scripts/synth_preamble.tcl @@ -6,16 +6,24 @@ 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. +# +# --preserve=timestamps rather than -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. 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 --preserve=timestamps $::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)/. + log_cmd exec cp --preserve=timestamps {*}$::env(CACHED_REPORTS) \ + $::env(REPORTS_DIR)/. } exit } From 4b688827b359fa1f8222dd1afa85fdd90ea80e2f Mon Sep 17 00:00:00 2001 From: Joao Luis Sombrio Date: Wed, 5 Aug 2026 02:41:17 -0300 Subject: [PATCH 2/2] fix(flow): use portable cp + touch -r for cached netlist copy cp --preserve=timestamps is GNU-only and fails on macOS/BSD cp. Plain cp followed by touch -r keeps the nanosecond mtime on Linux (verified identical to --preserve=timestamps) and works on all supported platforms. Signed-off-by: Joao Luis Sombrio --- flow/scripts/synth_preamble.tcl | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/flow/scripts/synth_preamble.tcl b/flow/scripts/synth_preamble.tcl index fd24e8e97f..7c392e9beb 100644 --- a/flow/scripts/synth_preamble.tcl +++ b/flow/scripts/synth_preamble.tcl @@ -7,14 +7,17 @@ erase_non_stage_variables synth # preserve timestamps flag set. If you don't, subsequent runs will cause the # floorplan step to be re-executed. # -# --preserve=timestamps rather than -p: -p also preserves mode, which makes +# 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. +# 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 --preserve=timestamps $::env(SYNTH_NETLIST_FILES) \ + 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 @@ -22,8 +25,11 @@ if { [env_var_exists_and_non_empty SYNTH_NETLIST_FILES] } { 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 --preserve=timestamps {*}$::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 }