-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
rust: 1.51.0 -> 1.52.0 #122110
rust: 1.51.0 -> 1.52.0 #122110
Conversation
05b4d9b
to
868698a
Compare
@@ -117,7 +118,9 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // lib.optionalAttrs u | |||
rustc | |||
]; | |||
|
|||
buildInputs = buildInputs ++ lib.optional stdenv.hostPlatform.isMinGW windows.pthreads; | |||
buildInputs = buildInputs | |||
++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the update, I tried to build fd
and ripgrep
. They both failed on missing libiconv error. Rather than adding libiconv
to buildInputs
of thousands of individual rust packages, I feel this is the better way to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to agree if this is a dependency of the rust stdlib, otherwise I would keep it rather explicit than bloating the default closure size.. What part in fd
and ripgrep
depends on libiconv
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But let's ask some darwin maintainer: @LnL7 @thefloweringash @abathur
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't been able to pinpoint it, but I think it's clap.
I've made the fix to about 10 packages so far. I don't mind, the only problem is that for some of them, people don't spot the breakage, until somebody running on darwin comes along.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prior discussion: #95556
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think darwin support can be done in another PR. AFAIK, this would have been an existing issue, and I would rather not delay this PR. Darwin maintainers have around 5 days to come up with a solution before the final staging-next cycle will begin before branch-off of 21.05
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I don't think having libiconv as a buildInput will bloat too much, as the likelihood of another package requiring it should be very high.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I have found the culprit. The libc
crate used to unconditionally link libiconv
on Apple platforms:
if target.contains("-apple-") {
println!("cargo:rustc-link-lib=iconv");
}
libc
is a transitive dependency of many widely-used crates, such as rand
, memchr
, and chrono
, so it percolates through much of the Nix ecosystem.
However, this dependency is now made conditional in libc
(only needed when libiconv
symbols are used):
So, I propose that we revert adding libiconv as a buildinput, since it will become unnecessary as more and more crates adopt the next version of libc
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danieldk Thanks for investigating the issue - I guess we can revert the libiconv addition together with once libc 0.2.95 update once it is out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposed PR to remove the dependency #122231.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks :)
https://github.com/NixOS/nixpkgs/pull/122110
1 package built:
ripgrep
Motivation for this change
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)