mk-component-set: apply ld-wrapper for rust-ld#171
Conversation
Upstream-shipped `rust-ld` is now used as default linker for some targets on nightly. It needs ld-wrapper for interopation with libraries from Nix. Currently `wrapBintools` interface is uneasy for hook use inside a derivation also containing non-bintools stuff. We hereby copy part of the implementation and wrap `rust-ld` in-place. See: rust-lang/rust#71515 (comment)
We use `env` attrset in `mkDerivation`.
|
I can confirm this works in my test project too. Building with |
|
Will you port to the upstream rustup? I've submitted a PR (NixOS/nixpkgs#314268), but it only ensures that rust-lld can run. :) |
Sorry but I think it may be too complicated to handle ld wrapping as a rustup patch, especially with the current |
Upstream-shipped
rust-ldis now used as default linker for some targets on nightly. It needs ld-wrapper for interopation with libraries from Nix. CurrentlywrapBintoolsinterface is uneasy for hook use inside a derivation also containing non-bintools stuff. We hereby copy part of the implementation and wraprust-ldin-place.See: rust-lang/rust#71515 (comment)
Fixes #168
External library linking is now working correct. Previously it compiles but the binary fails to run.