Skip to content

fix(flow): copy cached netlists with --preserve=timestamps - #4394

Merged
maliberty merged 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:fix-cached-netlist-cp-nfs4-acl
Aug 5, 2026
Merged

maliberty merged 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:fix-cached-netlist-cp-nfs4-acl

Conversation

@openroad-ci

@openroad-ci openroad-ci commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Problem

Building gf12 bp_dual/bp_quad/ca53 with SYNTH_NETLIST_FILES out of /local-ssd fails at the synth stage:

cp: preserving permissions for '…/1_2_yosys.v': Operation not supported

Reported by @jeffng-or (2026-08-04).

Root cause

Every file on an NFSv4 mount carries a synthesized system.nfs4_acl xattr (the trailing + in ls -l). cp -p preserves mode, which makes coreutils copy ACLs as well; fsetxattr(dst, "system.nfs4_acl", …) returns EOPNOTSUPP on a destination filesystem that cannot store it (ext4, tmpfs), so cp exits 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=timestamps is the right scope. Two alternatives that do not work:

  • --preserve=mode,timestamps still fails: mode is what triggers the ACL copy.
  • Tcl file copy + file mtime: file mtime is 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.tcl already documents this trap for orfs_copy_db.

Verified

On an NFSv4.1-mounted source (/platforms) with an ext4 destination: cp -p exits 1, cp --preserve=timestamps exits 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, tar with -p/--acls, shutil.copy2/copystat, bazel copy rules): these two lines in synth_preamble.tcl are the only affected sites. makeIssue.sh's tar does not pass --acls, so it does not store ACLs. The remaining cp -r/cp -f uses don't preserve mode.

Note

First revision used cp --preserve=timestamps, which is GNU-only. Switched to plain cp + touch -r (per review): portable to macOS/BSD, and on Linux touch -r preserves the nanosecond mtime exactly (verified identical to --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>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread flow/scripts/synth_preamble.tcl Resolved
Comment thread flow/scripts/synth_preamble.tcl Resolved
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
maliberty enabled auto-merge August 5, 2026 06:28
@maliberty
maliberty merged commit f4b9d7d into The-OpenROAD-Project:master Aug 5, 2026
8 checks passed
@maliberty
maliberty deleted the fix-cached-netlist-cp-nfs4-acl branch August 5, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants