-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
Expose custom Rust registry versions #26582
Conversation
4288b35
to
9f9fc9e
Compare
pkgs/top-level/all-packages.nix
Outdated
@@ -5770,6 +5770,8 @@ with pkgs; | |||
inherit (darwin) apple_sdk; | |||
}; | |||
|
|||
makeRustRegistry = import ./rust-packages.nix; |
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 callPackage
does a little bit more then just import
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.
You were completely right, I fixed that
pkgs/top-level/rust-packages.nix
Outdated
@@ -21,7 +22,7 @@ let | |||
|
|||
in | |||
|
|||
runCommand "rustRegistry-${version}-${builtins.substring 0 7 rev}" { inherit src; } '' |
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.
might be still useful to have rev
here. This could be an optional string if src
is not overwritten by the user.
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.
Do you know why the rev was sliced to the first 8 characters here? Why not put it all in there?
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 just to save visual space.
290a9a6
to
8bc15dc
Compare
This allows users to specify a custom registry src, because currently every packager would need to create an outdated Cargo.lock just to be compatible with the probably outdated rustRegistry in nixpkgs. Currently there is no easy way to convince cargo to do that, so this makes that workaround unnecessary.
8bc15dc
to
f4d80af
Compare
pkgs/build-support/rust/default.nix
Outdated
, ... } @ args: | ||
|
||
let | ||
lib = stdenv.lib; | ||
rustRegistry = callPackage (path + /pkgs/top-level/rust-packages.nix) | ||
(lib.optionalAttrs (registry != null) { src = registry; }); |
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.
this looks also a bit weird. I now made rustRegistry a proper package.
This looks good to me. Can you also take a look at it? @LnL7 |
e3df560
to
b42b6fd
Compare
Motivation for this change
This allows users to specify a custom registry src,
because currently every packager would need to create
an outdated Cargo.lock just to be compatible with the
probably outdated rustRegistry in nixpkgs.
Currently there is no easy way to convince cargo to
do that, so this makes that workaround unnecessary.
Not tested, this is only a PR already for review purposes, don't merge just yet
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)