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

Expose custom Rust registry versions #26582

Closed
wants to merge 2 commits into from

Conversation

tilpner
Copy link
Member

@tilpner tilpner commented Jun 14, 2017

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
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

@tilpner tilpner force-pushed the rust-registry-version branch from 4288b35 to 9f9fc9e Compare June 14, 2017 22:12
@@ -5770,6 +5770,8 @@ with pkgs;
inherit (darwin) apple_sdk;
};

makeRustRegistry = import ./rust-packages.nix;
Copy link
Member

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

Copy link
Member Author

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

@@ -21,7 +22,7 @@ let

in

runCommand "rustRegistry-${version}-${builtins.substring 0 7 rev}" { inherit src; } ''
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

@tilpner tilpner force-pushed the rust-registry-version branch 6 times, most recently from 290a9a6 to 8bc15dc Compare June 15, 2017 12:12

Verified

This commit was signed with the committer’s verified signature. The key has expired.
Ma27 Maximilian Bosch
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.
@tilpner tilpner force-pushed the rust-registry-version branch from 8bc15dc to f4d80af Compare June 15, 2017 12:13
, ... } @ args:

let
lib = stdenv.lib;
rustRegistry = callPackage (path + /pkgs/top-level/rust-packages.nix)
(lib.optionalAttrs (registry != null) { src = registry; });
Copy link
Member

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.

@Mic92
Copy link
Member

Mic92 commented Jun 16, 2017

This looks good to me. Can you also take a look at it? @LnL7

@Mic92 Mic92 force-pushed the rust-registry-version branch from e3df560 to b42b6fd Compare June 16, 2017 08:48
@LnL7 LnL7 added 6.topic: rust 2.status: merge conflict This PR has merge conflicts with the target branch labels Jun 18, 2017
@Mic92 Mic92 closed this in 7a10cc8 Jun 25, 2017
@tilpner tilpner deleted the rust-registry-version branch August 11, 2017 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: rust
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants