Commit Graph
69 Commits
Author SHA1 Message Date
Norisz Fay 83b61eed51 Bug 1882186 - Fix black lint failure in bootstrap.py r=fix CLOSED TREE 2024-02-27 05:05:40 +02:00
Mike Hommey f13445a5a0 Bug 1882186 - Disambiguate that we are checking out a branch, not a file. r=firefox-build-system-reviewers,ahochheiden
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
2024-02-27 02:38:48 +00:00
Mike Hommey e3364b3106 Bug 1882186 - Set fetch.prune=true during git clone. r=firefox-build-system-reviewers,ahochheiden
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
2024-02-27 02:38:47 +00:00
ahochheiden a7840606de Bug 1843209 - Bump Mach's minimum Python version to 3.8 r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D183449
2023-12-12 03:52:00 +00:00
Cosmin Sabou 4d28b93ff6 Backed out 2 changesets (bug 1843209) for python3 related browser accessible failures. CLOSED TREE
Backed out changeset 052214d67a99 (bug 1843209)
Backed out changeset 36c5e6c2819f (bug 1843209)
2023-11-23 02:41:22 +02:00
ahochheiden 90004e9277 Bug 1843209 - Bump Mach's minimum Python version to 3.8 r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D183449
2023-11-22 20:07:41 +00:00
ahochheiden 3acb3f29e0 Bug 1838948 - Update reference to Python 3.6 as the minimum Python version that Mach supports to Python 3.7 r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D181305
2023-06-22 02:15:57 +00:00
Cosmin Sabou 24f487f82f Backed out 2 changesets (bug 1838952, bug 1838948) for causing bootstrap failures. CLOSED TREE
Backed out changeset 7bdf45ed2f6b (bug 1838952)
Backed out changeset 3690d22636d7 (bug 1838948)
2023-06-21 05:56:46 +03:00
ahochheiden a8cfdca0b0 Bug 1838948 - Update reference to Python 3.6 as the minimum Python version that Mach supports to Python 3.7 r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D181305
2023-06-21 02:01:58 +00:00
Mike Hommey 349aa2cb1c Bug 1802271 - Remove python 2 compatibility from bootstrap code. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D162959
2022-11-25 02:18:50 +00:00
Mike Hommey bdc8611a02 Bug 1801801 - Allow to bootstrap from another repository than mozilla-unified. r=firefox-build-system-reviewers,nalexander
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
2022-11-22 22:24:48 +00:00
Mike Hommey 3c81e8adb2 Bug 1801728 - Remove bootstrap message about git-cinnabar failure to install. r=firefox-build-system-reviewers,nalexander
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
2022-11-22 01:32:17 +00:00
Mike Hommey c9e3aa62a0 Bug 1800572 - Prefer .exes when they exist in bootstrap.py. r=firefox-build-system-reviewers,nalexander
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
2022-11-15 05:04:55 +00:00
Mike Hommey 19823d5896 Bug 1787993 - Update how we install git-cinnabar. r=firefox-build-system-reviewers,andi
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
2022-11-02 22:32:34 +00:00
Mike Hommey 6f7f9e788a Bug 1798603 - Fix bootstrap.py shebang. r=firefox-build-system-reviewers,andi
While here, also adjust its python version check, since it uses
f-strings, which aren't available before 3.6.

Differential Revision: https://phabricator.services.mozilla.com/D160994
2022-11-02 22:32:22 +00:00
ahochheiden 02f3532107 Bug 1796956 - Check for both variants of an executable ('no suffix' and ".exe") on Windows regardless of the executable r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D160570
2022-11-02 01:41:05 +00:00
Mike Hommey 7d9b39c2f7 Bug 1797904 - Don't require mercurial when bootstrapping with git. r=firefox-build-system-reviewers,nalexander
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
2022-10-31 22:35:02 +00:00
ahochheiden b42a0ba294 Bug 1789311 - Only attempt to add Microsoft Defender Antivirus Exclusion on Windows r=firefox-build-system-reviewers,nalexander
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
2022-09-06 22:15:14 +00:00
Ted Campbell 5a4ca70313 Bug 1786142 - Use actual git clone when bootstrapping git-cinnabar in mozboot r=firefox-build-system-reviewers,andi
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
2022-08-24 19:33:53 +00:00
ahochheiden e58f9f3f59 Bug 1276019 - Add Microsoft Defender Antivirus exclusions automatically during source bootstrap r=glob
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
2022-06-15 01:37:11 +00:00
Mike Hommey d5fe0a241c Bug 1769680 - Use download.py instead of git cinnabar download. r=firefox-build-system-reviewers,andi
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
2022-05-17 08:40:56 +00:00
Mitchell Hentges 252ac30604 Bug 1758189: Don't double-srcdir for mach during stdalone bootstrap r=ahal
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
2022-03-09 21:51:13 +00:00
ahochheiden ca24ace620 Bug 1744884 - Update string paths to Pathlib objects in Mozboot module r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D133164
2022-01-21 19:35:48 +00:00
surajeet310 7e8e7228e4 Bug 1734760 - Modified 'bootstrap.py' script from python/mozboot/bin r=mhentges
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
2021-11-24 21:03:20 +00:00
Glowreeyah bca4de22a2 Bug 1738301 - Update the link to mercurial bundle documentation. r=mhentges
Differential Revision: https://phabricator.services.mozilla.com/D130169
2021-11-02 14:49:46 +00:00
Mitchell Hentges 48a2490eae Bug 1695272: Move --no-interactive to global mach args r=firefox-build-system-reviewers,glandium
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
2021-03-12 16:07:11 +00:00
Ricky Stewart 31b8ca9716 Bug 1654103: Standardize on Black for Python code in mozilla-central.
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
2020-10-26 18:34:53 +00:00
Bogdan Tara 612312a64c Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart 065d2eb893 Bug 1654103: Standardize on Black for Python code in mozilla-central. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
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
2020-10-23 20:40:42 +00:00
Dorel Luca 95b44c982f Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 43baed3c18 Bug 1654103: Standardize on Black for Python code in mozilla-central. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
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
2020-10-21 21:27:27 +00:00
Ricky Stewart 0dda7a496e Bug 1664581 - Explicitly recommend putting hg in your PATH if bootstrap can't find it r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D90171
2020-09-14 21:18:27 +00:00
Ricky Stewart 0efc313d16 Bug 1647792 - Standalone bootstrap.py script clones before running mach bootstrap r=mhentges,froydnj,mhoye
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
2020-09-01 18:42:36 +00:00
Karl Dubost 69209d9224 Bug 1482675 - Adds no-system-changes option to bootstrap. r=rstewart
Differential Revision: https://phabricator.services.mozilla.com/D78855
2020-07-01 00:11:55 +00:00
Mitchell Hentges c1ed68c66a Bug 1643317: |mach bootstrap --help| uses file ref to explain --app-choice r=rstewart
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
2020-06-10 16:27:24 +00:00
Sylvestre Ledru caa7c8e178 Bug 1622405 - Remove MSYS2 r=dmajor
Differential Revision: https://phabricator.services.mozilla.com/D66829
2020-03-13 21:14:34 +00:00
Jan Sonntag d43651c9ed Bug 1601684 - use distro package to provide platform information r=firefox-build-system-reviewers,mshal
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
2020-02-05 11:56:28 +00:00
James Graham 313df80bf3 Bug 1606825 - Prompt which VCS to use for gecko clone, r=firefox-build-system-reviewers,rstewart
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
2020-01-03 17:37:03 +00:00
Māris Fogels 28df0c31ea Bug 1210157 - Make bootstrap.py work with Python 3.5+ and Python 2.7 r=firefox-build-system-reviewers,mshal
Make bootstrap.py compatible with both Python 3.5+ and Python 2.7. Remove
Python 2.6 support as Python 2.6 is no longer supported in the Firefox source
tree.

Differential Revision: https://phabricator.services.mozilla.com/D39364
2019-08-20 21:19:18 +00:00
Māris Fogels 50b51bee5f Bug 1210157 - Add a --debug option to bootstrap.py r=nalexander
Add an option to run bootstrap.py with '--debug'. This will print full
tracebacks if the bootstrap process encounters an uncaught exception. It should
be useful for developers who are working on the bootstrap code as well as users
when writing bug reports.

Depends on D39362

Differential Revision: https://phabricator.services.mozilla.com/D39363
2019-08-20 21:19:17 +00:00
Bogdan Tara 4f137970b4 Backed out 8 changesets (bug 1569046, bug 1210157) for flake8 failure on base.py CLOSED TREE
Backed out changeset eec9458e553d (bug 1210157)
Backed out changeset 06d452ac1d16 (bug 1210157)
Backed out changeset 0f5311bbd75b (bug 1210157)
Backed out changeset 975727f55b82 (bug 1569046)
Backed out changeset a65032b442bc (bug 1210157)
Backed out changeset 25aef37f3556 (bug 1210157)
Backed out changeset 5d26b3d7d4a0 (bug 1210157)
Backed out changeset f044d6116869 (bug 1210157)
2019-08-21 00:14:49 +03:00
Māris Fogels 8628e58b36 Bug 1210157 - Make bootstrap.py work with Python 3.5+ and Python 2.7 r=firefox-build-system-reviewers,mshal
Make bootstrap.py compatible with both Python 3.5+ and Python 2.7. Remove
Python 2.6 support as Python 2.6 is no longer supported in the Firefox source
tree.

Differential Revision: https://phabricator.services.mozilla.com/D39364
2019-08-12 17:08:14 +00:00
Māris Fogels 8bd372ffae Bug 1210157 - Add a --debug option to bootstrap.py r=nalexander
Add an option to run bootstrap.py with '--debug'. This will print full
tracebacks if the bootstrap process encounters an uncaught exception. It should
be useful for developers who are working on the bootstrap code as well as users
when writing bug reports.

Depends on D39362

Differential Revision: https://phabricator.services.mozilla.com/D39363
2019-08-13 20:41:30 +00:00
Panos Astithas 840967fb4f Bug 1485117 - Make standalone bootstrap work without a git checkout. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D20426
2019-02-26 06:39:55 +00:00
Rok Garbas 3caac7c92c Bug 1471541 - switch to new tooltool url, r=jlund 2018-07-03 15:35:58 -07:00
Gregory Szorc f84086a760 Bug 1469441 - Support fetching bootstrap files from an arbitrary revision; r=glandium
By making the archive URL dynamic, we can fetch an old version of the
bootstrap files. This will make it easier to test the bootstrapper in
CI.

Differential Revision: https://phabricator.services.mozilla.com/D1698
2018-06-27 12:15:44 -07:00
Steve Armand bc0b25b8f4 Bug 1408365 - Enable flake8/py2/py3 linters on python/mozboot. r=ahal
MozReview-Commit-ID: 3koZq509bjP
2017-10-13 23:33:00 -04:00
Rok Garbas 9d7ac6a8ed Bug 1284475 - migrate ToolTool blueprint to new codebase of relengapi r=KWierso
UPGRADE_NSS_RELEASE a=kaie
MozReview-Commit-ID: 7CB1VYb8OJP
2017-08-08 10:55:52 +02:00
Nick Alexander b903484d51 Bug 1344244 - Post: Allow --application-choice to |mach bootstrap|. r=glandium
MozReview-Commit-ID: 496iK5iTEPX
2017-07-05 13:25:04 -07:00
Nathan Hakkakzadeh bf30813142 Bug 1292715 - Added installer source code for MSYS2 and ConEmu. r=gps
Also, is a ConEmu preferences file which automatically points a newly installed ConEmu to the newly installed MSYS2.

MozReview-Commit-ID: FBeMat4SYjK
2016-08-10 15:30:07 -07:00