Closed Bug 1736762 Opened 4 years ago Closed 3 years ago

mach --no-interactive bootstrap is interactive when ~/.mozbuild doesn't exist

Categories

(Firefox Build System :: Bootstrap Configuration, defect, P3)

defect

Tracking

(firefox109 fixed)

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: glandium, Assigned: ahochheiden)

References

Details

Attachments

(1 file)

When ~/.mozbuild doesn't exist, running mach --no-interactive bootstrap prompts about the creation of ~/.mozbuild here: https://searchfox.org/mozilla-central/rev/8130ddcaa7e214d341371194bb1d2f97078cab00/build/mach_initialize.py#512-520

Priority: -- → P3

What's the use case for not creating the state directory?

From speaking with Mitch, it sounds like a developer will always need the state directory, and on CI, it is always created further down the line automatically (without a prompt) anyway. Is there a use case we missed, or can we remove the prompt and always just create the state directory here without any negative consequences?

Flags: needinfo?(mh+mozilla)

The reason why there's a prompt currently is to give people the opportunity to setup a different directory via the environment if they don't want to use ~/.mozbuild, and make them aware that such a directory is going to be created in the first place. I'm not sure whether we should keep doing this or not, but if people have opted (with --no-interactive) to not be prompted, we can start with not prompting in that case. I don't have a particularly strong opinion whether we should remove it entirely. It's not going to be a technical problem, only a social one.

Flags: needinfo?(mh+mozilla)
Assignee: nobody → ahochheiden
Status: NEW → ASSIGNED

Hmm, we're in a bit of a catch-22 here, especially once we manage the Mach virtualenv automatically: we need to have the state_dir defined and created before we can create the Mach virtualenv, but we need the Mach virtualenv before we parse CLI arguments and do other Mach initialization.

So, we have three short/medium-term options:

  1. Move Mach to the objdir. This is beneficial for other reasons (it shouldn't be shared between checkouts anyways), but might cause issues with ./mach clobber, especially on Windows
  2. Just create the state_dir by default and without warning. As glandium mentioned, this may surprise some developers
  3. We're already pre-parsing args in the ./mach shell script for --profile-command, so tweak the logic to also check if --no-interactive is set.

I think that option 1 is the best long-term solution, but option 3 should resolve the situation in the short-term.

See Also: → 1739067

I'm not sure whether we should keep doing this or not, but if people have opted (with --no-interactive) to not be prompted, we can start with not prompting in that case. I don't have a particularly strong opinion whether we should remove it entirely. It's not going to be a technical problem, only a social one.

As discussed in yesterday's Build Peers meeting: rather than solving this technically, let's remove the "create state dir?" prompt. Considering that other developer tools already create directories in $HOME without prompting (Rust, NodeJS, Maven, Gradle), this is an acceptable compromise.

The code changes needed are:

  • Don't prompt when creating the state_dir
  • When creating the state_dir, dump a similar text block to what already exists, except without the "prompt-y" part. I think that the "CTRL-C" piece is unnecessary as well, considering that those who want to configure their state_dir location are likely to be sufficiently proficient to know how to SIGTERM.
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/9fcd6df9d432 Stop waiting for user input before the creation of ~/.mozbuild . r=firefox-build-system-reviewers,ahochheiden
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: