Commit Graph

7688 Commits

Author SHA1 Message Date
Nika Layzell
a7de25bcb9 Bug 1751948 - Part 2: Add support for generated UNIFIED_SOURCES files, r=glandium
This patch adds support for generated files to be placed in
UNIFIED_SOURCES.  This will be used in part 3 to build .cpp files
generated by IPDL_SOURCES by adding them to IPDL's UNIFIED_SOURCES under
the hood. Using a unified build for IPDL files is important, as a
significant build time regression was observed locally when using
non-unified sources to build ipdl sources, due to the large number of
generated files.

Differential Revision: https://phabricator.services.mozilla.com/D137166
2022-02-28 21:01:47 +00:00
Andrew Halberstadt
9cb4d22dce Bug 1754496 - [taskgraph] Use identical functions from vendored taskgraph in util/taskcluster.py, r=taskgraph-reviewers,aki
This replaces all of the functions in gecko_taskgraph/util/taskcluster.py with
the ones from the vendored taskgraph if they are identical.

Differential Revision: https://phabricator.services.mozilla.com/D138458
2022-02-25 21:25:05 +00:00
Zhao Jiazhong
62341514c5 Bug 1756570 - [loong64] Add basic build support for LoongArch64 port. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D139567
2022-02-25 03:42:34 +00:00
Narcis Beleuzu
be477df7f9 Backed out 3 changesets (bug 1752968) for GTest crashes on wrappers.cpp . CLOSED TREE
Backed out changeset 1ab482292c62 (bug 1752968)
Backed out changeset a57257eab3fc (bug 1752968)
Backed out changeset 7c29431ee202 (bug 1752968)
2022-02-24 02:48:07 +02:00
Nick Alexander
282d4de33d Bug 1752968 - Minify Fluent .ftl files in addition to .properties files. r=eemeli
Depends on D138365

Differential Revision: https://phabricator.services.mozilla.com/D138572
2022-02-23 23:11:50 +00:00
Nick Alexander
96e06a21d5 Bug 1752968 - Make single-locale l10n repacks minify .properties files. r=firefox-build-system-reviewers,eemeli,glandium
Differential Revision: https://phabricator.services.mozilla.com/D138365
2022-02-23 23:11:50 +00:00
Narcis Beleuzu
5c198ed236 Backed out changeset a470e4f70f80 (bug 1754496) as requested by ahal 2022-02-23 20:41:24 +02:00
Andrew Halberstadt
5d184200f1 Bug 1754496 - [taskgraph] Use identical functions from vendored taskgraph in util/taskcluster.py, r=taskgraph-reviewers,aki
This replaces all of the functions in gecko_taskgraph/util/taskcluster.py with
the ones from the vendored taskgraph if they are identical.

Differential Revision: https://phabricator.services.mozilla.com/D138458
2022-02-23 16:21:22 +00:00
Tom Ritter
0cee01db03 Bug 1722098: Fix the fzf version and download it directly r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D139057
2022-02-22 19:27:53 +00:00
Alex Ionescu
4f07163ef9 Bug 1749967 - Automated recording for android r=perftest-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D135891
2022-02-21 07:32:13 +00:00
Mitchell Hentges
e2438c91d3 Bug 1732795: Install coverage using pip r=ahal
`coverage` has native code, so the vendored version was only used as
source code from which the actual package could be built.
Since its always used in a context where we can `pip install` over the
network, let's do that. This cleans up our tree a bit and allows us to
leverage the `coverage` wheels.

Differential Revision: https://phabricator.services.mozilla.com/D138816
2022-02-18 14:27:18 +00:00
Mitchell Hentges
8d5bcd86f6 Bug 1732795: Resolve upcoming pytest deprecations r=webdriver-reviewers,ahal,whimboo
Following the pytest "deprecations and removals" docs [1], this patch:
* Replaces `@pytest.yield_fixture` with `@pytest.fixture`.
* Replaces `.funcargnames` with `.fixturenames`.
* Uses `Pathlib` parameter instead of the `py.path.local` one in
  associated `pytest_*` hooks.
* Replaces `--strict` with `--strict-markers`

[1] https://docs.pytest.org/en/latest/deprecations.html

Differential Revision: https://phabricator.services.mozilla.com/D138815
2022-02-18 14:27:18 +00:00
Mitchell Hentges
222e16e8b1 Bug 1753520: Compare config paths using pathlib r=firefox-build-system-reviewers,glandium
If previous config file paths were generated with a different
driveletter casing than the current context, then each file's contents
are replaced with `null`.

MozillaBuild 3.4 used a lowercase drive letter, and MozillaBuild 4.0
will use an uppercase drive letter.
So, using 3.4's existing objdir, and doing an incremental build with
4.0 will cause the `null` contents issue.

Adjust the files to be their `Path().resolve()`'d counterparts, so
they're string-comparable and the subset-calculation works correctly.

Differential Revision: https://phabricator.services.mozilla.com/D137807
2022-02-18 14:21:37 +00:00
Mitchell Hentges
6b25424737 Bug 1755530: Remove python_executable_version() r=glandium
* The python2/python3 lookup logic is obsolete, we can always depend on
  `sys.executable` since Mach starts with a Python version check
* `MozbuildObject`'s `python3` property was unused, which means that all
  of this removed code was dead anyways.

Differential Revision: https://phabricator.services.mozilla.com/D138824
2022-02-18 14:18:26 +00:00
Valentin Gosu
a1f3c24dce Bug 1755954 - Keep only vendored sfv 0.9.1 r=necko-reviewers,glandium,dragana
It seems sfv 0.8.0 is used in the tree, while neqo is using the newer 0.9.1.
Updating http-sfv to use sfv 0.9.1 should remove the code duplication.

Differential Revision: https://phabricator.services.mozilla.com/D139027
2022-02-18 08:51:51 +00:00
Mitchell Hentges
e8a78d6118 Bug 1755088: Replace all usages of unittest deprecated aliases r=webdriver-reviewers,ahal,whimboo
There's some unittest-related functions that we heavily lean on
that are deprecated:
https://docs.python.org/3/library/unittest.html#deprecated-aliases

This is a big find-and-replace that was restricted based on files that
matched the pattern `*test*.py` and that weren't in any of the paths
listed in `tools/rewriting/ThirdPartyPaths.txt`.

Differential Revision: https://phabricator.services.mozilla.com/D138608
2022-02-17 15:21:41 +00:00
ahochheiden
7452a37502 Bug 1751853 - Update string paths to Pathlib objects in Mozrelease module r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D136863
2022-02-16 18:00:38 +00:00
ahochheiden
b78352e424 Bug 1751853 - Replaced the logic in 'rmdirRecursive' with a more standard solution r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D136995
2022-02-16 18:00:38 +00:00
Joel Maher
2399972c85 Bug 1754613 - split a11y tests out of mochitest-browser-chrome into mochitest-browser-a11y. r=releng-reviewers,Jamie,gbrown
here is a try push:
https://treeherder.mozilla.org/jobs?repo=try&group_state=expanded&tier=1%2C2%2C3&revision=aca12d2de75f1fb0eb25432358e5518a8e7f812d

most of the bc failures fall into:
https://bugzilla.mozilla.org/show_bug.cgi?id=1742167

I only tested bc to see if there were issues removing the `ba` tests from there.

Differential Revision: https://phabricator.services.mozilla.com/D138571
2022-02-15 16:47:57 +00:00
Jan-Erik Rediger
d594208258 Bug 1689162 - Update to Glean metrics schema v2. r=Dexter,firefox-build-system-reviewers,nalexander DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D138537
2022-02-14 08:57:27 +00:00
ahochheiden
f405f02655 Bug 1753795 - Add progress bar (via tqdm) to running Python Tests r=ahal
This will give additional feedback to the user. Now they will have
immediate feedback in regards to the progress of the test run, instead
of being unsure of what's happening until the first test run completes.

Differential Revision: https://phabricator.services.mozilla.com/D137925
2022-02-11 18:51:46 +00:00
ahochheiden
ac7433fc00 Bug 1754726 - Add capturing for stderr when running Python Tests r=ahal
Since stdout is being piped, redirecting stderr to stdout causes it
to end up in the same pipe interleaved, which is what we want.

Also added a non-zero return code to be set when there is no test output.

Differential Revision: https://phabricator.services.mozilla.com/D138481
2022-02-11 18:04:18 +00:00
Barret Rennie
538d6991f2 Bug 1754917 - Clone repositories with core.autocrlf=input when vendoring r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D138516
2022-02-11 16:23:08 +00:00
Barret Rennie
d15e6e9f9a Bug 1754916 - Do not add extra newline to moz.yaml files when vendoring r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D138515
2022-02-11 16:23:08 +00:00
Barret Rennie
989f5c9cfd Bug 1754706 - Run scripts using absolute paths in mach vendor r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D138416
2022-02-11 16:23:07 +00:00
Barret Rennie
8c18a0ada2 Bug 1754704 - Support vendoring tags with @ or / in them r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D138415
2022-02-11 16:23:07 +00:00
Barret Rennie
2cafec6d77 Bug 1754702 - Use mozpath.normsep on paths when vendoring r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D138414
2022-02-11 16:23:06 +00:00
Barret Rennie
49d5b27e01 Bug 1754705 - Detect MSYS environment when MOZILLABUILD is set r=mhentges
Differential Revision: https://phabricator.services.mozilla.com/D138417
2022-02-11 16:23:06 +00:00
Sebastian Hengst
f546d469f9 Bug 1754775 - Turn off extra mach timestamp logging in automation. r=ahal
Logs from CI tasks have each line prefixed with date and time. Tasks like
Python linting log another timestamp how long the script has been running. This
should be omitted in automation to align it with log formats of other tasks
like mochitests which integrates it better with expectations of Treeherder's
log parser and bug filer..

Differential Revision: https://phabricator.services.mozilla.com/D138444
2022-02-11 10:52:57 +00:00
ahochheiden
883848bcf0 Bug 1752879 - Remove unnecessary check for Homebrew PATH ordering r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D137565
2022-02-11 02:12:15 +00:00
Nick Alexander
61287b0f62 Bug 1753292 - Don't re-order entries in macOS unified build omnijars. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D138396
2022-02-10 17:10:52 +00:00
Mitchell Hentges
cb97199fe0 Bug 1754241: ./mach lint now raises exception on no-op in CI r=ahal
If there's no files to lint in CI, that's a smell that something is
misconfigured.

Resolve this by raising an exception accordingly if `MOZ_AUTOMATION` is
set (and we aren't running the tests for the linting code itself).
Automatically recommend specifying `*`, as (assuming the use of a
shell) that will resolve to "all files/dirs at $topsrcdir`", which
matches existing behaviour if `--outgoing` and `--workdir` aren't
provided.

Differential Revision: https://phabricator.services.mozilla.com/D138172
2022-02-10 16:22:06 +00:00
Gregory Mierzwinski
9f2451e841 Bug 1752871 - Add option to specify which page to record. r=perftest-reviewers,AlexandruIonescu
This patch adds the --proxy-perftest-page option. With this option, we'll be able to specify which test pages we want to record rather than modifying the pageload_sites.json. Note that the login fields will not be taken into consideration with this option.

You can use the flag as follows (seperate multiple pages with a comma): --proxy-perftest-page microsft,linkedin,netflix

Furthermore, some changes were made to strengthen the conditions around when a login site can be tested (only when RAPTOR_LOGINS is defined locally, or if we are in CI).

Differential Revision: https://phabricator.services.mozilla.com/D137468
2022-02-10 16:09:22 +00:00
ahochheiden
85715645b0 Bug 1753555 - Replaced ProcessHandler in run_python_test with a more standard solution r=ahal
There's a bug with `ProcessHandler` on Windows that sometimes causes
tests to hang for an additional 3 minutes. This is a workaround that
just replaces `ProcessHandler` with a standard Python3 approach that
achieves the same thing.

Also added some logging output as the threads are created as some
additional feedback. Prior to this, the tests silently started
running without any indication.

Differential Revision: https://phabricator.services.mozilla.com/D137822
2022-02-08 23:46:12 +00:00
Mitchell Hentges
90c289dfa4 Bug 1753769: "runcli.py" in tests should use explicit paths r=ahal
The new `mozlint` behaviour will always lean on the VCS
to only lint changed files.

However, in tests, the VCS is going to be slow and also provide
inconsistent data between tests. Additionally, in some contexts,
the VCS won't be available.

Resolve this by hardcoding a file to lint for each case.

Differential Revision: https://phabricator.services.mozilla.com/D138033
2022-02-08 22:06:59 +00:00
Gregory Mierzwinski
34ba65f015 Bug 1753497 - Update browsertime for mozperftest to v14.1. r=perftest-reviewers,AlexandruIonescu
Differential Revision: https://phabricator.services.mozilla.com/D138005
2022-02-08 13:49:54 +00:00
Mitchell Hentges
b3b0d2b63d Bug 1752927: Avoid distutils deprecation warning on every Mach call r=ahal
Python 3.10 prints a warning when it sees `distutils` used, so let's
avoid using `distutils` in the "common Mach code" that runs on every
Mach call.

Note that this change will also fix the `SetuptoolsDeprecationWarning`
that shipped on `setuptools>=58.3.0`, since our usage of `distutils` was
calling a `setup.py install` under the hood.

Differential Revision: https://phabricator.services.mozilla.com/D137499
2022-02-04 21:49:15 +00:00
Mitchell Hentges
951485daa3 Bug 1753701: Always default to --outgoing/--workdir in ./mach lint r=ahal
Tweaks `./mach lint` behaviour to always fall back to only linting files
that have changed according to VCS - previously, this only happened if
no linter was provided.

Adjusts "am I at $topsrcdir" check to use `pathlib` to avoid mismatches
due to inconsistent capitalization or slash direction.

Updates CI references to explicitly provide `*` as the path to avoid
the only-lint-files-changed restriction.

Differential Revision: https://phabricator.services.mozilla.com/D137870
2022-02-04 21:48:59 +00:00
Mitchell Hentges
2f61099ad3 Bug 1752724: Use "light" bootstrapper on arm macOS (even when Rosetta) r=glandium
The main difference between `OSXBootstrapperLight` and `OSXBootstrapper`
is that the "light" one doesn't install utilities via `brew`.
However, these utilities are all optional for builds  (`watchman`,
`terminal-notifier`, etc).

Since arm macOS + Rosetta + brew installs are failing (because brew is
complaining that the "ARM prefix" is being used in a Rosetta context),
the solution provided by this patch is to avoid using `brew` in this
case.

Differential Revision: https://phabricator.services.mozilla.com/D137661
2022-02-04 16:05:44 +00:00
Mitchell Hentges
e913081903 Bug 1751795: Log more information if pip_install_requirements fails r=ahal
In addition to showing the `pip check` failure, also show:
* The `pip install --requirements ...` output
* The output of `pip list -v`
* The path to the `requirements.txt` file and the affected site.

To get sufficient detail of `pip install --requirements` to display
if the subsequent `pip check` call failed, I had to remove the
`--quiet` parameter. It was replicated by hiding _all_ output
if `quiet=True` and `pip install` succeeds - this is different to
the previous behaviour, where warnings would still poke through,
even if `quiet=True` and the install succeeded.
This was the only way to make it work such that all output would
be available without having to run `pip install` twice (which would
likely get different output the second time). Besides, there weren't
many warnings triggering this edge case, so the change in behaviour is
probably acceptable.

Additionally, in both places doing `pip check`
(post-install-requirements and when doing system-package compatibility
checking), move the `pip check` output to happen last, so that users
don't need to scroll to the top of the `pip list` wall of text to find
the reason for their command failure.

Differential Revision: https://phabricator.services.mozilla.com/D137206
2022-02-03 21:51:49 +00:00
Marian-Vasile Laza
d4e226ac2b Backed out changeset b0f8e402178c (bug 1753413) for causing perfdocs lint failures. CLOSED TREE 2022-02-03 21:36:02 +02:00
Sylvestre Ledru
a6fa94d220 Bug 1753413 - lint fix r=fix CLOSED TREE 2022-02-03 21:09:57 +02:00
Sylvestre Ledru
caaedeee98 Bug 1753413 - fx doc: Remove whitespaces, trailing lines & windows CR r=andi,perftest-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D137741
2022-02-03 18:34:58 +00:00
Alex Lopez
2da2365f75 Bug 1388894 - Replace list of mach modules to load with a dict of mach commands r=mhentges
This starts a centralized place to keep track of mach commands with some essential
metadata.

Differential Revision: https://phabricator.services.mozilla.com/D136790
2022-02-02 20:25:21 +00:00
Alex Lopez
e39b3c93d9 Bug 1388894 - Add function in Mach to load commands from files in bulk. r=mhentges
This reduces some code duplication and paves the way for modifying how
Mach loads modules.

The plan is to follow this up by making this function take a more fleshed out 'spec'
that maps command names to the files they're defined at and possibly more metadata.
Since this may affect how Mach works internally (e.g. with lazy loading in the roadmap),
it makes sense to move this logic inside the Mach class.

Differential Revision: https://phabricator.services.mozilla.com/D136789
2022-02-02 20:25:20 +00:00
Mitchell Hentges
559abbbdc0 Bug 1753259: Try finding VCS tool if build config is outdated r=ahal
Though not a panacea, this patch addresses existing usages of
`get_repository_from_build_config()` to fall back to
`get_repository_object()` if `MissingVCSTool` was encountered.

Ideally, we'd update `substs["HG"]` when we detect that it's changed,
but we don't have infrastructure to incrementally change configure
output.

So, other issues may creep up that will still warrant a fresh
`./mach configure`.

Differential Revision: https://phabricator.services.mozilla.com/D137675
2022-02-02 19:33:52 +00:00
june wilde
e3473c1bae Bug 1729456 - Don't remove files listed in keep or include when vendoring updates; r=tjr
Implements keep key in moz.yaml for keeping pre-existing files in the vendor directory
Implements include key in moz.yaml for forcing inclusion of files and folders from upstream

Differential Revision: https://phabricator.services.mozilla.com/D124799
2022-02-01 15:54:22 +00:00
Kagami Sascha Rosylight
02d04be983 Bug 1734722 - Part 2: Add if not domstreams to WPT meta r=jgraham,mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D136878
2022-01-31 22:15:38 +00:00
Sandor Molnar
aba8ecec36 Backed out 3 changesets (bug 1752232, bug 1734722) for causing spider-monkey failures. CLOSED TREE
Backed out changeset 319186f8024a (bug 1752232)
Backed out changeset 0a448a73bc66 (bug 1734722)
Backed out changeset e684ad3cd11a (bug 1734722)
2022-01-31 23:45:44 +02:00
Kagami Sascha Rosylight
af8c673c5b Bug 1734722 - Part 2: Add if not domstreams to WPT meta r=jgraham,mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D136878
2022-01-31 21:15:58 +00:00
ahochheiden
c50783cfa7 Bug 1750693 - Minimum changes necessary in mozversioncontrol/test to facilitate Pathlib migration r=firefox-build-system-reviewers,mhentges
The py.path allowed adding arbitrary fields to it, while a pathlib.Path
does not. To replicate the behavior with as few changes as possible, I
made a test fixture wrapper class (RepoTestFixture) to add the same
arbitrary fields to, while now containing a Pathlib path instead.

Also added a utility functions to make the running of tests a
bit cleaner ('execute_next_step')

Differential Revision: https://phabricator.services.mozilla.com/D136302
2022-01-31 15:26:17 +00:00
ahochheiden
d4958f0b9c Bug 1750693 - Update string paths to Pathlib objects in Mozversioncontrol module r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D136301
2022-01-31 15:26:17 +00:00
ahochheiden
ab4c0058ee Bug 1750693 - Removed update_git_repo function since it is unused r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D136644
2022-01-31 15:26:17 +00:00
ahochheiden
7e01ef8ced Bug 1750693 - Update tests in mozversioncontrol to be compatible with Windows r=firefox-build-system-reviewers,mhentges
Note: In `test_commit.py` For date formatting, the `%s` did not work on Windows.
On Linux it gives the time in seconds. The switch to the rfc822date format for
both hg and git `%aD` made the expected output in the check later work for both
git and hg, and made it platform agnostic.

Differential Revision: https://phabricator.services.mozilla.com/D136209
2022-01-28 17:04:33 +00:00
Nick Alexander
6f2ab562d3 Bug 1750676 - Make single-locale repacks not include META-INF/*. r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D136663
2022-01-28 04:00:20 +00:00
Nick Alexander
dcb7a55968 Bug 1717683 - Make ZIP packages and l10n repacks deterministic by using zip.py instead of make_zip.py. r=firefox-build-system-reviewers,glandium
The compression options appear to be the same: `mozjar` defaults to
level 9 compression.  The `mozjar` code is definitely slower than the
native ZIP executable, but not, I think, by enough to not do this.

This is the sole consumer of `make_zip.py` in the tree, so we remove
the file entirely.

Differential Revision: https://phabricator.services.mozilla.com/D118528
2022-01-28 04:00:20 +00:00
Nika Layzell
3e2e73e0bb Bug 1752354 - Fix error in ./mach gtest for android, r=releng-reviewers,gbrown
It appears this caller was missed when removing the webrender argument.

Differential Revision: https://phabricator.services.mozilla.com/D137163
2022-01-28 01:03:57 +00:00
Dan Mosedale
6e1ba3994e Bug 1746509 - Replace More from Mozilla XUL tags with HTML, r=pdahiya,Gijs,preferences-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D135733
2022-01-27 19:11:27 +00:00
Mike Hommey
54705f6ba5 Bug 1752060 - Make -fno-strict-aliasing a globally used flag. r=firefox-build-system-reviewers,andi
and make it override-able per directory.

Differential Revision: https://phabricator.services.mozilla.com/D136977
2022-01-27 00:07:12 +00:00
Nick Alexander
3ac3f7eb6d Bug 1751515 - Part 2: Preserve .sig signatures in Linux artifact builds. r=firefox-build-system-reviewers,glandium
This keeps the shape of the package produced by `mach package` in the
artifact build like that of the input `Bs` package.

Differential Revision: https://phabricator.services.mozilla.com/D136671
2022-01-26 19:08:57 +00:00
Nick Alexander
32e87d6161 Bug 1751515 - Part 1: Anchor artifact regexps to end of string with $. r=firefox-build-system-reviewers,glandium
This avoids processing `.asc` files when consuming signed builds.

Differential Revision: https://phabricator.services.mozilla.com/D136670
2022-01-26 19:08:56 +00:00
Nick Alexander
024e26d644 Bug 1750109 - Add MOZ_ARTIFACT_{FILE,URL} environment variables to control artifacts locally. r=firefox-build-system-reviewers,glandium
We support splitting `MOZ_ARTIFACT_FILE` by `os.pathsep` and splitting
`MOZ_ARTIFACT_URL` by space (`" "`) to allow both the package and the
tests.common archives to be specified.

Sadly, `file://` URLs are not (yet) accepted, so there's need for the
sibling environment variables.

Differential Revision: https://phabricator.services.mozilla.com/D135939
2022-01-26 19:06:39 +00:00
Nick Alexander
ac4c2586dc Bug 1750109 - Pre: Fix logging regression from Bug 1690870. r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D135938
2022-01-26 19:06:39 +00:00
Mitchell Hentges
f25a47724b Bug 1747837: Attempt to reinstall optional dependencies during bootstrap r=ahal
Currently, developers don't have a way to have the Mach virtualenv
re-attempt to install optional dependencies (such as `glean`).

As part of `./mach bootstrap` (the general catch-all "re-create my dev
environment" command), we should retry installing optional dependencies.

This also matches the "glean isn't installed" error message
recommendation.

Note: This doesn't address the case in which command virtualenvs
need their optional dependencies attempted to be reinstalled.
However, since we don't have any such cases yet, I'm satisfied with
deferring that work.

Differential Revision: https://phabricator.services.mozilla.com/D123242
2022-01-25 22:19:10 +00:00
Mike Hommey
e467585271 Bug 1751331 - Use the mozbuild crate in xpcom. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D136565
2022-01-25 21:29:52 +00:00
Nicklas Boman
f25c8b740a Bug 1751028 - Fix randomized sys.path order when using system Python packages r=mhentges
Differential Revision: https://phabricator.services.mozilla.com/D136880
2022-01-25 17:19:54 +00:00
criss
592389ca2d Backed out 10 changesets (bug 1751331) for causing bustages. CLOSED TREE
Backed out changeset 5ce212465a26 (bug 1751331)
Backed out changeset 14d62b8ffa5a (bug 1751331)
Backed out changeset 76f46bd9afa1 (bug 1751331)
Backed out changeset 147faaad046f (bug 1751331)
Backed out changeset f85b049d12f9 (bug 1751331)
Backed out changeset 16d8d3f8378b (bug 1751331)
Backed out changeset 1cd9386a3927 (bug 1751331)
Backed out changeset 20faacba6db6 (bug 1751331)
Backed out changeset 7d17f75bcb38 (bug 1751331)
Backed out changeset 28b9aab1f174 (bug 1751331)
2022-01-25 13:00:25 +02:00
Mike Hommey
5fa0297527 Bug 1751331 - Use the mozbuild crate in xpcom. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D136565
2022-01-25 09:03:04 +00:00
Mitchell Hentges
16f2e5f5b2 Bug 1751284: Assert for distutils during Mach initialization r=ahal
Our platform-specific `bootstrap` code transitively depends on
the standard library's `distutils` module, but Debian Linux and derived
distros generally split `distutils` into a separate installable OS
package from `python3` itself.

So, Python 3 being able to run isn't a sufficient guarantee that
`distutils` is available.

To catch this case, add a `distutils` check at the very beginning of
Mach initialization.

-----

Also remove an obsolete comment claiming that `mach bootstrap` doesn't
need `distutils`, which was obsoleted by Bug 1717051.

Differential Revision: https://phabricator.services.mozilla.com/D136639
2022-01-24 22:35:25 +00:00
Jens Stutte
22a8e29a72 Bug 1751673: Update archlinux.ensure_nasm_packages parameter list. r=firefox-build-system-reviewers,nalexander
Differential Revision: https://phabricator.services.mozilla.com/D136716
2022-01-24 18:32:46 +00:00
Mike Hommey
116357dac6 Bug 1751564 - Make mozboot.find_mozconfig return a Path. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D136692
2022-01-23 20:54:08 +00:00
Mike Hommey
f68a0cc864 Bug 1751343 - Perform Cargo.lock-based checks before vendoring rather than after. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D136570
2022-01-21 21:44:57 +00:00
ahochheiden
d131872157 Bug 1748505 - Remove 3rd positional argument that is no longer required from update_git_tools() call r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D135268
2022-01-21 19:35:50 +00:00
ahochheiden
d4c362f06c Bug 1744884 - Remove requests module import, as it's already in-scope by the time of bootstrap (since to Bug 1647792) r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D135267
2022-01-21 19:35:50 +00:00
ahochheiden
80a93642e9 Bug 1744884 - Move win_to_msys_path helper function outside of Bootstrapper class to mach/util.py so that it can be used elsewhere. r=firefox-build-system-reviewers,mhentges
Added usage during `configure_git` for cinnabar directory location
instructions for adding to PATH.

Differential Revision: https://phabricator.services.mozilla.com/D135266
2022-01-21 19:35:49 +00:00
ahochheiden
72bb536e37 Bug 1744884 - Remove no_interactive parameter from run_prewarm_avd in android.py since it was not used. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D135265
2022-01-21 19:35:49 +00:00
ahochheiden
833d4d05fc Bug 1744884 - Remove 'os_arch' parameter from ensure_android_sdk_and_ndk since it was not used. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D135264
2022-01-21 19:35:49 +00:00
ahochheiden
28f7d9eaee Bug 1744884 - Remove ensure_dir function from android.py r=firefox-build-system-reviewers,mhentges
What this function does can easily be a one-liner now that we're using
Pathlib, so both calls to it have been replaced by said one-liner.

Differential Revision: https://phabricator.services.mozilla.com/D135263
2022-01-21 19:35:48 +00:00
ahochheiden
2a3ddd407e 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
ahochheiden
b06e61aee3 Bug 1744884 - Remove 'emulator_path` creation from get_paths function in android.py since it is not used. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D135262
2022-01-21 19:35:47 +00:00
Mitchell Hentges
0492b82b77 Bug 1750874: Support launching Mach with py instead of python r=glandium
When installing from Python.org, the `python` command isn't available by
default (in favour of `py`). Support using `py` instead.

There were issues running `hg` when `python` isn't added to the `PATH`,
so the docs are being updated accordingly.
Of course, it's still worth supporting `py`-instead-of-`python`
workflows for `git` users who won't be impacted by that bug.

Differential Revision: https://phabricator.services.mozilla.com/D136286
2022-01-21 18:22:58 +00:00
ahochheiden
bea764be73 Bug 1750153 - Prevent unwanted errors from showing up in ./mach show-log after closing less before the entire log file has been piped to it r=firefox-build-system-reviewers,mhentges
The main thread is blocking (for an unknown reason) without piping the entirety of the log
file to `less` (unless the user manually scrolls to almost the bottom). Since the piping
cannot always complete without a user terminating, we must hide the errors that arise
from using the `stdin` stream for the `less` process after the process is terminated.

Differential Revision: https://phabricator.services.mozilla.com/D135979
2022-01-20 19:34:45 +00:00
ahochheiden
5b1ec638ce Bug 1748070 - rewrote show_log to resolve various bugs on Windows (While still maintaining current behavior on POSIX systems) r=firefox-build-system-reviewers,glandium,mhentges
- Changed byte strings being set in env to just strings
  as byte strings were only necessaery in Python2 and
  strings work fine in POSIX and Windows as of Python3.
  (Byte strings no longer work on Windows in Python3)
- Replaced all the file descriptor logic used to pipe
  to `less` with more Pythonic stream manipulation.
  (There was a change in Windows console IO in Python 3.6
  that broke the file descriptor logic we were using here)

  See: https://www.python.org/dev/peps/pep-0528/#add-io-windowsconsoleio

Differential Revision: https://phabricator.services.mozilla.com/D135969
2022-01-20 19:34:45 +00:00
Mitchell Hentges
e247709b23 Bug 1727819: Remove redundant virtualenv activation for docs r=ahal
Sphinx already runs within the `./mach doc` command, which has the
`docs` virtualenv activated. Activating another virtualenv within a
Sphinx python file is redundant.

Differential Revision: https://phabricator.services.mozilla.com/D135305
2022-01-19 19:57:20 +00:00
Gregory Mierzwinski
313d80b9e9 Bug 1742103 - Update the browsertime version used by Mozperftest. r=perftest-reviewers,AlexandruIonescu
Differential Revision: https://phabricator.services.mozilla.com/D133910
2022-01-19 14:30:12 +00:00
Mitchell Hentges
86cefc7154 Bug 1748781: Don't re-include site's prefix in import scope r=ahal
When the redundant-site-package-dir pruning was originally implemented,
it assumed that only `<venv>/lib/<site-packages-dir>` was automatically
added to the `sys.path`. However, it looks like some platforms
(including Windows) also add the prefix of the venv itself to the
`sys.path`.

We can work around this by removing both from the `sys.path` carry-over,
and the deprioritization logic.

Differential Revision: https://phabricator.services.mozilla.com/D135300
2022-01-19 00:55:50 +00:00
Mike Hommey
6c2ecbdb2e Bug 1750671 - Adjustments to fix testcase. CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D136270
2022-01-18 21:31:56 +00:00
Francesco Lodolo (:flod)
e18b1fe590 Bug 1750538 - Remove Fluent migration recipes for Firefox 92-95, r=eemeli
Differential Revision: https://phabricator.services.mozilla.com/D136120
2022-01-17 14:35:06 +00:00
Mike Hommey
b886e9ad5c Bug 1748967 - Keep track of duplicated rust crates. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D135317
2022-01-13 22:17:09 +00:00
Mitchell Hentges
168707a1e5 Bug 1746286: Don't recommend adding "Mach" to your PATH r=ahal
This can cause issues when Mach from sourcetree A fails when used in
sourcetree B because an expected file is missing.

Differential Revision: https://phabricator.services.mozilla.com/D133951
2022-01-13 21:39:39 +00:00
Mike Kaply
0b3cfeaed2 Bug 1733497 - Remove region.properties. r=geckoview-reviewers,m_kato,flod
Differential Revision: https://phabricator.services.mozilla.com/D134427
2022-01-13 21:18:30 +00:00
Rob Lemley
7f62959f0f Bug 1747879 - Pass Thunderbird subrepo srcpath to symbolstore.py. r=firefox-build-system-reviewers,andi
The sym files generated for Thunderbird builds contain incorrect VCS references.
symbolstore.py will handle the subrepo correctly with an additional -s argument
if MOZ_SOURCE_REPO and MOZ_SOURCE_CHANGESET are not set. See D135392.

Differential Revision: https://phabricator.services.mozilla.com/D135299
2022-01-13 19:10:26 +00:00
Tom Ritter
8d49db516e Bug 1749346: Add fuzzy-query to the moz.yaml format r=jewilde
Differential Revision: https://phabricator.services.mozilla.com/D135535
2022-01-13 16:25:46 +00:00
Gijs Kruitbosch
23496d7831 Bug 1648114 - make clang-tidy easier to find, r=andi
Differential Revision: https://phabricator.services.mozilla.com/D133191
2022-01-13 16:20:03 +00:00
Agi Sferro
fe94caaf56 Bug 1743469 - Target android 31. r=jgraham,jnicol,calu
Differential Revision: https://phabricator.services.mozilla.com/D133153
2022-01-11 19:16:03 +00:00
Agi Sferro
024994e801 Bug 1724480 - Upgrade JDK to Java 17. r=glandium,ahal,calu
Differential Revision: https://phabricator.services.mozilla.com/D131972
2022-01-11 19:16:01 +00:00
Greg Tatum
c6eeab3adf Bug 1580599 - Migrate DevTools toolbox meatball menu to fluent; r=devtools-reviewers,fluent-reviewers,nchevobbe,flod
Differential Revision: https://phabricator.services.mozilla.com/D134419
2022-01-10 17:09:16 +00:00
Mike Hommey
92a2c719c3 Bug 1748966 - Bustage fix. CLOSED TREE 2022-01-07 23:48:18 +02:00
Mike Hommey
c8c1a3c5f2 Bug 1748966 - Speed up bootstrap. r=firefox-build-system-reviewers,andi
Currently, the bootstrap code from configure gets bootstrapped task info
from the taskgraph, and then invokes `mach artifact toolchain` which...
does the same again. That cumulatively wastes a noticeable amount of
time, especially on Windows.

So to avoid repeating this work that the configure side already did,
we do a little more on the configure side (resolution from index to
task-id), and just give a (task-id, artifact path) pair to `mach
artifact toolchain`. The added code to `mach artifact toolchain` is
actually ironically very similar to the code that was removed in
bug 1687594.

And now that mach bootstrap uses the configure code, it benefits from
this change as well.

Differential Revision: https://phabricator.services.mozilla.com/D135311
2022-01-07 21:26:44 +00:00
Andrew Halberstadt
64eea7ceb7 Bug 1748457 - Drop usages of six in |mach python-test|, r=mhentges
Depends on D135274

Differential Revision: https://phabricator.services.mozilla.com/D135275
2022-01-07 03:59:33 +00:00
Andrew Halberstadt
72ce29c06a Bug 1748457 - [python-test] Log output from failed tests at the end, r=mhentges
The python-test infra runs each test file in a separate process for
parallelization.  This is expedient, but it means that when a test fails, the
output is often buried 1000s of lines in scrollback and difficult to find.

In the future, we could look into using 'pytest-async' rather than rolling our
own parallelization, this way Pytest would output the failures again at the end
of the run.

But for now, it's easier to simply defer outputting failed tests until the very
end. This is done in a try/finally block so even if there was a
KeyboardInterrupt or other exception, we'll still print the failed tests.

Differential Revision: https://phabricator.services.mozilla.com/D135274
2022-01-07 03:59:32 +00:00
Mitchell Hentges
47520dab98 Bug 1725895: Add support for MSYS2 MozillaBuild r=glandium
MSYS2 has a slightly different directory structure (binaries are
now under "/usr/bin/" instead of "/bin/"), and we're now plonking
it in `%MOZILLABUILD%\msys2` instead of `%MOZILLABUILD%\msys` so that
MSYS1 files don't interfere with MSYS2 after a pave-over install.

Speaking of pave-over installs: if both `msys2` and `msys` are available,
this patch prefers `msys2`. This is because MozillaBuild installations
with MSYS2 are going to _assume_ they're using MSYS2, and therefore
be most compatible with the versions of packages shipped with MSYS2.

Differential Revision: https://phabricator.services.mozilla.com/D133549
2022-01-06 06:49:47 +00:00
Mitchell Hentges
92a19e0eb9 Bug 1740123: Allow invoking Mach outside of MozillaBuild r=glandium
Assuming that the `MOZILLABUILD` environment variable is set, allow
invoking Mach from non-MozillaBuild terminals.

Note that MozillaBuild still needs to be installed, and the
`MOZILLABUILD` environment variable will have to be set.

For future reference: when I tried setting this up with Windows
Store's Python 3.9, I encountered issues when running binaries installed
via `pip`: it would fail with `abort: failed to load Python DLL
python3x.dll`.

Differential Revision: https://phabricator.services.mozilla.com/D133936
2022-01-06 06:49:47 +00:00
Mitchell Hentges
7e6a4952a2 Bug 1725895: Port --profile-command to pure-Python r=nalexander,glandium
As part of this, the shell-script part of `./mach` can be removed,
making it pure Python.

There's a change in `--profile-command` behaviour, though: it now only
profiles the specific command, rather than all of Mach.
This is because _so much of Mach_ has already been run before
CLI arguments are parsed in the Python process.

If a developer wants to profile Mach itself, they can manually run
`python3 -m cProfile -o <file> ./mach ...`

Differential Revision: https://phabricator.services.mozilla.com/D133928
2022-01-06 00:32:48 +00:00
Tom Ritter
54336b65f3 Bug 1740062: Add some qualifiers for mach vendor revision for Angle r=jewilde
Depends on D132592

Differential Revision: https://phabricator.services.mozilla.com/D132593
2022-01-05 19:52:46 +00:00
Mike Hommey
de0df1009a Bug 1748383 - In configure, make e.g. os.path.join mean the same thing whether importing os or not. r=firefox-build-system-reviewers,mhentges
Currently, using any of the functions defined in
`ConfigureSandbox.OS.path` in a `@depends` function will have a different
behavior if the function has an `@imports("os")` or not. In the former
case, we get plain `os.path.$function`, while in the latter we get the
function from `ConfigureSandbox.OS.path`, which handles path separators
differently, which makes a significant difference on Windows.

With this change, we now consistently use the versions from
`ConfigureSandbox.OS.path`.

Differential Revision: https://phabricator.services.mozilla.com/D135003
2022-01-05 01:34:35 +00:00
Marian-Vasile Laza
7262acfd88 Backed out 2 changesets (bug 1725895, bug 1740123) for causing build bustages.
Backed out changeset a6eabd95e31d (bug 1740123)
Backed out changeset bfd5211060b4 (bug 1725895)
2022-01-05 03:46:17 +02:00
Marian-Vasile Laza
cb91098de5 Backed out changeset c2aa8dae914d (bug 1748383) for causing python test failures. CLOSED TREE 2022-01-05 03:12:29 +02:00
Mike Hommey
db7f69314b Bug 1748391 - Remove advertisement for the Visual Studio backend. r=firefox-build-system-reviewers,mhentges
The VS backend is always built when building on Windows for Windows, so
in practice, the message isn't printed... except when cross-compiling on
Windows, in which case the VS backend doesn't work.

Differential Revision: https://phabricator.services.mozilla.com/D135015
2022-01-05 00:55:53 +00:00
Mike Hommey
c8dbb11daa Bug 1647542 - Handle host libraries properly when cross-compiling on Windows. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D135013
2022-01-05 00:47:55 +00:00
Mike Hommey
e277ddd5a8 Bug 1748383 - In configure, make e.g. os.path.join mean the same thing whether importing os or not. r=firefox-build-system-reviewers,mhentges
Currently, using any of the functions defined in
`ConfigureSandbox.OS.path` in a `@depends` function will have a different
behavior if the function has an `@imports("os")` or not. In the former
case, we get plain `os.path.$function`, while in the latter we get the
function from `ConfigureSandbox.OS.path`, which handles path separators
differently, which makes a significant difference on Windows.

With this change, we now consistently use the versions from
`ConfigureSandbox.OS.path`.

Differential Revision: https://phabricator.services.mozilla.com/D135003
2022-01-05 00:47:54 +00:00
Mike Hommey
d2d9350277 Bug 1748385 - Use the --dont-define-prefix flag of pkg-config when supported. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D135012
2022-01-05 00:02:43 +00:00
Mike Hommey
7ebc2dc34a Bug 1748385 - Add --shared flag when using pkgconf >= 1.7.4. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D135011
2022-01-05 00:02:42 +00:00
Mike Hommey
e1c71aa04b Bug 1748385 - Add a pkgconf toolchain and use it. r=firefox-build-system-reviewers,mhentges
pkgconf is an alternative implementation of pkg-config that is more
cross-platform. It has also become the default on Fedora, so it's not
some random project.

Differential Revision: https://phabricator.services.mozilla.com/D135009
2022-01-05 00:02:41 +00:00
Narcis Beleuzu
1b1effc9ba Backed out 5 changesets (bug 1748385, bug 513617) for bustages on pkg.configure . CLOSED TREE
Backed out changeset bc23b3cfb583 (bug 1748385)
Backed out changeset 53f3c4e3e600 (bug 1748385)
Backed out changeset 5c744edba720 (bug 1748385)
Backed out changeset ad23d3af4df6 (bug 1748385)
Backed out changeset 54e3431d9152 (bug 513617)
2022-01-05 01:23:29 +02:00
Mike Hommey
2d9ca36bea Bug 1748385 - Use the --dont-define-prefix flag of pkg-config when supported. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D135012
2022-01-04 22:57:02 +00:00
Mike Hommey
55c350dbd6 Bug 1748385 - Add --shared flag when using pkgconf >= 1.7.4. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D135011
2022-01-04 22:57:02 +00:00
Mike Hommey
983fd05b85 Bug 1748385 - Add a pkgconf toolchain and use it. r=firefox-build-system-reviewers,mhentges
pkgconf is an alternative implementation of pkg-config that is more
cross-platform. It has also become the default on Fedora, so it's not
some random project.

Differential Revision: https://phabricator.services.mozilla.com/D135009
2022-01-04 22:57:01 +00:00
Mitchell Hentges
07f875d674 Bug 1725895: Port --profile-command to pure-Python r=nalexander,glandium
As part of this, the shell-script part of `./mach` can be removed,
making it pure Python.

There's a change in `--profile-command` behaviour, though: it now only
profiles the specific command, rather than all of Mach.
This is because _so much of Mach_ has already been run before
CLI arguments are parsed in the Python process.

If a developer wants to profile Mach itself, they can manually run
`python3 -m cProfile -o <file> ./mach ...`

Differential Revision: https://phabricator.services.mozilla.com/D133928
2022-01-04 21:07:32 +00:00
Tom Ritter
4404d06aa8 Bug 1743688: Allow specifying and passing arguments to the script run during vendoring r=jewilde
Depends on D129534

Differential Revision: https://phabricator.services.mozilla.com/D129535
2022-01-04 20:53:29 +00:00
Tom Ritter
81237c569e Bug 1743688: Add a new type of source hosting for angle to look for the upstream branch on chrome beta r=jgilbert,jewilde
Depends on D129533

Differential Revision: https://phabricator.services.mozilla.com/D129534
2022-01-04 20:53:28 +00:00
Tom Ritter
afeb3634ae Bug 1743688: Moving tracking from updatebot to vendoring r=jewilde
It occurs to me that because tracking is a general vendoring need
(not just for updatebot) that it should live under vendoring.

Depends on D129437

Differential Revision: https://phabricator.services.mozilla.com/D129533
2022-01-04 20:53:28 +00:00
Tom Ritter
b9b257ce6d Bug 1743688: Fix a bit in rewrite_mozbuild r=jewilde
Depends on D129436

Differential Revision: https://phabricator.services.mozilla.com/D129437
2022-01-04 20:53:28 +00:00
Tom Ritter
9e748d25fc Bug 1743688: Fix some nuances of run-script r=jewilde
Depends on D129434

Differential Revision: https://phabricator.services.mozilla.com/D129436
2022-01-04 20:53:27 +00:00
Tom Ritter
c9e40f6e29 Bug 1743688: Allow a moz.yaml to skip certain vendoring steps r=jewilde
Differential Revision: https://phabricator.services.mozilla.com/D129434
2022-01-04 20:53:27 +00:00
Alex Ionescu
5327fad352 Bug 1741896 Accept/prevent first load prompts for CNN during automated recording r=perftest-reviewers,kimberlythegeek
Differential Revision: https://phabricator.services.mozilla.com/D131508
2022-01-03 07:12:51 +00:00
Mike Hommey
d179837cf2 Bug 1747533 - Update clang pass manager flags handling. r=firefox-build-system-reviewers,andi
- Avoid the flag selection silently not enabling the new pass manager
  when --enable-new-pass-manager is passed explicitly.
- Avoid adding the -fexperimental-new-pass-manager to clang >= 13, which
  has it enabled by default. Likewise for the linker flags.
- Remove the force-enable of the new pass manager with clang < 12 on
  automation, since we're using version 13 anyways.
- Account for the fact that both lld and ld64 can pass the
  -import-hot-multiplier flag to the LTO plugin on mac builds, which
  effectively will set it for the first time on mac, and might improve
  performance.

Differential Revision: https://phabricator.services.mozilla.com/D134860
2021-12-31 08:41:16 +00:00
Mitchell Hentges
8f5aad46e5 Bug 1732946: Guard against "pip install" venv conflicts r=ahal
`pip install`'s standard behaviour is to satisfy the new requirement,
even if it conflicts with existing packages. If a conflict _does_
occur, `pip` will simply warn about it after the installation has
already damaged the environment.

By using the `--constraint` feature, we force `pip` to consider
already-installed packages before installing new ones. If a conflict
is detected, an error is raised and `pip` stops without damaging
the environment.

Since we're capturing system packages (when needed) with this feature,
we can now allow virtualenvs that do pip-installations to safely work
with system-using Mach environments.

Differential Revision: https://phabricator.services.mozilla.com/D126925
2021-12-30 01:08:06 +00:00
Mitchell Hentges
e045b404e8 Bug 1730712: Avoid redundant venv rebuilds in nested Mach calls r=perftest-reviewers,ahal,AlexandruIonescu
Port some `sys.path` modifications to the centralized system.
Not only is this cleaner (ad-hoc global modifications are spicy), but
this also avoids "reordering" issues that can creep in during nested
calls, causing virtualenvs to be unnecessarily recreated.

Differential Revision: https://phabricator.services.mozilla.com/D134481
2021-12-30 01:05:07 +00:00
Mike Hommey
a98b7b380c Bug 1747757 - Remove -l from OS_LIBS set from gyp. r=firefox-build-system-reviewers,mhentges
NSS gyp files use -l$lib, and while OS_LIBS accepts this form and passes
it through, it's not actually a recognized way to link libraries on
clang-cl builds. So, re-normalize the values to not include -l, which
will add it back in the backend when appropriate, or switch to $lib.lib
on platforms that use this form.

Differential Revision: https://phabricator.services.mozilla.com/D134736
2021-12-29 22:18:51 +00:00
Mitchell Hentges
37a1a70a52 Bug 1730712: Maintain sys.path consistency in nested Mach calls r=ahal
This patch resolves cases like the following:
1. The system Python has `zstandard`.
2. `MOZ_AUTOMATION=1 ./mach python --virtualenv psutil <script>`
   is run, adding `psutil` to the import scope.
3. `<script>` runs Mach a _second_ time, and this time Mach needs to
   be able to import `zstandard` (in this case, it should be able
   to fetch it from the system Python's site-packages).

The previous behaviour would add the "site-packages" of the //invoking//
Python interpreter, but ancestor packages would get dropped.

To rectify this issue, this patch changes "import inheritance" to keep
more of the `sys.path`, rather than just
`<external-python>.all_site_packages_dirs()`.

Note: the original implementation of this patch passed forward *all*
of the `sys.path` when creating virtualenvs. However, this caused issues
when Mach ran `pip`, because `pip` was no longer able to discover the
"standard library" (it was failing because it assumed all paths defined
in a virtualenv's site were non-standard-library paths, and the original
implementation broke that assumption).

As part of this, a distinction was defined between the "current" Python
interpreter (external_python) and the top-level Python interpreter
(original_python). This was needed to enable discovering which paths
are "standard library paths".

Differential Revision: https://phabricator.services.mozilla.com/D134201
2021-12-29 21:10:22 +00:00
Kelsey Gilbert
0b8af194b9 Bug 1747745 - Fix git worktree support in ./mach bootstrap. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D134719
2021-12-29 20:20:53 +00:00
Aki Sasaki
b480a06e9a Bug 1747280 - nuke comm/ after cross-channel. r=mhentges,releng-reviewers,jmaher DONTBUILD
We clean up our Gecko clone between tasks via `hg robustcheckout --purge`, which runs `hg purge`. This is very effective, *but* it doesn't detect or clean up any nested clones.

Because we run cross-channel on Gecko workers, and because we clone `comm/` in cross-channel and haven't cleaned it up, and because `hg purge` doesn't detect or clean up nested clones, and because our current virtualenv setup code traverses the tree and can error out on `comm/` clones, let's clean up `comm/` after running cross-channel.

We'll be moving TB cross-channel to different tasks/workers in bug 1742711, and ideally we can update robustcheckout and/or `hg purge` to be able to detect and/or clean up nested clones.

Differential Revision: https://phabricator.services.mozilla.com/D134582
2021-12-28 18:56:47 +00:00
Iulian Moraru
ddbe8b52ac Backed out changeset 68098f573c46 (bug 1747280) for causing Bug 1747545. CLOSED TREE 2021-12-24 20:28:14 +02:00
Mike Hommey
8ea7516844 Bug 1747347 - Use configure autobootstrap code to install toolchains in mach bootstrap. r=firefox-build-system-reviewers,andi
This uses the same trick as bug 1743832 under the hood. We could go the
other way around, extracting the configure code to a separate module,
but the longer term goal here is to have configure figure out which
things to bootstrap for the selected build type.

As a side effect, mach bootstrap will stop re-bootstrapping things that
are already up-to-date, at least for things using
install_toolchain_artifact, excluding those that don't follow the
convention wrt the extracted directory path.

Differential Revision: https://phabricator.services.mozilla.com/D134595
2021-12-23 20:55:36 +00:00
Emilio Cobos Álvarez
e195b342bd Bug 1747387 - Fix MozillaBuildBootstrapper after bug 1747216. r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D134608
2021-12-23 20:42:18 +00:00
Mike Hommey
fce6eb7d83 Bug 1747165 - Replace TK_FLAGS/TK_LIBS with MOZ_GTK3_FLAGS/MOZ_GTK3_LIBS. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D134464
2021-12-23 20:29:07 +00:00
Aki Sasaki
a6f09dd1ef Bug 1747280 - nuke comm/ after cross-channel. r=releng-reviewers,jmaher DONTBUILD
We clean up our Gecko clone between tasks via `hg robustcheckout --purge`, which runs `hg purge`. This is very effective, *but* it doesn't detect or clean up any nested clones.

Because we run cross-channel on Gecko workers, and because we clone `comm/` in cross-channel and haven't cleaned it up, and because `hg purge` doesn't detect or clean up nested clones, and because our current virtualenv setup code traverses the tree and can error out on `comm/` clones, let's clean up `comm/` after running cross-channel.

We'll be moving TB cross-channel to different tasks/workers in bug 1742711, and ideally we can update robustcheckout and/or `hg purge` to be able to detect and/or clean up nested clones.

Differential Revision: https://phabricator.services.mozilla.com/D134582
2021-12-23 19:25:02 +00:00
Cristian Tuns
e1e31e01f2 Backed out 2 changesets (bug 1747165) for causing nightly blockers(bustages) a=backout
Backed out changeset 4b1ab0915c94 (bug 1747165)
Backed out changeset 96043d814772 (bug 1747165)
2021-12-23 08:00:54 -05:00
Sandor Molnar
f1b3847e69 Backed out changeset 9cef54c30d49 (bug 1648114) for causing python unit test failures in test_mach_commands. CLOSED TREE 2021-12-23 02:50:20 +02:00
Gijs Kruitbosch
a57fa13232 Bug 1648114 - make clang-tidy easier to find, r=andi
Differential Revision: https://phabricator.services.mozilla.com/D133191
2021-12-23 00:29:10 +00:00
Mike Hommey
b55194a16f Bug 1747165 - Replace TK_FLAGS/TK_LIBS with MOZ_GTK3_FLAGS/MOZ_GTK3_LIBS. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D134464
2021-12-22 23:56:24 +00:00
Mike Hommey
6fbca3923d Bug 1747216 - Avoid passing state and source directory to all Bootstrapper methods. r=firefox-build-system-reviewers,nalexander
Differential Revision: https://phabricator.services.mozilla.com/D134489
2021-12-22 21:09:51 +00:00
Mike Hommey
044b037fac Bug 1747215 - Stop bootstrapping node/npm from Linux distro packages. r=firefox-build-system-reviewers,andi
We install it via a toolchain artifact anyways, if not via mach
bootstrap, via configure's autobootstrap.

Differential Revision: https://phabricator.services.mozilla.com/D134488
2021-12-22 21:09:51 +00:00
Mike Hommey
40cad9af3e Bug 1747211 - Stop bootstrapping nasm from Linux distro packages r=firefox-build-system-reviewers,andi
We install it via a toolchain artifact anyways, if not via mach
bootstrap, via configure's autobootstrap.

Differential Revision: https://phabricator.services.mozilla.com/D134487
2021-12-22 21:09:50 +00:00
Mitchell Hentges
183c94cd54 Bug 1730712: Abstract site behaviour from requirements.py r=ahal
There are two sites that are allowed to define their dependencies
in a flexible way: the `mach` and `build` sites.

This is because these are the only two sites that _may_ have
to operate without `pip install`-ing any packages, and instead having
to be compatible with the packages installed to the system.

Due to this required compatibility, allowing flexibility to these sites
allows flexibility downstream.

Anyways, this patch isn't about that - that behaviour has already
landed. This patch is about tweaking `requirements.py` so that
*it* doesn't care about specific sites, but rather only cares about
if it should assert `only_strict_requirements` or not. Accordingly,
the helpful "not all packages are pinned" error message is moved
to `site.py`, where it belongs.

Differential Revision: https://phabricator.services.mozilla.com/D132082
2021-12-22 00:46:25 +00:00
Mitchell Hentges
3e16efe884 Bug 1730712: Perform command-site "pip check" if Mach using system scope r=ahal
Even if a command site has its own comfy virtualenv, if Mach is using
the system packages then they'll still be in-scope for commands.

So, we still need to `_assert_pip_check()` in case the command's
vendored packages conflict.

Differential Revision: https://phabricator.services.mozilla.com/D132168
2021-12-22 00:46:25 +00:00
Mitchell Hentges
67c4c9990e Bug 1732946: Adjust "use 'vendored:'?" warn to be more aligned with pip r=ahal
Pip is able to detect unpacked sdists because they have a `.egg-info`
directory, *not* because they have a top-level `PKG-INFO` file.

This is confirmed by the `MarkupSafe` case, where pip can see the
package in `third_party/python/MarkupSafe/src`, even though there's no
`PKG-INFO` at that depth.

Make two other changes as part of this:
* Only submit the warning if the package is under a "third_party"
  directory to avoid a false positive when the developer has performed
  a "pip install -e" on a first-party module
* Move the check to `test_site_compatibility` to avoid unnecessary
  validation at runtime.

Differential Revision: https://phabricator.services.mozilla.com/D126924
2021-12-22 00:46:24 +00:00
Makoto Kato
50557c9458 Bug 1746770 - "mach vendor rust" fails when crate has the directory name that uses space character. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D134241
2021-12-21 01:26:21 +00:00
Mitchell Hentges
77c1f6c6e9 Bug 1746325: Defer/avoid creation of scoped state dir for command sites r=ahal
In CI, we sometimes don't have permissions to create a scoped state dir.
Additionally, the current behaviour for resolving the path to a scoped
state dir will also attempt to create it if it doesn't exist.

There's likely a more eloquent solution, but the short-term fix is to
have sites defer the resolution of the state dir until they _know_ they
need it.

Differential Revision: https://phabricator.services.mozilla.com/D134066
2021-12-20 17:26:17 +00:00