Hard links copy the whole target node, symlinks included

Merged
LU
22d ago
+1567-138

A hard link was replayed as a regular file with the target's attributes, so a hard link to a symlink kept the symlink mode but had no target and readlink failed with EINVAL. Nix's optimised store hard-links symlinks into /nix/store/.links, which broke every nixpacks-built image (unreadable libz.so.1 and friends). Regression test added.

Made with Cursor