Repository navigation
fix(flow): copy cached netlists with --preserve=timestamps - #4394
Merged
maliberty merged 2 commits intoAug 5, 2026
Conversation
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>
Contributor
There was a problem hiding this comment.
Code Review
This pull request replaces 'cp -p' with 'cp --preserve=timestamps' in 'flow/scripts/synth_preamble.tcl' to avoid copying ACLs, which can fail on NFSv4 mounts. The reviewer correctly noted that '--preserve=timestamps' is GNU-specific and breaks compatibility on macOS/BSD. They suggested a portable alternative using 'cp' followed by 'touch -r' to preserve timestamps across all supported platforms.
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 <sombrio@sombrasoft.dev>
maliberty
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Building gf12
bp_dual/bp_quad/ca53withSYNTH_NETLIST_FILESout of/local-ssdfails at the synth stage:Reported by @jeffng-or (2026-08-04).
Root cause
Every file on an NFSv4 mount carries a synthesized
system.nfs4_aclxattr (the trailing+inls -l).cp -ppreserves mode, which makes coreutils copy ACLs as well;fsetxattr(dst, "system.nfs4_acl", …)returnsEOPNOTSUPPon a destination filesystem that cannot store it (ext4, tmpfs), socpexits 1 and make aborts. NFSv4 → NFSv4 copies work, which is why this only surfaced once builds moved off NFS home onto local disk.Only the timestamps matter here — they keep make's up-to-date checks from re-running floorplan — so
--preserve=timestampsis the right scope. Two alternatives that do not work:--preserve=mode,timestampsstill fails: mode is what triggers the ACL copy.file copy+file mtime:file mtimeis integer-seconds, so the copy ends up older than its source and GNU make 4.x (sub-second comparison) re-runs yosys every build.flow/scripts/util.tclalready documents this trap fororfs_copy_db.Verified
On an NFSv4.1-mounted source (
/platforms) with an ext4 destination:cp -pexits 1,cp --preserve=timestampsexits 0 and keeps the full-nanosecond mtime.Sweep
Per @maliberty's suggestion I swept the repo for other mode/ACL-preserving copies (
cp -p/-a/--preserve/--archive,rsync -a,install -p,tarwith-p/--acls,shutil.copy2/copystat, bazel copy rules): these two lines insynth_preamble.tclare the only affected sites.makeIssue.sh's tar does not pass--acls, so it does not store ACLs. The remainingcp -r/cp -fuses don't preserve mode.Note
First revision used
cp --preserve=timestamps, which is GNU-only. Switched to plaincp+touch -r(per review): portable to macOS/BSD, and on Linuxtouch -rpreserves the nanosecond mtime exactly (verified identical to--preserve=timestamps).