Hacker News new | past | comments | ask | show | jobs | submit login

I just learned that rustup/rustc/cargo etc. work like this too. I couldn't understand why the gentoo formula was symlinking the same binary to a bunch of aliases.



On my system, these are hardlinks (regular files with a link count >1 and the same inode) rather than symlinks, though I'm not sure why.


Maybe to avoid broken links if you move the original files? That's the main benefit of hardlinks vs symlinks in my mind at least.


That can also be a downside, you believe you have moved stuff but now you can have different versions of programs that don't expect that to be a possibility.


If there is a simlink, a hardlink and an executable, all with the same name, which one will it run? Which one will the shell object to? Which one should the shell object to. If a virus/SUID program overwrites a simlink, no problem, but ift it traces the simlink to the executable, and then over writes that...


And that makes a lot of sense, especially for binaries that are statically linked (as usually are Rust binaries), since that could save a lot of disk space!


clang does this too.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: