-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
[darwin] rustPlatform.buildRustPackage: do not add libiconv to buildInputs #122231
[darwin] rustPlatform.buildRustPackage: do not add libiconv to buildInputs #122231
Conversation
Many buildRustPackage-based derivations require libiconv as a build input on Darwin. This is caused by `libc` unconditionally linking against libiconv. However, this was recently changed: rust-lang/libc#2150 We will probably see this dependency disappear over the coming months once a new `libc` crate version is released and other crates adopt this new version. Since this is already an optional dependency and it will disappear in the coming time, we should probably not unconditionally add it to all Rust crates.
|
Shall we switch this to draft so it's not accidentally merged before |
I can try testing this on darwin -- do you have a particular subset set of packages to test that you know are relevant? FWIW I've been using https://github.com/jtojnar/nixpkgs-fastmac, in addition to the mac in my closet. It seems to work pretty well. |
But we can’t switch wholesale to 0.2.95 once it is out, we have to rely on the various upstream crates to update their lock files. It’s really a dependency that should be tracked per derivation. But I am fine with making this a draft. Then we have this workaround for the 21.05 release and can remove it later. edit: seems like cannot make this a draft on my phone. Feel free to convert it! |
thanks for starting a new PR :) |
0.2.95 was released two weeks ago, so taking this PR out of draft. https://github.com/rust-lang/libc/releases/tag/0.2.95 This is the first version that does not unconditionally link Of course, downstream crates have to update to this version of the |
|
Seems to be there in 21.05? nixpkgs/pkgs/build-support/rust/default.nix Line 122 in 6613a30
|
lorri still breaks as far as I can see: https://github.com/nix-community/lorri/pull/71/checks?check_run_id=3812404819 |
From a quick look, lorri seems to use Carnix? Carnix doesn't use for the |
The PR I linked actually switches it over to crate2nix since carnix is super out of date at this point and failed with the newer lock file format. |
crate2nix also uses |
tbh I stopped caring about Darwin and call upon @NixOS/darwin-maintainers |
I mean this has been broken since May or even earlier, and is exactly why NixOS/rfcs#112 exists. |
@Profpatsch I'd kindly ask you to be less hateful and show some empathy for others. |
This is still required. I tried to figure out why this happens a few months ago, but I only got a little info (it's an upstream issue, to my knowledge). I'll try to pick it back up though. |
(and by "this" I mean that libiconv still needs to be present) |
For anyone else having issues with |
apathy ≠ hate |
Motivation for this change
Many
buildRustPackage
-based derivations requirelibiconv
as a buildinput on Darwin. This is caused by
libc
unconditionally linkingagainst
libiconv
. However, this was recently changed:rust-lang/libc#2150
We will probably see this dependency disappear over the coming months
once a new
libc
crate version is released and other crates adoptthis new version.
Since this is already an optional dependency and it will disappear
in the coming time, we should probably not unconditionally add it
to all Rust crates.
Can't test, because I don't have a Darwin machine.
cc @jonringer
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)