Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] combine and copying bins #44

Open
winterqt opened this issue Sep 30, 2021 · 4 comments
Open

[Question] combine and copying bins #44

winterqt opened this issue Sep 30, 2021 · 4 comments
Labels
question Further information is requested

Comments

@winterqt
Copy link
Member

cp --remove-destination $(realpath $out/bin/*) $out/bin

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?

@figsoda
Copy link
Member

figsoda commented Sep 30, 2021

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?

@winterqt
Copy link
Member Author

winterqt commented Oct 1, 2021

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.

@figsoda
Copy link
Member

figsoda commented Oct 1, 2021

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 figsoda added the question Further information is requested label Oct 8, 2021
@figsoda
Copy link
Member

figsoda commented Nov 7, 2022

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: NixOS/nix#1272

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants