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.rs instead of custom bootstrap #19395

Merged
merged 10 commits into from Jan 10, 2018
Merged

Use rustup.rs instead of custom bootstrap #19395

merged 10 commits into from Jan 10, 2018

Conversation

@SimonSapin
Copy link
Member

SimonSapin commented Nov 27, 2017

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


This change is Reviewable

@highfive
Copy link

highfive commented Nov 27, 2017

Heads up! This PR modifies the following files:

  • @wafflespeanut: python/servo/devenv_commands.py, python/servo/post_build_commands.py, python/servo/command_base.py, python/servo/testing_commands.py, python/servo/util.py and 2 more
  • @rillian: rust-stable-version
@SimonSapin
Copy link
Member Author

SimonSapin commented Nov 27, 2017

Before this can land:

At first, contributors will probably have an older version of rustup and see something like this:

$ ./mach build
error: Found argument '--install' which wasn't expected, or isn't valid in this context

USAGE:
    rustup run <toolchain> <command>...

For more information try --help
Build FAILED in 0:00:00

This is pretty bad since --help in the output refers to rustup run --help, not ./mach build --help. And even rustup run --help wouldn’t be helpful since it doesn’t know about options added in later versions.

Mach cannot easily distinguish this case from a "normal" build failure, so the only way to detect this situation and print a better diagnostic we would need to run rustup --version and parse its output every time we’re about to run rustup run. This seems overkill, but perhaps I shouldn’t worry about that.

r? @jdm

@SimonSapin
Copy link
Member Author

SimonSapin commented Nov 27, 2017

subprocess.check_output(["rustup", "--version"]) takes ~3ms on my laptop, so really not worth worrying about compared to existing overhead of Mach. I’ve added the detection mentioned above.

@SimonSapin
Copy link
Member Author

SimonSapin commented Nov 27, 2017

With this PR running cargo build --manifest-path ports/servo/Cargo.toml will use the same compiler as ./mach build. However going back and forth between those will still recompile everything because mach sets the RUSTFLAGS environment variable.

To not have RUSTFLAGS by default we’d need rustc to revert back to using ld.gold by default: rust-lang/rust#29974, and us to replace -W unused-extern-crates with #![warn(unused_extern_crate)] in each crate.

@jdm
Copy link
Member

jdm commented Nov 27, 2017

Our Appvey and TravisCI are missing rustup; test-tidy is failing; and test-wpt is broken because ensure_bootstrapped was removed.

@jdm jdm assigned jdm and unassigned glennw Nov 27, 2017
@SimonSapin
Copy link
Member Author

SimonSapin commented Nov 28, 2017

Thanks. I pushed something to try to fix these immediate issues, but as I mentioned we’re still waiting on a new rustup release.

@SimonSapin SimonSapin force-pushed the rustup.rs branch 2 times, most recently from 99377c9 to ae1e125 Nov 28, 2017
['git', 'show', '%s:%s' % (commit_hash, toolchain_file)])
old_toolchains.append(toolchain.strip())

remove_anything = False

This comment has been minimized.

@jdm

jdm Nov 28, 2017

Member

This doesn't match the remove_anything variable later.

This comment has been minimized.

@SimonSapin

SimonSapin Nov 28, 2017

Author Member

This as reported by tidy and fixed.

- rustup-init.exe -y --default-host x86_64-pc-windows-msvc --default-toolchain none
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
- rustc -V
- cargo -V

This comment has been minimized.

@jdm

jdm Nov 28, 2017

Member

Should we modify the cache instructions above this block?

This comment has been minimized.

@SimonSapin

SimonSapin Nov 28, 2017

Author Member

It looks like this caches the .servo directory including the extracted rustc and cargo downloaded by mach. Do we want to cache toolchains downloaded by rustup?

This comment has been minimized.

@jdm

jdm Nov 28, 2017

Member

Yes, since it makes builds a bit faster.

This comment has been minimized.

@SimonSapin

SimonSapin Nov 28, 2017

Author Member

Alright, done.

@bors-servo
Copy link
Contributor

bors-servo commented Nov 28, 2017

The latest upstream changes (presumably #19410) made this pull request unmergeable. Please resolve the merge conflicts.

@bors-servo
Copy link
Contributor

bors-servo commented Dec 9, 2017

The latest upstream changes (presumably #19532) made this pull request unmergeable. Please resolve the merge conflicts.

@SimonSapin SimonSapin force-pushed the rustup.rs branch from 282562c to 034e834 Dec 9, 2017
@SimonSapin
Copy link
Member Author

SimonSapin commented Dec 9, 2017

Rustup release is blocked on rust-lang/rustup#1305

@SimonSapin
Copy link
Member Author

SimonSapin commented Dec 12, 2017

Added a commit to unblock by not using the new rustup feature.

@bors-servo try

@SimonSapin
Copy link
Member Author

SimonSapin commented Jan 10, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Jan 10, 2018

Trying commit 272fef3 with merge f26eb55...

bors-servo added a commit that referenced this pull request 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
Copy link
Contributor

bors-servo commented Jan 10, 2018

@jdm
jdm approved these changes Jan 10, 2018
@SimonSapin SimonSapin force-pushed the rustup.rs branch from 272fef3 to 0681e68 Jan 10, 2018
@SimonSapin
Copy link
Member Author

SimonSapin commented Jan 10, 2018

@bors-servo r=jdm

@bors-servo
Copy link
Contributor

bors-servo commented Jan 10, 2018

📌 Commit 0681e68 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Jan 10, 2018

Testing commit 0681e68 with merge 2be49ac...

bors-servo added a commit that referenced this pull request 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
Copy link
Contributor

bors-servo commented Jan 10, 2018

@bors-servo bors-servo merged commit 0681e68 into master Jan 10, 2018
4 of 5 checks passed
4 of 5 checks passed
Taskcluster (pull_request) TaskGroup: failure
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
dependency-ci Dependencies checked
Details
homu Test successful
Details
@SimonSapin SimonSapin deleted the rustup.rs branch Jan 10, 2018
@SimonSapin SimonSapin mentioned this pull request Jan 10, 2018
1 of 5 tasks complete
SimonSapin added a commit that referenced this pull request Jan 12, 2018
Closes #16710, which was actually fixed by
6dff251 in #19395.
This exercises that fix.
SimonSapin added a commit that referenced this pull request Jan 12, 2018
Closes #16710, which was actually fixed by
6dff251 in #19395.
This exercises that fix.

Green AppVeyor build: https://ci.appveyor.com/project/servo/servo/build/1.0.24124
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.