Closed Bug 1385241 Opened 5 years ago Closed 5 years ago
Remove Mozillabuild bootstrap Rust installation code
59 bytes, text/x-review-board-request
Doesn't go away with MozillaBuild 3.0.0
Note: $rustup install stable-i686-pc-windows-msvc doesn't help if rustup command can't be found, try restarting the terminal.
mach is trying to install rust even it's already there. mach is missing a check if it's already installed. a quick and dirty fix in case you are facing this issue and need to move on: diff --git a/python/mozboot/mozboot/mozillabuild.py b/python/mozboot/mozboot/mozillabuild.py --- a/python/mozboot/mozboot/mozillabuild.py +++ b/python/mozboot/mozboot/mozillabuild.py @@ -15,17 +15,17 @@ class MozillaBuildBootstrapper(BaseBoots def __init__(self, no_interactive=False): BaseBootstrapper.__init__(self, no_interactive=no_interactive) print("mach bootstrap is not fully implemented in MozillaBuild") def which(self, name): return BaseBootstrapper.which(self, name + '.exe') def install_system_packages(self): - self.install_rustup() + return def install_rustup(self): try: rustup_init = tempfile.gettempdir() + '/rustup-init.exe' self.http_download_and_save( 'https://static.rust-lang.org/rustup/archive/0.2.0/i686-pc-windows-msvc/rustup-init.exe', rustup_init, 'a45ab7462b567dacddaf6e9e48bb43a1b9c1db4404ba77868f7d6fc685282a46')
(In reply to Honza Bambas (:mayhemer) from comment #3) > a quick and dirty fix in case you are facing this issue and need to move on: Credit: Ted!
MozillaBuildBootstrapper.install_rustup unconditionally installs rustup: https://dxr.mozilla.org/mozilla-central/rev/36f95aeb4c77f7cf3b3366583008cd6e4b6b1dba/python/mozboot/mozboot/mozillabuild.py#25 rustup mostly handles this OK, but it also unconditionally runs `rustup target add i686-pc-windows-msvc`, which fails if it already exists, so bootstrap fails even though all the Rust bits are actually there. mozboot.base already has an `ensure_rust_modern` that ought to work fine: https://dxr.mozilla.org/mozilla-central/rev/36f95aeb4c77f7cf3b3366583008cd6e4b6b1dba/python/mozboot/mozboot/base.py#592 and in fact the main bootstrap process will call that after `install_system_packages` anyway: https://dxr.mozilla.org/mozilla-central/rev/36f95aeb4c77f7cf3b3366583008cd6e4b6b1dba/python/mozboot/mozboot/bootstrap.py#247 We should just remove the whole `install_rustup` function and let `ensure_rust_modern` do its thing.
The other issue here was that Honza had the `i686-pc-windows-msvc` Rust toolchain installed as the default, and all of our bootstrap machinery assumes the `x86_64-pc-windows-msvc` toolchain will be the default, so we don't handle that case very well. Specifically he was trying to do a 64-bit build, and bootstrap didn't make sure he had the `x86_64-pc-windows-msvc` *target* installed.
Honza fixed his toolchain problem by running `rustup default stable-x86_64-pc-windows-msvc`.
Resummarizing--we should do what I outlined in comment 5.
Summary: ./mach bootstrap: error: component 'rust-std' for target 'i686-pc-windows-msvc' is required for toolchain 'stable-i686-pc-windows-msvc' and cannot be re-added → Remove Mozillabuild bootstrap Rust installation code
Comment on attachment 8905706 [details] Bug 1385241 - Remove mozilla-build specific rust install. .mielczarek https://reviewboard.mozilla.org/r/177504/#review184512 Thanks for the patch!
Attachment #8905706 - Flags: review?(ted) → review+
We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again. hg error in cmd: hg rebase -s ead3aa456707 -d 39b0e0aead7b: rebasing 419820:ead3aa456707 "Bug 1385241 - Remove mozilla-build specific rust install. r=ted.mielczarek" (tip) merging python/mozboot/mozboot/mozillabuild.py warning: conflicts while merging python/mozboot/mozboot/mozillabuild.py! (edit, then use 'hg resolve --mark') unresolved conflicts (see hg resolve, then hg rebase --continue)
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/a54ba2e89fe0 Remove mozilla-build specific rust install. r=ted.mielczarek
You need to log in before you can comment on or make changes to this bug.