Commit graph

93 commits

Author SHA1 Message Date
ahochheiden
dd1abfa37f Bug 1894157 - Remove Python2 compatibility code in Mach r=firefox-build-system-reviewers,glandium
Mach can currently only run on Python version 3.8 or higher, so it
doesn't make sense to continue having dead code that provides support
for Python2.

Differential Revision: https://phabricator.services.mozilla.com/D209030
2024-05-01 02:32:23 +00:00
ahochheiden
877bb5b271 Bug 1884346 - Correctly display a human readable error message for a completely 'unknown' command r=firefox-build-system-reviewers,nalexander
This issue was introduced when D194599 moved the 'suggest' command logic
earlier in the mach initialization, so there was not a try/catch wrapper
to handle the error nicely.

Differential Revision: https://phabricator.services.mozilla.com/D204100
2024-03-11 19:15:21 +00:00
ahochheiden
272742b40d Bug 1857279 - Load @SettingsProvider settings early so that we can parse set aliases and load the correct virtualenv r=ahal
Aliased commands have not loaded the virtualenv associated with a
command/subcommand since bug 1695312. It has been defaulting to the
`common` virtualenv, which worked most of the time since most commands
use `common` and it also contains a large share of our dependencies.

Differential Revision: https://phabricator.services.mozilla.com/D192376
2023-11-20 18:05:57 +00:00
ahochheiden
f605774f28 Bug 1857279 - Consolidate all mach @SettingsProvider hooks in one file and class and have them execute very early during mach_initialize() r=ahal
The only remaining @SettingsProvider hooks should be in test files.

Differential Revision: https://phabricator.services.mozilla.com/D192375
2023-11-20 18:05:57 +00:00
Cristian Tuns
cfd3ae2be5 Backed out 3 changesets (bug 1857279) for causing try failures with exit status 1 CLOSED TREE
Backed out changeset 4c1965a65011 (bug 1857279)
Backed out changeset b9885d1b6980 (bug 1857279)
Backed out changeset 76706ea52991 (bug 1857279)
2023-11-06 13:12:25 -05:00
ahochheiden
5cfd70f690 Bug 1857279 - Load @SettingsProvider settings early so that we can parse set aliases and load the correct virtualenv r=ahal
Aliased commands have not loaded the virtualenv associated with a
command/subcommand since bug 1695312. It has been defaulting to the
`common` virtualenv, which worked most of the time since most commands
use `common` and it also contains a large share of our dependencies.

Differential Revision: https://phabricator.services.mozilla.com/D192376
2023-11-06 17:08:32 +00:00
ahochheiden
4f09acb466 Bug 1857279 - Consolidate all mach @SettingsProvider hooks in one file and class and have them execute very early during mach_initialize() r=ahal
The only remaining @SettingsProvider hooks should be in test files.

Differential Revision: https://phabricator.services.mozilla.com/D192375
2023-11-06 17:08:31 +00:00
Logan Rosen
f024d94b2b Bug 1786490 - reformat the tree using black 23.3.0 r=sylvestre,webdriver-reviewers,taskgraph-reviewers,whimboo,jmaher,ahal,perftest-reviewers,geckoview-reviewers,afinder,m_kato
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D186092
2023-09-06 16:14:30 +00:00
Logan Rosen
51f5fcdd75 Bug 1786490 - remove references to vendored pyparsing r=sylvestre,mach-reviewers,ahal,ahochheiden
Not necessary because pyparsing is no longer a dependency of packaging, so it is no longer vendored.

Differential Revision: https://phabricator.services.mozilla.com/D186411
2023-09-06 16:14:30 +00:00
ahochheiden
05f6219e68 Bug 1846068 - Load all command modules for ./mach busted r=firefox-build-system-reviewers,glandium
Since it depends on the `command_handlers` from `Registrar` for the
`file` `sub_command` to determine the appropriate component, we need to
load all command modules so that we can file against any of them.

Differential Revision: https://phabricator.services.mozilla.com/D184853
2023-08-01 19:59:26 +00:00
ahochheiden
f71b25f3ce Bug 1845833 - Add the ability to specify command dependencies for commands r=firefox-build-system-reviewers,glandium
This just forces other command modules to be loaded in addition to the
'base' command. We need this so that decorators needed by the 'base'
command that are in another command module are ran during initialization
(eg: `@SettingsProvider`).

I thought about centralizing the `@SettingsProvider` decorators into one
module and always loading it, but they can depend on the
'command_handlers' in `Registrar`, so the modules they're currently in
have to be loaded for them to execute, so there wasn't a way around
this.

Differential Revision: https://phabricator.services.mozilla.com/D184852
2023-08-01 19:59:25 +00:00
ahochheiden
739e9af89c Bug 1845306 - Make some additional commands load all modules so that @SettingsProvider is ran when needed r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D184505
2023-07-25 19:51:32 +00:00
ahochheiden
8e819ce0b9 Bug 1695312 - Add the ability for dispatch to ad-hoc load command modules that aren't already loaded r=firefox-build-system-reviewers,glandium
This is really just shuffling a bunch of things around. None of the
'load_*' member functions of the `Mach` class actually needed to be
member functions. They can all be static so that they can be used
anywhere. That combined with moving all the other 'mach_command' logic
to a different file, allows us to load the module for any command so
that we can successfully dispatch it.

Differential Revision: https://phabricator.services.mozilla.com/D184060
2023-07-25 00:24:53 +00:00
ahochheiden
918f331078 Bug 1695312 - Selectively load only the mach command modules needed for the command about to be run r=firefox-build-system-reviewers,glandium
This makes loading almost all commands faster, since only one module
file is loaded rather than all of them. There is one main exception,
dealing with 'help'. Running `./mach help` (or -h or --help) requires
the description text for every command, so every module file is still
loaded.

We could expand this improvement here to consolidate all commands and
their parameters in this `MACH_COMMANDS` dict, but the only two benefits
are improving help, and not having two places where the commands are
specified (their file, and this dict).

There's a lot of extra work needed to do that, especially for handling
sub commands, and it did not seem worth the cost for the benefit at this
time.

Depends on D180499

Differential Revision: https://phabricator.services.mozilla.com/D180500
2023-07-25 00:24:53 +00:00
ahochheiden
85bd65e288 Bug 1695312 - Activate the virtualenv associated with a mach command much earlier r=firefox-build-system-reviewers,glandium
This activated virtualenv for a command is managed
`CommandSiteManager` and it is passed down to where it was activated
before to prevent a second, redundant, activation.

Differential Revision: https://phabricator.services.mozilla.com/D180499
2023-07-25 00:24:53 +00:00
ahochheiden
cff561db42 Bug 1695312 - Add missing commands to the MACH_COMMANDS dict r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D181032
2023-07-25 00:24:52 +00:00
ahochheiden
9359c26d78 Bug 1695312 - Sort the MACH_COMMANDS dict alphabetically r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D181031
2023-07-25 00:24:52 +00:00
ahochheiden
5d7f61d985 Bug 1842700 - Fix l10n-cross-channel MachCommandReference module path r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D183217
2023-07-25 00:24:52 +00:00
Natalia Csoregi
0504f56a51 Backed out changeset 38a3792830be (bug 1842700) for causing mach lint issues. a=backout 2023-07-19 17:58:02 +03:00
Natalia Csoregi
f757923c9f Backed out 4 changesets (bug 1695312) as per request. a=backout
Backed out changeset e5687aa10124 (bug 1695312)
Backed out changeset 6123c201f979 (bug 1695312)
Backed out changeset 06aefe3418e1 (bug 1695312)
Backed out changeset 56f3d3fc806f (bug 1695312)
2023-07-19 17:31:51 +03:00
ahochheiden
b306ed3e91 Bug 1695312 - Selectively load only the mach command modules needed for the command about to be run r=firefox-build-system-reviewers,glandium
This makes loading almost all commands faster, since only one module
file is loaded rather than all of them. There is one main exception,
dealing with 'help'. Running `./mach help` (or -h or --help) requires
the description text for every command, so every module file is still
loaded.

We could expand this improvement here to consolidate all commands and
their parameters in this `MACH_COMMANDS` dict, but the only two benefits
are improving help, and not having two places where the commands are
specified (their file, and this dict).

There's a lot of extra work needed to do that, especially for handling
sub commands, and it did not seem worth the cost for the benefit at this
time.

Depends on D180499

Differential Revision: https://phabricator.services.mozilla.com/D180500
2023-07-19 05:09:01 +00:00
ahochheiden
5fb9481dc3 Bug 1695312 - Activate the virtualenv associated with a mach command much earlier r=firefox-build-system-reviewers,glandium
This activated virtualenv for a command is managed
`CommandSiteManager` and it is passed down to where it was activated
before to prevent a second, redundant, activation.

Differential Revision: https://phabricator.services.mozilla.com/D180499
2023-07-19 05:09:01 +00:00
ahochheiden
151ba3d4e7 Bug 1695312 - Add missing commands to the MACH_COMMANDS dict r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D181032
2023-07-19 05:09:01 +00:00
ahochheiden
abc9a69bfd Bug 1695312 - Sort the MACH_COMMANDS dict alphabetically r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D181031
2023-07-19 05:09:00 +00:00
ahochheiden
f7e850c46c Bug 1842700 - Fix l10n-cross-channel MachCommandReference module path r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D183217
2023-07-19 05:09:00 +00:00
ahochheiden
d33bf29823 Bug 1842691 - Check for spaces in topsrcdir and MOZILLABUILD (on Windows) on Mach startup r=firefox-build-system-reviewers,glandium
We've had this restriction for a while (with a note of it in the docs,
but the note in the docs can easily be overlooked, leading to confusing
errors). Erroring out right on Mach startup and providing instructions
for the workaround immediately should help users get around this issue
faster.

Differential Revision: https://phabricator.services.mozilla.com/D183209
2023-07-14 21:27:58 +00:00
Sandor Molnar
4a27268732 Backed out 6 changesets (bug 1842700, bug 1695312, bug 1808732) for causing lint failures. CLOSED TREE
Backed out changeset 0413a48d4f03 (bug 1808732)
Backed out changeset 2839c2d35459 (bug 1695312)
Backed out changeset eab5cdaf4bc9 (bug 1695312)
Backed out changeset a35da3fce458 (bug 1695312)
Backed out changeset 6d2a2dd4790b (bug 1695312)
Backed out changeset b8cf086066cf (bug 1842700)
2023-07-13 15:01:55 +03:00
ahochheiden
6704bd1cda Bug 1695312 - Selectively load only the mach command modules needed for the command about to be run r=firefox-build-system-reviewers,glandium
This makes loading almost all commands faster, since only one module
file is loaded rather than all of them. There is one main exception,
dealing with 'help'. Running `./mach help` (or -h or --help) requires
the description text for every command, so every module file is still
loaded.

We could expand this improvement here to consolidate all commands and
their parameters in this `MACH_COMMANDS` dict, but the only two benefits
are improving help, and not having two places where the commands are
specified (their file, and this dict).

There's a lot of extra work needed to do that, especially for handling
sub commands, and it did not seem worth the cost for the benefit at this
time.

Depends on D180499

Differential Revision: https://phabricator.services.mozilla.com/D180500
2023-07-13 05:41:21 +00:00
ahochheiden
d492f7b9f8 Bug 1695312 - Activate the virtualenv associated with a mach command much earlier r=firefox-build-system-reviewers,glandium
This activated virtualenv for a command is managed
`CommandSiteManager` and it is passed down to where it was activated
before to prevent a second, redundant, activation.

Differential Revision: https://phabricator.services.mozilla.com/D180499
2023-07-13 05:41:21 +00:00
ahochheiden
ced7f9b3c5 Bug 1695312 - Add missing commands to the MACH_COMMANDS dict r=firefox-build-system-reviewers,glandium
Also add the associated virtualenv names to each command that has one in
preparation for loading the virtualenvs earlier (next patch).

Differential Revision: https://phabricator.services.mozilla.com/D181032
2023-07-13 05:41:21 +00:00
ahochheiden
89fbee0640 Bug 1695312 - Sort the MACH_COMMANDS dict alphabetically r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D181031
2023-07-13 05:41:20 +00:00
ahochheiden
020a1fce7e Bug 1842700 - Fix l10n-cross-channel MachCommandReference module path r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D183217
2023-07-13 05:41:20 +00:00
nicklas boman
c3f1952ebe Bug 1798746 - Ensure checking for mercurial/git only if its a hg/git clone, not release source r=ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D162461
2023-05-09 16:33:36 +00:00
Cosmin Sabou
6f28253d4c Backed out changeset fab57c6553f4 (bug 1798746) for causing win aarch64 build bustages. CLOSED TREE 2023-05-09 08:25:18 +03:00
nicklas boman
641e4e6803 Bug 1798746 - Ensure checking for mercurial/git only if its a hg/git clone, not release source r=ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D162461
2023-05-09 02:15:30 +00:00
Iulian Moraru
5f08dc66c3 Backed out changeset 02cc74634f7d (bug 1798746) for causing build bustages. CLOSED TREE 2023-05-03 20:54:50 +03:00
nicklas boman
9871455d0d Bug 1798746 - Ensure checking for mercurial/git only if its a hg/git clone, not release source r=ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D162461
2023-05-03 15:45:36 +00:00
Marco Castelluccio
f69e697461 Bug 1801836 - Remove no longer necessary 'from __future__' imports. r=linter-reviewers,glandium,webdriver-reviewers,perftest-reviewers,geckoview-reviewers,jld,ahal,owlish,afinder DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D165395
2022-12-23 22:45:46 +00:00
Emilio Cobos Álvarez
de7acc6e32 Bug 1802405 - Prepend mozillabuild msys2 to path only for the build. r=glandium
This reverts bug 1801826 and instead prepends the msys2 path only for
the build, which is a bit more sensible.

This allows us to remove the existing warning from old_configure, since
that can't happen now.

Differential Revision: https://phabricator.services.mozilla.com/D163073
2022-11-26 23:23:34 +00:00
Marian-Vasile Laza
6b7ee54e9b Backed out changeset 738ee02dfc2a (bug 1802405) for causing build bustages. CLOSED TREE 2022-11-26 01:57:53 +02:00
Emilio Cobos Álvarez
fe8160e90a Bug 1802405 - Prepend mozillabuild msys2 to path only for the build. r=glandium
This reverts bug 1801826 and instead prepends the msys2 path only for
the build, which is a bit more sensible.

This allows us to remove the existing warning from old_configure, since
that can't happen now.

Differential Revision: https://phabricator.services.mozilla.com/D163073
2022-11-25 23:08:46 +00:00
Marco Castelluccio
ecb54845b0 Bug 1790816 - Reformat build/ with isort. r=linter-reviewers,ahal DONTBUILD
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D162668
2022-11-24 17:23:47 +00:00
Emilio Cobos Álvarez
26d1a61070 Bug 1801826 - Prepend rather than append mozillabuild path. r=ahochheiden
This makes sure that we find the right tools in the right msys2
environment in case we get called from another msys2 env.

Differential Revision: https://phabricator.services.mozilla.com/D162753
2022-11-23 18:17:28 +00:00
Mike Hommey
1c4a8ab901 Bug 1736762 - Stop waiting for user input before the creation of ~/.mozbuild . r=firefox-build-system-reviewers,ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D162638
2022-11-22 01:35:45 +00:00
Mark Striemer
02523cc40a Bug 1792237 - ./mach addwidget to scaffold a shared front-end component r=hjones
Depends on D161141

Differential Revision: https://phabricator.services.mozilla.com/D157937
2022-11-03 21:32:34 +00:00
Mark Striemer
e73bd9df47 Bug 1788797 - Move storybook commands to mach from npm scripts r=hjones,ahal
Differential Revision: https://phabricator.services.mozilla.com/D156241
2022-09-12 21:13:20 +00:00
Ben Dean-Kawamura
e965ed0056 Bug 1766045 - Adding mach command to generate UniFFI files r=glandium
Added `mach uniffi generate` which executes `uniffi-bindgen-gecko-js` to
generate UniFFI bindings. It's unfortunate that we need to check these
files in, but I couldn't figure out a way to auto-generate them as part
of the build process.

Adding `#include "nsIContent.h"` to dom/base/nsINodeList.h.  I think
that should have been present before, but things built okay because of
the way things got combined in the uniffied .cpp files. Adding these new
webIDL files bumped `NodeListBinding.cpp` to a new uniffied .cpp file
which caused the build to fail.

Differential Revision: https://phabricator.services.mozilla.com/D144468
2022-08-03 18:59:36 +00:00
Butkovits Atila
a8ad39a288 Backed out 6 changesets (bug 1766045) for causing build bustages. CLOSED TREE
Backed out changeset 113593df6272 (bug 1766045)
Backed out changeset f137315bb6af (bug 1766045)
Backed out changeset d86ad195a9a0 (bug 1766045)
Backed out changeset e8bc2ec40cff (bug 1766045)
Backed out changeset 2d33e41ac507 (bug 1766045)
Backed out changeset 4d5874e16302 (bug 1766045)
2022-08-03 17:40:30 +03:00
Ben Dean-Kawamura
86a582c07a Bug 1766045 - Adding mach command to generate UniFFI files r=glandium
Added `mach uniffi generate` which executes `uniffi-bindgen-gecko-js` to
generate UniFFI bindings. It's unfortunate that we need to check these
files in, but I couldn't figure out a way to auto-generate them as part
of the build process.

Adding `#include "nsIContent.h"` to dom/base/nsINodeList.h.  I think
that should have been present before, but things built okay because of
the way things got combined in the uniffied .cpp files. Adding these new
webIDL files bumped `NodeListBinding.cpp` to a new uniffied .cpp file
which caused the build to fail.

Differential Revision: https://phabricator.services.mozilla.com/D144468
2022-08-03 13:48:28 +00:00
Jan-Erik Rediger
21fd159579 Bug 1779992 - mach subcommand to upgrade Glean across all files. r=chutten DONTBUILD
This only modifies the files and prints the steps to be done manually.

Differential Revision: https://phabricator.services.mozilla.com/D152627
2022-07-26 13:51:31 +00:00