fenix icon indicating copy to clipboard operation
fenix copied to clipboard

[Question] combine and copying bins

Open winterqt opened this issue 4 years ago • 4 comments

https://github.com/nix-community/fenix/blob/ba9a36ef175efed4ef3a3de485131da921439301/lib/combine.nix#L9

Why is this cp invocation needed? If I'm understanding it correctly, it's basically converting the binary links to files, but why is this needed?

winterqt avatar Sep 30 '21 00:09 winterqt

You are understanding it correctly Some of the binaries finds the libraries and sysroot by doing something like readlinking itself, iirc rustc and clippy are two of them Maybe hardlinking could be better? i havent hardlinked anything before, is there any drawbacks?

figsoda avatar Sep 30 '21 01:09 figsoda

Some of the binaries finds the libraries and sysroot by doing something like readlinking itself, iirc rustc and clippy are two of them

I'm confused. Why does it break if we symlink if it's readlinking, then?

Maybe hardlinking could be better? i havent hardlinked anything before, is there any drawbacks?

There shouldn't be, no.

winterqt avatar Oct 01 '21 14:10 winterqt

I'm confused. Why does it break if we symlink if it's readlinking, then?

They try to find the libraries under that path, so rustc wouldn't be able to find rust-std if they are just symlinked into the same package

figsoda avatar Oct 01 '21 14:10 figsoda

I gave hardlinking a try and it gave me ln: failed to create hard link '/nix/store/...' => '/nix/store/...': Invalid cross-device link

I don't think it's possible to hardlink across different derivations right now

might be related: https://github.com/NixOS/nix/issues/1272

figsoda avatar Nov 07 '22 02:11 figsoda