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

rustPlatform.rust: deprecate #230951

Merged
merged 2 commits into from
May 12, 2023
Merged

Conversation

alyssais
Copy link
Member

@alyssais alyssais commented May 9, 2023

Description of changes

It is almost never correct to use these attributes, because they don't work correctly with splicing. Compare:

% nix repl -f . --argstr crossSystem aarch64-linux
Welcome to Nix 2.10.3. Type :? for help.

Loading installable ''...
Added 18988 variables.
nix-repl> callPackage ({ stdenv, rustc }: (stdenv.mkDerivation { name = ""; nativeBuildInputs = [ rustc ]; }).nativeBuildInputs) {}
«derivation /nix/store/bjrkg8kcq3hvg5kb03ivb856zy91qpbk-aarch64-unknown-linux-gnu-rustc-1.69.0.drv» ]

nix-repl> callPackage ({ stdenv, rustPlatform }: (stdenv.mkDerivation { name = ""; nativeBuildInputs = [ rustPlatform.rust.rustc ]; }).nativeBuildInputs) {}
«derivation /nix/store/ra5r07j52y7akclr827r3dzxzvqnvfbl-rustc-1.69.0.drv» ]

I'm not sure this is fixable. I don't think it's worth keeping them around considering we have top level attributes. It makes overriding slightly more annoying, but only slightly.

I'm aiming for zero rebuilds with this. Draft until I get there.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@alyssais alyssais added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label May 9, 2023
@alyssais alyssais requested a review from Ericson2314 May 9, 2023 20:34
@alyssais alyssais force-pushed the rustPlatform.rust-deprecate branch 8 times, most recently from 8c24662 to 65c40dc Compare May 10, 2023 22:47
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels May 11, 2023
@alyssais alyssais marked this pull request as ready for review May 11, 2023 08:46
@Mic92
Copy link
Member

Mic92 commented May 11, 2023

rustPlatform.rust from the time where we also had nightly and beta channels build from source. Not having that is much nicer.

@mweinelt mweinelt added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label May 11, 2023
This will be deprecated in the next commit.
It is almost never correct to use these attributes, because they don't
work correctly with splicing.  Compare:

	% nix repl -f . --argstr crossSystem aarch64-linux
	Welcome to Nix 2.10.3. Type :? for help.

	Loading installable ''...
	Added 18988 variables.
	nix-repl> callPackage ({ stdenv, rustc }: (stdenv.mkDerivation { name = ""; nativeBuildInputs = [ rustc ]; }).nativeBuildInputs) {}
	«derivation /nix/store/bjrkg8kcq3hvg5kb03ivb856zy91qpbk-aarch64-unknown-linux-gnu-rustc-1.69.0.drv» ]

	nix-repl> callPackage ({ stdenv, rustPlatform }: (stdenv.mkDerivation { name = ""; nativeBuildInputs = [ rustPlatform.rust.rustc ]; }).nativeBuildInputs) {}
	«derivation /nix/store/ra5r07j52y7akclr827r3dzxzvqnvfbl-rustc-1.69.0.drv» ]

I'm not sure this is fixable.  I don't think it's worth keeping them
around considering we have top level attributes.  It makes overriding
slightly more annoying, but only slightly.
@alyssais alyssais force-pushed the rustPlatform.rust-deprecate branch from 65c40dc to d0f8e51 Compare May 12, 2023 14:20
@alyssais alyssais merged commit 46cb0eb into NixOS:master May 12, 2023
@alyssais alyssais deleted the rustPlatform.rust-deprecate branch May 12, 2023 15:31
figsoda added a commit to figsoda/nixpkgs that referenced this pull request May 12, 2023
rustPlatform.rust has been deprecated in NixOS#230951
@figsoda figsoda mentioned this pull request May 12, 2023
12 tasks
winterqt pushed a commit that referenced this pull request May 12, 2023
rustPlatform.rust has been deprecated in #230951
@alyssais alyssais mentioned this pull request May 22, 2023
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different platform than they will be used on 6.topic: python 6.topic: qt/kde 6.topic: ruby 6.topic: rust 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants