We can't share code with `bin\bootstrap.py`, so there's a minor amount of
duplication, but it's better to notify the user before they clone than
during the first `./mach configure` run.
Differential Revision: https://phabricator.services.mozilla.com/D289380
The resulting clone will be a cinnabar clone with the same SHA1s as the
new github repository, before the official migration.
At the same time, we set up remote refs in a way that makes the remote
have the same refs, more or less, than the github repo.
People bootstrapping with --vcs=git after this change and before the cut
date won't have much to do to their local clone.
Differential Revision: https://phabricator.services.mozilla.com/D246015
If for some reason the branch doesn't exist, git will complain about a
file with that name not being found. (see e.g. bug 1880502 for an
example of how that may happen)
Differential Revision: https://phabricator.services.mozilla.com/D202762
The bootstrap script sets it after the clone, but not having it set
during the clone makes git-cinnabar show a message about setting it,
which is kind of useless since we're doing it for the user already.
Differential Revision: https://phabricator.services.mozilla.com/D202761
In the optics of running an end-to-end bootstrap on automation, it can
be useful to allow the standalone bootstrap to start from a repository
that is not mozilla-unified, so that, e.g. changes can be tested on try.
Differential Revision: https://phabricator.services.mozilla.com/D162695
At the time the message is printed, installing git-cinnabar hasn't even
been tried (it happens in the in-tree bootstrap, not the sandalone
bootstrap, which this is) ; we have installed a temporary copy of
git-cinnabar, which may fail, but if it does, we'd throw an exception
before reaching this message anyways.
Differential Revision: https://phabricator.services.mozilla.com/D162611
That's what we were doing before bug 1796956. Not preferring .exes
makes us choose hg over hg.exe, and CreateProcess doesn't know how
to execute the former.
Differential Revision: https://phabricator.services.mozilla.com/D162064
The download.py script can now run without a clone, which solves e.g.
problems stemming from the temporary git repository on windows.
It also now pulls from github by default, which doesn't suffer from
certificate validation issues like the taskcluster artifacts urls do.
Also, the self-update git-cinnabar subcommand handles upddates itself,
which leaves python out of the loop.
Differential Revision: https://phabricator.services.mozilla.com/D160997
The version of git-cinnabar that the bootstrap script pulls now doesn't
require Mercurial. Even older versions have been working fine without
Mercurial for a while.
Differential Revision: https://phabricator.services.mozilla.com/D160601
Since PowerShell is also available on Linux, checking for that is not
sufficient. We must first check if we're on Windows, and if we're not,
return early.
Differential Revision: https://phabricator.services.mozilla.com/D156602
The upstream git-cinnabar repo no longer has the `git-cinnabar` scripts which
breaks the logic in mozboot. We no longer need to worry about making those files
executable and can simply use the download.py script to do the work. For the
current versions of download.py to work correctly, we need the git metadata to
exist, so use a --depth=1 clone instead.
Differential Revision: https://phabricator.services.mozilla.com/D155502
I also added `%USERPROFILE%/.mozbuild` to the exclusion list and updated the windows_build docs to reflect the changes made.
Differential Revision: https://phabricator.services.mozilla.com/D149199
Future releases of git cinnabar may not have a "git cinnabar" command
running out of the box, and the future-proof way to download the
cinnabar helper is to use download.py.
Differential Revision: https://phabricator.services.mozilla.com/D146526
When calling Mach, it was prefixed with the `srcdir`, even though the
`srcdir` was also the working directory of the invocation. This caused
the invocation to fail.
Differential Revision: https://phabricator.services.mozilla.com/D140400
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 bootstrapping.
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.
Differential Revision: https://phabricator.services.mozilla.com/D130246
Updates `./mach bootstrap` to use `--no-interactive` from global args.
Ensures all bootstrap prompts have a default option.
Differential Revision: https://phabricator.services.mozilla.com/D106814
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Note that when I refer to "standalone `bootstrap.py`" here, I'm referring to the file `python/mozboot/bin/bootstrap.py` and no other similarly-named file in-tree.
The current design, where standalone `bootstrap.py` downloads a small portion of the `mozilla-central` repo and then works through all the `bootstrap` logic, performing a clone in the middle of the `bootstrap` process, has some deficiencies, namely:
1. Refactoring code that is shared between the `bootstrap` logic and the mainline `mach` logic is, if not impossible, more difficult than it needs to be, since standalone `bootstrap.py` needs to download a set of files that bootstraps a build environment perfectly with no other dependencies in `mozilla-central`. As a result we have some [duplicated or redundant code](https://searchfox.org/mozilla-central/rev/c6676771df58c6e0098574bc6b11517acbf264cf/python/mozboot/mozboot/base.py#349) and some stuff that has been [refactored into the `mozboot` directory](https://searchfox.org/mozilla-central/source/python/mozboot/mozboot/util.py) irrespective of whether it actually makes sense to go there (see bug 1649850).
2. Since `mach bootstrap` has access to the entire `mozilla-central` environment, but the (much less frequently exercised) standalone `bootstrap.py` script does *not*, this can lead people to write patches that work fine in `mach bootstrap` but which regress standalone `bootstrap.py`. Furthermore, testing `bootstrap` patches with standalone `bootstrap.py` is difficult. So this is a not infrequent source of regressions; bugs 1652736 and 1643158 are recent examples. Furthermore, typically these regressions are "fixed" by adding more code duplication or by replacing battle-tested frequently-used libraries (either `m-c`-internal or third-party) with less robust bespoke code.
3. Issue (2) is avoidable if people are sufficiently critical during code review, but at *best*, this is a weird extra level of mental overhead that we need to keep in mind only for `bootstrap` patches.
This patch preserves back-compatibility and the validity of existing documentation by factoring out all the logic to clone `mozilla-central` into standalone `bootstrap.py` directly, and cloning *before* calling into `mach bootstrap` directly. This gives us only one official entry point into the bootstrapper, namely, `mach bootstrap`.
There are a couple concrete implications of this change:
1. Now, the clone happens before any other interesting work happens, so people may have to wait ~an hour before actually beginning to engage with the `bootstrap` wizard. While it's arguably slightly less convenient, I'm not sure it matters enough that we should block this patch or a similar one on it.
2. The `hg`/`git` configuration step now happens *after* the clone rather than before it. Looking at what the `hg` and `git` configuration wizards actually do today, I don't think this matters either (all of the configurations can easily happen after cloning the repo).
Another note: `bootstrap` installs `git-cinnabar` to the `.mozbuild` state directory. We could have duplicated all of that logic over to standalone `bootstrap.py`, but it's non-trivial and I didn't think that made any sense, so instead we have standalone `bootstrap.py` download a temporary version and use it for the initial clone if necessary.
Differential Revision: https://phabricator.services.mozilla.com/D85058
Previously, python import syntax was used to refer users to the definition of the --application-choice arguments.
However, it isn't straightforward to the uninitiated, especially since it doesn't work in searchfox.
Instead, by providing a file reference, it should be more accessible.
Differential Revision: https://phabricator.services.mozilla.com/D79003
This patch works around the removal of the platform.linux_distribution() function in Python 3.8 and later. It uses the in-tree third party distro package to provide linux distribution information to build system bootstrap.
Differential Revision: https://phabricator.services.mozilla.com/D60359
Make the choice of VCS work via an interactive prompt rather than by
command line argument, just like we do for all other choices.
Differential Revision: https://phabricator.services.mozilla.com/D58614