Skip to main content

Module clone

Module clone 

Source
Expand description

Clone of a store tree into vendor/, the hot path of the install. macOS/APFS: clonefile(2) of the whole directory (one syscall, copy-on-write, measured 8x faster than extraction in M0). Elsewhere, or if clonefile fails (other FS, different volume): recursive walk with hardlinks (pnpm model), and a real copy as a last resort. Always towards an ABSENT destination (the caller removes the previous version first), so no mixed states.

Functions§

clone_tree
symlink_like_unzip
A symbolic link the way unzip (Composer’s extractor) leaves one: on macOS the link’s own mode is 0777 (fchmodat without following), where a plain symlink() gets the umask applied; Linux ignores link modes.