Closed Bug 1397279 Opened 7 years ago Closed 7 years ago

mach bootstrap is installing / overwriting with a super-old rustup

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox57 fixed)

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: mconley, Assigned: mconley)

References

Details

Attachments

(1 file)

STR:

1) On a recent checkout of mozilla-central on Windows, run ./mach bootstrap
2) Choose "2" to prepare to build Firefox for Desktop

ER:

A successful installation of all dependencies.

AR:

mconley@DESKTOP-IQHV2UM ~/mozilla/mozilla-central
$ rustup --version
rustup 1.6.0 (a11c01e8c 2017-08-30)

mconley@DESKTOP-IQHV2UM ~/mozilla/mozilla-central
$ ./mach bootstrap
mach bootstrap is not fully implemented in MozillaBuild

Note on Artifact Mode:

Firefox for Desktop and Android supports a fast build mode called
artifact mode. Artifact mode downloads pre-built C++ components rather
than building them locally, trading bandwidth for time.

Artifact builds will be useful to many developers who are not working
with compiled code. If you want to work on look-and-feel of Firefox,
you want "Firefox for Desktop Artifact Mode".

Similarly, if you want to work on the look-and-feel of Firefox for Android,
you want "Firefox for Android Artifact Mode".

To work on the Gecko technology platform, you would need to opt to full,
non-artifact mode. Gecko is Mozilla's web rendering engine, similar to Edge,
Blink, and WebKit. Gecko is implemented in C++ and JavaScript. If you
want to work on web rendering, you want "Firefox for Desktop", or
"Firefox for Android".

If you don't know what you want, start with just Artifact Mode of the desired
platform. Your builds will be much shorter than if you build Gecko as well.
But don't worry! You can always switch configurations later.

You can learn more about Artifact mode builds at
https://developer.mozilla.org/en-US/docs/Artifact_builds.

Please choose the version of Firefox you want to build:
1. Firefox for Desktop Artifact Mode
2. Firefox for Desktop
3. Firefox for Android Artifact Mode
4. Firefox for Android
Your choice: 2
info: updating existing rustup installation

error: missing key: 'url'
Error running mach:

    ['bootstrap']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

CalledProcessError: Command '[u'c:/Users/mconley\\.cargo\\bin\\rustup', 'target', 'add', 'i686-pc-windows-msvc']' returned non-zero exit status 1

  File "c:\Users\mconley\mozilla\mozilla-central\python/mozboot/mozboot/mach_commands.py", line 32, in bootstrap
    bootstrapper.bootstrap()
  File "c:\Users\mconley\mozilla\mozilla-central\python/mozboot\mozboot\bootstrap.py", line 292, in bootstrap
    self.instance.install_system_packages()
  File "c:\Users\mconley\mozilla\mozilla-central\python/mozboot\mozboot\mozillabuild.py", line 23, in install_system_packages
    self.install_rustup()
  File "c:\Users\mconley\mozilla\mozilla-central\python/mozboot\mozboot\mozillabuild.py", line 45, in install_rustup
    self.run([rustup, 'target', 'add', 'i686-pc-windows-msvc'])
  File "c:\Users\mconley\mozilla\mozilla-central\python/mozboot\mozboot\mozillabuild.py", line 84, in run
    subprocess.check_call(command, stdin=sys.stdin)
  File "c:\mozilla-build\python\lib\subprocess.py", line 186, in check_call
    raise CalledProcessError(retcode, cmd)

mconley@DESKTOP-IQHV2UM ~/mozilla/mozilla-central
$ rustup --version
rustup 0.2.0 (57f335a 2016-06-21)



Note how at the start of that sequence, I'm running rustup 1.6.0, and then at the end, I somehow have 0.2.0.

I think this is where the old rustup is being installed:

http://searchfox.org/mozilla-central/rev/4d8e389498a08668cce9ebf6232cc96be178c3e4/python/mozboot/mozboot/mozillabuild.py#29

I suspect this is breaking mach bootstrap for at least all Windows users, which is really bad for new contributors (like the ones I ran into this with. :( )
I generated the SHA256 hash via these commands:

mconley@DESKTOP-IQHV2UM ~/mozilla/mozilla-central
$ wget https://static.rust-lang.org/rustup/archive/1.6.0/i686-pc-windows-msvc/rustup-init.exe

$ certutil.exe -hashfile rustup-init.exe SHA256
SHA256 hash of file rustup-init.exe:
9855b9f0b19fd83c056185e083b6b345982becc2f8c608aac14998a73bcc2937
CertUtil: -hashfile command completed successfully.
Comment on attachment 8905048 [details]
Bug 1397279 - Have mach bootstrap install rustup 1.6.0.

https://reviewboard.mozilla.org/r/176858/#review181824

Newer rustup is better than older rustup.
Attachment #8905048 - Flags: review+
Attachment #8905048 - Flags: review?(gps)
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2248de5aed90
Have mach bootstrap install rustup 1.6.0. r=froydnj
See Also: → 1397299
This is a band-aid fix. We should probably find a mechanism of ensuring that bootstrap is always pulling down the right stuff.

At the very least, we shouldn't be overwriting a newer rustup with an older one. I filed bug 1397299 for that.

For the "right version" problem, maybe we can continue to download 1.6.0 (if rustup doesn't already exist), and then run rustup self update immediately after to ensure that it's the most up-to-date version.
https://hg.mozilla.org/mozilla-central/rev/2248de5aed90
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Ahh, this probably explains why I was having bootstrap problems with Rust 1.20 the other day. Thanks for fixing, mconley!
can this be uplifted to other branches so that mach bootstrap works there too?
Flags: needinfo?(mconley)
(In reply to Tooru Fujisawa [:arai] from comment #8)
> can this be uplifted to other branches so that mach bootstrap works there
> too?

I think that's a decision that folks who know more about Rust, rustup, and what Rust compilers we support in-tree should make. I'm afraid I'm not sure what uplifting would imply, build-wise.
Flags: needinfo?(mconley)
(In reply to Mike Conley (:mconley) (:⚙️) - Backlogged on reviews from comment #9)
> (In reply to Tooru Fujisawa [:arai] from comment #8)
> > can this be uplifted to other branches so that mach bootstrap works there
> > too?
> 
> I think that's a decision that folks who know more about Rust, rustup, and
> what Rust compilers we support in-tree should make. I'm afraid I'm not sure
> what uplifting would imply, build-wise.

I have no problem with uplifting this patch; it's not part of the build and should have relatively little impact.

That being said, I think our unofficial policy is that `mach bootstrap` is really only meant for people doing Nightly development.  If you *want* to run `mach bootstrap` out of a beta/release/esr tree, you can do that, but the result is not guaranteed to build.  (Beta might not build with stable Rust, for example.)
Product: Core → Firefox Build System
Assignee: nobody → mconley
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: