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

[WIP] rust: add update script #21922

Closed
wants to merge 1 commit into from
Closed

[WIP] rust: add update script #21922

wants to merge 1 commit into from

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Jan 16, 2017

Policy question: How frequent do we want to update rustNightly?

Things done

  • script to automatically provide checksums for stable, beta, nightly (only depsSha256 needs to be updated manually)
  • rust is always build by the same upstream pre-compiled rust version
  • unify code for bootstraping + add platforms for all channels
  • fix rustc sandbox builds (cargo no longer download the registry)

TODO

  • [ ] integrate update script into general update script infrastructure
  • [ ] automate update of depsSha256
Motivation for this change
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.

Copy link
Member

@globin globin left a comment

Choose a reason for hiding this comment

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

Could you split pkgs/development/compilers/rust/default.nix into smaller files.

Some first nits while glancing over this, haven't reviewed this thoroughly though.

@@ -7,12 +7,14 @@ rustPlatform.buildRustPackage rec {
name = "cargo-${version}";
inherit version;

src = fetchgit {
url = "https://github.com/rust-lang/cargo";
src = fetchFromGitHub {
Copy link
Member

Choose a reason for hiding this comment

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

AFAIK fetchFromGitHub does not work with submodules

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't use github here. The source code comes from rust-lang.org

Copy link
Member

Choose a reason for hiding this comment

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

Huh, you are doing so in this line? 🤔 And cargo is using submodules.

Copy link
Member Author

Choose a reason for hiding this comment

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

sorry mixed that up with rustc. I restored fetchgit for cargo even though the rust-installer submodule is not needed to compile cargo.

prePatch = "cd rust-src/lib/rustlib/src/rust";

# We need rust to build rust.
# Enable vendor flag will prevent rust from downloading anything
Copy link
Member

Choose a reason for hiding this comment

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

Enable -> Enabling

@grahamc
Copy link
Member

grahamc commented Jan 16, 2017

error: undefined variable ‘makeWrapper’ at /nix/store/663rfkmbn6ciyaxf3h249r7srap4ry5l-git-export/pkgs/development/compilers/rust/cargo-bin.nix:18:19

- script to automatically checksums for stable, beta, nightly (only dependency closure needs to be updated manually)
- unify code for bootstraping + add platforms for all channels
- fix rustc sandbox builds (cargo no longer download the registry)
@Mic92
Copy link
Member Author

Mic92 commented Jan 17, 2017

@grahamc I refactored & uploaded a little bit too early and rust takes ages to compile. Now it is in a working stage again.

@matthiasbeyer
Copy link
Contributor

Policy question: How frequent do we want to update rustNightly?

For me, as often as it is released!

@nbp
Copy link
Member

nbp commented Mar 4, 2017

@matthiasbeyer Then use https://github.com/mozilla/nixpkgs-mozilla/blob/master/rust-overlay.nix overlay.
I added instructions on the mailing list for installing it, and detail how it works.

@matthiasbeyer
Copy link
Contributor

@nbp and others, see #23510

@Mic92 Mic92 closed this Jun 7, 2017
@Mic92 Mic92 deleted the rust branch June 7, 2017 13:53
@Mic92 Mic92 restored the rust branch June 7, 2017 13:53
@Mic92 Mic92 deleted the rust branch September 6, 2018 08:47
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.

None yet

5 participants