Closed Bug 1734760 Opened 3 years ago Closed 2 years ago

Bootstrap script should guide users towards `./mach bootstrap` if repo is already cloned

Categories

(Firefox Build System :: Bootstrap Configuration, enhancement, P2)

enhancement

Tracking

(firefox96 fixed)

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: nyanpasu64, Assigned: surajeet310)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:93.0) Gecko/20100101 Firefox/93.0

Steps to reproduce:

  • On Arch Linux, run curl https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py -O.
  • python3 bootstrap.py and proceed through the wizard.
  • When it asks Would you like to run a configuration wizard to ensure Mercurial is optimally configured? (Yn):, press Enter and proceed through the wizard.

Actual results:

When bootstrap tries to enable fsmonitor, I get a message: The "watchman" filesystem watching tool could not be found or isn't working.

If I install watchman and run python3 bootstrap.py again, it won't let me run the script again with the same path:

ERROR! Destination directory /home/nyanpasu64/code/mozilla-unified exists but is nonempty.

I had to workaround this by stubbing out validate_clone_dest() and editing hg_clone_firefox() to not call hg init.

Expected results:

The script gives the user a choice to either check again for watchman, or skip enabling watchman.

Alternatively the script could download watchman for you (as requested in Bug 1700204).

As an additional issue, I edited the script to skip the directory check and hg init. However, it failed to add evolve to the hg config because the clone already exists:

Would you like to enable the evolve extension? (Yn)  
destination '/home/nyanpasu64/.mozbuild/evolve' is not empty
Could not clone the evolve extension for installation.
You can install evolve yourself with

  $ pip install --user hg-evolve

and then enable the extension via

  $ hg config -e

I didn't want to install hg-evolve using pip, because there's already a perfectly good copy in ~/.mozbuild. And I didn't know what to add to hg config -e to enable either a pip-installed or bootstrap-installed hg-evolve.

I decided to rm -rf /home/nyanpasu64/.mozbuild/evolve and run bootstrap.py again (which clones it again even though it already exists), which more-or-less worked.

Afterwards I checked to see what line bootstrap.py added to hg config -e. Turns out it's evolve = /home/nyanpasu64/.mozbuild/evolve/hgext3rd/evolve... which I had no way of knowing ahead of time.

Heh, the standalone bootstrap script usage can be a little confusing.
The intended workflow here is to do the following:

  1. Download bootstrap.py
  2. Run bootstrap.py (repo is bootstrapped, tooling is bootstrapped automatically)
  3. (Now that you have a local clone) Delete bootstrap.py, do all work within the repo itself
  4. If you need to re-do the tooling bootstrapping, then run ./mach bootstrap.

The distinction between bootstrap.py and ./mach bootstrap can be vague to new builders, and we should improve it.
One simple solution here is to modify bootstrap.py to be more intelligent if the target repo already exists, and to provide more useful instructions in such a case.

Priority: -- → P2
Summary: If bootstrap disables fsmonitor because watchman missing, cannot install watchman then restart bootstrap → Bootstrap script should guide users towards `./mach bootstrap` if repo is already cloned
Assignee: nobody → surajeet310

The modified script :

  1. Guides the user after the first successful clone to opt for './mach bootstrap',if the user wants to re do the tooling bootstraping .
  2. Prompts the user an option to remove the standalone 'bootstrap.py' script as it isn't required anymore .
  3. Guides the user to run './mach bootstrap' instead of 'python3 bootstrap.py', provided the repository is already cloned .
Pushed by mhentges@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/905c8a32aa69
Modified 'bootstrap.py' script from python/mozboot/bin r=mhentges
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: