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

Use rustup to get nightly rust #11361

Closed
mrmiywj opened this issue May 24, 2016 · 20 comments · Fixed by #19395
Closed

Use rustup to get nightly rust #11361

mrmiywj opened this issue May 24, 2016 · 20 comments · Fixed by #19395
Labels

Comments

@mrmiywj
Copy link
Contributor

mrmiywj commented May 24, 2016

Since every time build servo will use nightly rust compiler, is it a good idea to use rustup and overload servo path to build servo with nightly rustc? I mean, since there is a rust version manager, why not just use it?

@jdm jdm added the A-mach label May 24, 2016
@metajack
Copy link
Contributor

Right now the UX for a developer is they can install a few dependencies, and than ./mach build and it just works. This would add a dependency that is not in any package manager, making your first build slightly more difficult.

Additionally we currently support having cargo and rust versions that are separate, but I'm not sure if that is a property we have ever relied on.

Previously, we sometimes had custom Rust builds, but this behavior has not been needed in quite some time.

We could add the overload file even if we don't make that the default way to manage Rust. Will rustup automatically download the right toolchain if it sees an overload file and that version isn't already downloaded? If so, that would enable cargo to work without mach, which would be a nice improvement.

So I think we would accept a PR to add an overload file. I think the discussion of whether we should outsource handling of the Rust toolchain to rustup should probably be discussed on dev-servo first to get more input.

@larsbergstrom
Copy link
Contributor

IIRC @brson thought that we could eventually switch to using his rustup tool, but he's out for the rest of May, so we should probably sync up with him when he's back at work.

@mrmiywj
Copy link
Contributor Author

mrmiywj commented May 25, 2016

Hmm, could I participate in this work, since it maybe look like a medium level work for servo?
Do I need to track the IRC online communication?

@metajack
Copy link
Contributor

@mrmiywj Sure, sounds good.

I investigated how this could work. Overrides appear to be stored in ~/.multirust/overrides. So we can't just check one into the tree as I suggested before, unless rustup searches up the three until it finds .multirust like Cargo does.

An alternative implementation is to detect the presence of rustup on the system, and use that instead of our custom download logic. So this would mean we test for rustup and if present we use rust-nightly-date to set the toolchain override , and change our cargo and rust invocations to use the one in the PATH. I think as part of this work we should remove cargo-nightly-build and just use a single toolchain version.

The end result would be that if you have rustup installed, we would use that infrastructure to manage the toolchains and as a side benefit, raw cargo and rustc invocations would now work without having to go through mach.

There will need to be some care around cross compiling, assuming rustup can manage cross compile toolchains as well.

@larsbergstrom Does this strategy sound reasonable? Are we likely to need independent cargo and rust toolchains anymore?

@brson
Copy link
Contributor

brson commented May 31, 2016

As you've seen there's no way yet to declare in a project what override rustup should use. If you want to integrate with rustup now it's probably best to do as jack describes and detect the existence of the rustup command, though that will leave you with two code paths for downloading the toolchain.

Another option might be to detect whether rustup exists, and if it doesn't install rustup to a private folder by overriding CARGO_HOME and RUSTUP_HOME. That way you would always be using rustup to manage the toolchain. You would still have two code paths though, so it's just complicated in a different way.

@paulrouget
Copy link
Contributor

Now that rust-lang/rustup#460 has landed, can we reconsider this issue?

@paulrouget
Copy link
Contributor

@metajack what do you think?

@jdm
Copy link
Member

jdm commented Jul 6, 2017

As long as we can get the -alt builds via rustup, this seems like it would be a useful improvement. I'm not sure how it will handle a nightly override for Servo as well as a stable override for Stylo, however.

@metajack
Copy link
Contributor

metajack commented Jul 6, 2017

I guess one way would be to let rustup manage servo and mach manage stylo. Or put a rust-toolchain config in the libgecko dir?

@shinglyu
Copy link
Contributor

(@paulrouget asked me to help with this)

So just to make sure, the current plan is to

  • Add a override file in servo directory
  • Detect if rustup is present in the current system
    • Yes => use rustup + override file to download rustc and cargo and use them
    • No => use the old mach download mechanism (?)
  • For stylo, keep the mach behavior until we agree to switch to rustup (?)

@shinglyu
Copy link
Contributor

^ @metajack ?

@metajack
Copy link
Contributor

That sounds fine to start. I would eventually like to end up with just the rustup bootstrapping, but we need some clever way to deal with stylo.

The ideal end goal is that if someone does cargo build instead of ./mach build it would just work aside from the weird cases like Android. In other words, we'd need no bootstrapping for basic build and run.

@shinglyu
Copy link
Contributor

Sounds good, I'll start working on this.

@shinglyu
Copy link
Contributor

Should we still keep the system-rust and system-cargo option? They seem redundant to me if we choose rustup by default?

@metajack
Copy link
Contributor

Yes, we neem system-x options so that custom rust builds will work if someone is testing specific things.

SimonSapin added a commit that referenced this issue Aug 31, 2017
… this time using a `rust-toolchain` file compatible with rustup:
https://github.com/rust-lang-nursery/rustup.rs/#the-toolchain-file

And upgrade to rustc 1.21.0-nightly (c11f689d2 2017-08-29)

----

Now if both `system-rust` and `system-cargo` are set to `true` in `.servobuild`’s `[tools]` section,
and the corresponding `rustc` and `cargo` binaries are in fact rustup’s wrappers,
then rustup will use the correct version based on `rust-toolchain`.

CC #11361

Unlike #17927,
this does not make mach use rustup directly.
@SimonSapin
Copy link
Member

#18325 does not fix this (I think rustup should completely replace our bootstrapping mechanism eventually), but it’s a step.

SimonSapin added a commit that referenced this issue Aug 31, 2017
… this time using a `rust-toolchain` file compatible with rustup:
https://github.com/rust-lang-nursery/rustup.rs/#the-toolchain-file

And upgrade to rustc 1.21.0-nightly (c11f689d2 2017-08-29)

----

Now if both `system-rust` and `system-cargo` are set to `true` in `.servobuild`’s `[tools]` section,
and the corresponding `rustc` and `cargo` binaries are in fact rustup’s wrappers,
then rustup will use the correct version based on `rust-toolchain`.

CC #11361

Unlike #17927,
this does not make mach use rustup directly.
bors-servo pushed a commit that referenced this issue Aug 31, 2017
Switch back to pinning Rust by Nightly date instead of commit hash…

… this time using a `rust-toolchain` file compatible with rustup: https://github.com/rust-lang-nursery/rustup.rs/#the-toolchain-file

And upgrade to rustc 1.21.0-nightly (c11f689d2 2017-08-29)

----

Now if both `system-rust` and `system-cargo` are set to `true` in `.servobuild`’s `[tools]` section, and the corresponding `rustc` and `cargo` binaries are in fact rustup’s wrappers, then rustup will use the correct version based on `rust-toolchain`.

CC #11361

Unlike #17927, this does not make mach use rustup directly. That should wait until rust-lang/rustup#1099 is fixed.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18325)
<!-- Reviewable:end -->
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Sep 1, 2017
…tead of commit hash… (from servo:rustup-toolchain); r=nox

… this time using a `rust-toolchain` file compatible with rustup: https://github.com/rust-lang-nursery/rustup.rs/#the-toolchain-file

And upgrade to rustc 1.21.0-nightly (c11f689d2 2017-08-29)

----

Now if both `system-rust` and `system-cargo` are set to `true` in `.servobuild`’s `[tools]` section, and the corresponding `rustc` and `cargo` binaries are in fact rustup’s wrappers, then rustup will use the correct version based on `rust-toolchain`.

CC servo/servo#11361

Unlike servo/servo#17927, this does not make mach use rustup directly. That should wait until rust-lang/rustup#1099 is fixed.

Source-Repo: https://github.com/servo/servo
Source-Revision: c4800a6c83e6fdabaf7c4eff70a24487d16f18ff

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : e3d41159bc4670ea990630e5342fe9b663a79fe5
xeonchen pushed a commit to xeonchen/gecko-cinnabar that referenced this issue Sep 1, 2017
…tead of commit hash… (from servo:rustup-toolchain); r=nox

… this time using a `rust-toolchain` file compatible with rustup: https://github.com/rust-lang-nursery/rustup.rs/#the-toolchain-file

And upgrade to rustc 1.21.0-nightly (c11f689d2 2017-08-29)

----

Now if both `system-rust` and `system-cargo` are set to `true` in `.servobuild`’s `[tools]` section, and the corresponding `rustc` and `cargo` binaries are in fact rustup’s wrappers, then rustup will use the correct version based on `rust-toolchain`.

CC servo/servo#11361

Unlike servo/servo#17927, this does not make mach use rustup directly. That should wait until rust-lang/rustup#1099 is fixed.

Source-Repo: https://github.com/servo/servo
Source-Revision: c4800a6c83e6fdabaf7c4eff70a24487d16f18ff
aethanyc pushed a commit to aethanyc/gecko-dev that referenced this issue Sep 2, 2017
…tead of commit hash… (from servo:rustup-toolchain); r=nox

… this time using a `rust-toolchain` file compatible with rustup: https://github.com/rust-lang-nursery/rustup.rs/#the-toolchain-file

And upgrade to rustc 1.21.0-nightly (c11f689d2 2017-08-29)

----

Now if both `system-rust` and `system-cargo` are set to `true` in `.servobuild`’s `[tools]` section, and the corresponding `rustc` and `cargo` binaries are in fact rustup’s wrappers, then rustup will use the correct version based on `rust-toolchain`.

CC servo/servo#11361

Unlike servo/servo#17927, this does not make mach use rustup directly. That should wait until rust-lang/rustup#1099 is fixed.

Source-Repo: https://github.com/servo/servo
Source-Revision: c4800a6c83e6fdabaf7c4eff70a24487d16f18ff
@SimonSapin
Copy link
Member

Update: rust-lang/rustup#1250 has landed in rustup master but is not in a release yet.

@SimonSapin
Copy link
Member

Rustup 1.7.0 is released. (Thanks Alex!)

~/servo$ cargo build --manifest-path ports/servo/Cargo.toml
info: syncing channel updates for 'nightly-2017-10-13-x86_64-unknown-linux-gnu'
info: latest update on 2017-10-13, rust version 1.22.0-nightly (dcbbfb6e8 2017-10-12)
[]
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: installing component 'rust-docs'
   Compiling percent-encoding v1.0.0
[]

SimonSapin added a commit that referenced this issue Nov 28, 2017
SimonSapin added a commit that referenced this issue Dec 9, 2017
bors-servo pushed a commit that referenced this issue Dec 12, 2017
Use rustup.rs instead of custom bootstrap

Fixes #11361, closes #18874

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19395)
<!-- Reviewable:end -->
SimonSapin added a commit that referenced this issue Dec 14, 2017
bors-servo pushed a commit that referenced this issue Dec 14, 2017
Use rustup.rs instead of custom bootstrap

Fixes #11361, closes #18874

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19395)
<!-- Reviewable:end -->
SimonSapin added a commit that referenced this issue Dec 19, 2017
bors-servo pushed a commit that referenced this issue Dec 19, 2017
Use rustup.rs instead of custom bootstrap

Fixes #11361, closes #18874

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19395)
<!-- Reviewable:end -->
SimonSapin added a commit that referenced this issue Dec 19, 2017
bors-servo pushed a commit that referenced this issue Dec 19, 2017
Use rustup.rs instead of custom bootstrap

Fixes #11361, closes #18874

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19395)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Dec 20, 2017
Use rustup.rs instead of custom bootstrap

Fixes #11361, closes #18874

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19395)
<!-- Reviewable:end -->
SimonSapin added a commit that referenced this issue Jan 7, 2018
bors-servo pushed a commit that referenced this issue Jan 7, 2018
Use rustup.rs instead of custom bootstrap

Fixes #11361, closes #18874

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19395)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Jan 8, 2018
Use rustup.rs instead of custom bootstrap

Fixes #11361, closes #18874

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19395)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Jan 9, 2018
Use rustup.rs instead of custom bootstrap

Fixes #11361, closes #18874

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19395)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Jan 9, 2018
Use rustup.rs instead of custom bootstrap

Fixes #11361, closes #18874

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19395)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Jan 9, 2018
Use rustup.rs instead of custom bootstrap

Fixes #11361, closes #18874

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19395)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Jan 9, 2018
Use rustup.rs instead of custom bootstrap

Fixes #11361, closes #18874

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19395)
<!-- Reviewable:end -->
SimonSapin added a commit that referenced this issue Jan 9, 2018
bors-servo pushed a commit that referenced this issue Jan 9, 2018
Use rustup.rs instead of custom bootstrap

Fixes #11361, closes #18874, fixes #19365.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19395)
<!-- Reviewable:end -->
SimonSapin added a commit that referenced this issue Jan 9, 2018
bors-servo pushed a commit that referenced this issue Jan 9, 2018
Use rustup.rs instead of custom bootstrap

Fixes #11361, closes #18874, fixes #19365.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19395)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Jan 10, 2018
Use rustup.rs instead of custom bootstrap

Fixes #11361, closes #18874, fixes #19365.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19395)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Jan 10, 2018
Use rustup.rs instead of custom bootstrap

Fixes #11361, closes #18874, fixes #19365.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19395)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Jan 10, 2018
Use rustup.rs instead of custom bootstrap

Fixes #11361, closes #18874, fixes #19365.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19395)
<!-- Reviewable:end -->
SimonSapin added a commit that referenced this issue Jan 10, 2018
bors-servo pushed a commit that referenced this issue Jan 10, 2018
Use rustup.rs instead of custom bootstrap

Fixes #11361, closes #18874, fixes #19365.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19395)
<!-- Reviewable:end -->
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 1, 2019
…tead of commit hash… (from servo:rustup-toolchain); r=nox

… this time using a `rust-toolchain` file compatible with rustup: https://github.com/rust-lang-nursery/rustup.rs/#the-toolchain-file

And upgrade to rustc 1.21.0-nightly (c11f689d2 2017-08-29)

----

Now if both `system-rust` and `system-cargo` are set to `true` in `.servobuild`’s `[tools]` section, and the corresponding `rustc` and `cargo` binaries are in fact rustup’s wrappers, then rustup will use the correct version based on `rust-toolchain`.

CC servo/servo#11361

Unlike servo/servo#17927, this does not make mach use rustup directly. That should wait until rust-lang/rustup#1099 is fixed.

Source-Repo: https://github.com/servo/servo
Source-Revision: c4800a6c83e6fdabaf7c4eff70a24487d16f18ff

UltraBlame original commit: 5df6f8fe6c50631fe00f47b69d16b8d555d90503
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 1, 2019
…tead of commit hash… (from servo:rustup-toolchain); r=nox

… this time using a `rust-toolchain` file compatible with rustup: https://github.com/rust-lang-nursery/rustup.rs/#the-toolchain-file

And upgrade to rustc 1.21.0-nightly (c11f689d2 2017-08-29)

----

Now if both `system-rust` and `system-cargo` are set to `true` in `.servobuild`’s `[tools]` section, and the corresponding `rustc` and `cargo` binaries are in fact rustup’s wrappers, then rustup will use the correct version based on `rust-toolchain`.

CC servo/servo#11361

Unlike servo/servo#17927, this does not make mach use rustup directly. That should wait until rust-lang/rustup#1099 is fixed.

Source-Repo: https://github.com/servo/servo
Source-Revision: c4800a6c83e6fdabaf7c4eff70a24487d16f18ff

UltraBlame original commit: 5df6f8fe6c50631fe00f47b69d16b8d555d90503
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 1, 2019
…tead of commit hash… (from servo:rustup-toolchain); r=nox

… this time using a `rust-toolchain` file compatible with rustup: https://github.com/rust-lang-nursery/rustup.rs/#the-toolchain-file

And upgrade to rustc 1.21.0-nightly (c11f689d2 2017-08-29)

----

Now if both `system-rust` and `system-cargo` are set to `true` in `.servobuild`’s `[tools]` section, and the corresponding `rustc` and `cargo` binaries are in fact rustup’s wrappers, then rustup will use the correct version based on `rust-toolchain`.

CC servo/servo#11361

Unlike servo/servo#17927, this does not make mach use rustup directly. That should wait until rust-lang/rustup#1099 is fixed.

Source-Repo: https://github.com/servo/servo
Source-Revision: c4800a6c83e6fdabaf7c4eff70a24487d16f18ff

UltraBlame original commit: 5df6f8fe6c50631fe00f47b69d16b8d555d90503
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
8 participants