Skip to content

rustc: 1.0.0 -> 1.1.0 - #8668

Merged
wizeman merged 5 commits into
NixOS:masterfrom
telotortium:rustc-update-to-1.1.0
Jul 12, 2015
Merged

wizeman merged 5 commits into
NixOS:masterfrom
telotortium:rustc-update-to-1.1.0

Conversation

@telotortium

Copy link
Copy Markdown
Contributor

No description provided.

@telotortium

Copy link
Copy Markdown
Contributor Author

@telotortium
telotortium force-pushed the rustc-update-to-1.1.0 branch from 75bcbd9 to 2b929ca Compare July 7, 2015 06:16
@madjar

madjar commented Jul 7, 2015

Copy link
Copy Markdown
Member

Looks good to me.

@telotortium Did you build it locally ? If not, I guess we could just send it to hydra.

@flosse

flosse commented Jul 7, 2015

Copy link
Copy Markdown
Contributor

Great! Could you update cargo too? Thanks a lot.

@wizeman

wizeman commented Jul 7, 2015

Copy link
Copy Markdown
Member

Looks good to me too.

@wizeman

wizeman commented Jul 7, 2015

Copy link
Copy Markdown
Member

@flosse I'm in the process of updating nightly rust, cargo and racerRust.

@telotortium

Copy link
Copy Markdown
Contributor Author

@flosse I've updated cargo locally too, as well as rustPlatform in order to build cargo. I have a couple more questions:

  1. They've started to release cargo with SemVer-based version numbers (specifically, I've built 0.3.0, which builds with stable Rust 1.1.0). Should we switch over the non-snapshot build to use these numbers rather than dates?
  2. I've switched rustCargoPlatform to use the stable rustc rather than the nightly rustcMaster. OK?
  3. No new Cargo snapshot has been made in the rust-lang/cargo repo, so cargoSnapshot has not been updated and is even more out of date than before. Is there a way to hide the cargoSnapshot package from nix-env -qa, since it's only used to build cargo?

@wizeman

wizeman commented Jul 7, 2015

Copy link
Copy Markdown
Member

@telotortium

  1. I think that should be fine, but IMO you should also change fetchgit's rev attribute (i.e., the src.rev attribute) in cargo's default.nix file to be "refs/tags/0.3.0".
  2. Perfect
  3. I don't know whether there is a better way to do this (it seems kind of hack), but if you change cargoSnapshot = callPackage... to something like cargoSnapshot = { cargo = callPackage... };, then nix-env won't see it (unless you'd also add a recurseIntoAttrs). In this case you'd then have to change cargoSnapshot references to cargoSnapshot.cargo. But I suspect that there's a better way to do this...

@telotortium

Copy link
Copy Markdown
Contributor Author

Actually, I needed to update the Cargo snapshot to some later nightly (I used 2015-06-17) to avoid rust-lang/cargo#976.

@telotortium

Copy link
Copy Markdown
Contributor Author

@madjar I've installed rustc and cargo locally, but I'm going to use nix-build to test out the builds locally as well (since I just found out about that command).

@jagajaga

jagajaga commented Jul 7, 2015

Copy link
Copy Markdown
Member

What about racer pkg, wasn't it broken by update?

@telotortium
telotortium force-pushed the rustc-update-to-1.1.0 branch from 9daccd5 to d782f28 Compare July 7, 2015 23:42
@telotortium

Copy link
Copy Markdown
Contributor Author

@jagajaga The current version of racer builds fine for me after the updates to rustc and cargo.

@telotortium

Copy link
Copy Markdown
Contributor Author

@wizeman Implemented your suggestions.

@Havvy

Havvy commented Jul 8, 2015

Copy link
Copy Markdown
Contributor

Instead of removing 1.0.0.nix and adding 1.1.0.nix, can you just name the file to stable.nix or possibly default.nix?

Furthermore, I didn't see that this was here, so I made a PR (#8701) myself that included various comments for how to update the rustc snapshot information. Can you perhaps merge those comments into your PR?

@telotortium
telotortium force-pushed the rustc-update-to-1.1.0 branch from d782f28 to 1469e6a Compare July 8, 2015 16:03
@telotortium

Copy link
Copy Markdown
Contributor Author

Patched the contents of #8701 into this PR (including adding @Havvy as a maintainer, let me know if you want me to remove that).

@Havvy

Havvy commented Jul 8, 2015

Copy link
Copy Markdown
Contributor

You can keep me as a maintainer. Now that I know how, it's not a major burden to do it.

@wizeman

wizeman commented Jul 9, 2015

Copy link
Copy Markdown
Member

When testing these commits locally I got a hash mismatch in cargo:

Failed: output path ‘/nix/store/l5rfbx2b1plrjljilpv8zfg8ix6wssfw-cargo’ should have r:sha256 hash ‘1y90d5zdlivsx67ac5k4zr5d4m6mirbhj76xp0fwd7k61rx0svws’, instead has ‘1ckb2xd7nm8357imw6b1ci2ar8grnihzan94kvmjrijq6sz8yv9i’

Did you update the hash when you switched to using refs/tags/0.3.0 instead of the commit hash?

@telotortium

Copy link
Copy Markdown
Contributor Author

I remember a vague mention somewhere that leaveDotGit may cause problems.

@wizeman

wizeman commented Jul 9, 2015

Copy link
Copy Markdown
Member

Perhaps you're referring to #8567.

It could be because of that, but this type of problem is more likely to be because you didn't update the hash when you switched to using refs/tags/0.3.0 instead of the commit hash. Did you forget to do this, by any chance?

Note that you won't necessarily experience this error even if you forgot to update the hash, because Nix will reuse the output of the previous hash if you had already downloaded it. This means it would work on your machine (because Nix had already fetched the contents that had the previous hash), but it wouldn't work on others...

@telotortium

Copy link
Copy Markdown
Contributor Author

That could be it. How do you force Nix to do a rebuild?

@wizeman

wizeman commented Jul 10, 2015

Copy link
Copy Markdown
Member

Usually nix will not rebuild the same package unless the inputs have changed. Right now, on your machine, even though you changed the git revision, nix still thinks the inputs haven't changed because the input hash hasn't changed.

So what I do in this case is to change the last character of the hash (to a zero, for example), which makes Nix think that the input has changed. If you then tell Nix to build the package, Nix will rebuild it (because the hash changed), then it will complain about a wrong hash and tell you the correct one at the same time (like in the error message I showed above).

There is a more standard solution to rebuild a package, which involves running nix-store --delete /nix/store/<derivation-path> and then nix-build it. However, this is much harder to get right unless you're sure you know what you're doing, because nix will refuse to delete something when there are references to it somewhere in the nix store or in some profile, and also, you'd have to be sure you're deleting the right derivation. For example, in this case, the right derivation to delete wouldn't be the cargo package, it would be the src attribute of the cargo derivation (i.e. the result of fetchgit)...

So I think the first suggestion I mentioned, although hackier, is easier to get right.

Use stable Rust now that Cargo builds on stable Rust.
Update snapshot to avoid rust-lang/cargo#976, which otherwise breaks the
build.

Also move the `cargoSnapshot` derivation inside a set in
pkgs/top-level/all-packages.nix in order to hide the `cargo-snapshot`
packages from `nix-env -qa`, since it's only used to build the `cargo`
package.
Rename cargo to use a version number rather than a date because Cargo
has started releasing packages using version numbers.
@telotortium
telotortium force-pushed the rustc-update-to-1.1.0 branch from 1469e6a to 51972d4 Compare July 10, 2015 05:57
@telotortium

Copy link
Copy Markdown
Contributor Author

I pushed the change to the Cargo hash

wizeman added a commit that referenced this pull request Jul 12, 2015
@wizeman
wizeman merged commit 71c1644 into NixOS:master Jul 12, 2015
@wizeman

wizeman commented Jul 12, 2015

Copy link
Copy Markdown
Member

Merged. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants