Closed Bug 1465565 Opened 7 years ago Closed 5 years ago

./mach bootstrap installs clang and node while ./mach bootstrap --no-interactive does not

Categories

(Firefox Build System :: Bootstrap Configuration, defect)

3 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1484485

People

(Reporter: mjf, Unassigned)

References

Details

Attachments

(1 file)

On at least Ubuntu 18.04, using the --no-interactive flag on ./mach bootstrap does install clang. Running without the flag does install clang. I'll try to get a test on 16.04 as well.
(In reply to Michael Froman [:mjf] from comment #0) > On at least Ubuntu 18.04, using the --no-interactive flag on ./mach > bootstrap does install clang. Running without the flag does install clang. > > I'll try to get a test on 16.04 as well. using the --no-interactive flag does *not* install clang. Sorry for the confusion.
Confirmed the same behavior in 16.04.
I think the rationale behind doing things this way was that installing clang would silently install packages under ~/.mozbuild, and we wanted to ensure the user could avoid that if they wanted to. However, we now require clang, and we even can silently install packages to the user's home directory (e.g. downloading rustup &co.), so perhaps this code is less useful than it once was? Do we have a formal policy?
Flags: needinfo?(gps)
One bit of clarification: if the ~/.mozbuild exists (say, from previously running './mach mercurial-setup --update'), --no-interactive still does not install clang. I guess in the normal flow of ./mach bootstrap, the second question I am asked is whether I'd like to create ~/.mozbuild. If I answer no, then I'm probably indicating I also don't want clang installed in ~/.mozbuild. If I answer yes, then clang is downloaded. If ~/.mozbuild already exists (for whatever reason), what is the right conclusion to draw regarding clang in --no-interactive mode? I would lean toward the existence of ~/.mozbuild implying clang download.
Good questions. My recollection is that --no-interactive would prevent the bootstrapper from doing anything "controversial" or overly opinionated. We want to respect a user's control over their system. FWIW https://hg.mozilla.org/mozilla-central/rev/b4929a47dbe3 introduced the state directory creation code. And I suspect Clang cargo culted the same logic since it was tied to the existence of the state directory. I believe that when I authored b4929a47dbe3 we were going through a bit of a controversial period where `mach` was being more forceful about insisting the state directory exist and that `mach mercurial-setup` be run periodically. A lot of people were upset by the opinionated UX and we ripped it out. As a result, I was being a lot more conservative in the UX of bootstrap so not to poke the figurative hornets nest. (I had people saying they wouldn't use bootstrap if it were opinionated and I thought it would be better to make bootstrap work for everyone.) Fast forward two years. I think the existing bootstrap code in non-interactive mode is too conservative. If you run bootstrap in non-interactive mode, I think it is reasonable for bootstrap to make a set of default choices. That means creating the state directory and installing clang. So let's change bootstrap so it works fully in non-interactive mode. Also, we should add the ability to influence behavior via command arguments, environment variables, etc so people can automate bootstrap while still respecting user choice. But this flexibility can be added as follow-up features: let's focus on fixing non-interactive mode first.
Flags: needinfo?(gps)
Summary: ./mach bootstrap installs clang while ./mach bootstrap --no-interactive does not → ./mach bootstrap installs clang and node while ./mach bootstrap --no-interactive does not
Version: Version 3 → 3 Branch

Running ./mach bootstrap --no-interactive --application-choice=browser for me now installs clang and node in ~/.mozbuild as well (tested on Ubuntu 18.04). Can anyone still reproduce this?

Try removing ~/.mozbuild before trying. I suspect it happens when the interactive version would ask if you want to create it (and the non-interactive one answers no there, and thus doesn't proceed with what needs the directory to exist)

Attached file log (deleted) —

$ hg -R ~/trees/mozilla-central/ log -r .
changeset: 482242:e704e3565db9
tag: tip
parent: 482135:c4b20b18bf97
parent: 482241:4295df39798a
user: arthur.iakab <aiakab@mozilla.com>
date: Thu Jul 11 00:49:58 2019 +0300
summary: Merge autoland to mozilla-central. a=merge

Nope, still seems to install even after removing ~/.mozbuild first.

Flags: needinfo?(mh+mozilla)

This was fixed in bug 1484485.

Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(mh+mozilla)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: