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

rust: 1.51.0 -> 1.52.0 #122110

Merged
merged 1 commit into from
May 8, 2021
Merged

rust: 1.51.0 -> 1.52.0 #122110

merged 1 commit into from
May 8, 2021

Conversation

prusnak
Copy link
Member

@prusnak prusnak commented May 7, 2021

Motivation for this change
  • update rustc to 1.52.0
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@@ -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 ]
Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member

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

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prior discussion: #95556

Copy link
Contributor

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

Copy link
Contributor

@jonringer jonringer May 8, 2021

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.

Copy link
Contributor

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):

rust-lang/libc#2150

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.

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Contributor

@jonringer jonringer left a 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

@jonringer jonringer merged commit 252bf94 into NixOS:staging May 8, 2021
@prusnak prusnak deleted the rust-1.52 branch May 8, 2021 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants