Closed Bug 1465565 Opened 3 years ago Closed 2 years ago
./mach bootstrap installs clang and node while ./mach bootstrap --no-interactive does not
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?
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.
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
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1484485
You need to log in before you can comment on or make changes to this bug.