Commit Graph

7856 Commits

Author SHA1 Message Date
Mitchell Hentges
53c89c581f Bug 1766497: Mach: use venv instead of virtualenv r=ahal
Brew's Python 3.10 causes `virtualenv==20.7.2` to produce a wonky folder
structure (`$venv/opt/homebrew/lib/python3.10/site-packages`?).

This is likely fixed with newer `virtualenv`, but the simpler workaround
here is to use `venv` instead now that Python 3 is always used.

Adds `python3-venv` to docker image so that tests and debian-based tasks
can leverage it.

Differential Revision: https://phabricator.services.mozilla.com/D144872
2022-05-04 14:17:04 +00:00
Eemeli Aro
f449b8ac1d Bug 1507471 - Migrate messages from mozapps/extensions/extensions.properties to Fluent. r=Gijs,fluent-reviewers,robwu
Messages used by the `about:addons` page are migrated to `aboutAddons.ftl`.
Unused messages are dropped, as is the `get_string()` helper from `test/browser/head.js`.

Differential Revision: https://phabricator.services.mozilla.com/D131793
2022-05-04 12:12:49 +00:00
Tom Ritter
527680376d Bug 1767335: Fix mach vendor pattern replacement r=jewilde
Differential Revision: https://phabricator.services.mozilla.com/D145360
2022-05-03 19:09:12 +00:00
Mitchell Hentges
be8b9cb5ec Bug 1765361: Only resolve objdir from virtualenv if mozinfo not ancestor r=glandium
Virtualenv-based objdir detection doesn't work for instrumented builds,
as instrumentation-specific objdirs aren't created.

Resolve this by:
* Removing redundant cwd-based topsrcdir resolution - the
  `__file__`-based code path below covers this case.
* Only using virtualenv-based resolving if topsrcdir isn't resolved.
* Documenting that virtualenv-based resolution is problematic for
  instrumented builds.

Differential Revision: https://phabricator.services.mozilla.com/D144030
2022-05-03 13:40:15 +00:00
Max Vollmer
ed87c3414b Bug 1761456 - Add natvis file for Visual Studio projects and update debugging documentation r=mhentges,handyman DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D143183
2022-05-03 09:04:48 +00:00
Shane Hughes
d148fe50bc Bug 1762775 - Change download folder display in prefs UI. r=Gijs,fluent-reviewers,preferences-reviewers,desktop-theme-reviewers,dao,flod
The default download folder prefs are now counterintuitively used
whether browser.download.useDownloadDir is enabled or not, since we no
longer save downloads to the "temp" folder. But the display for these
prefs in about:preferences makes it seem as though the configured path
will not be used if the "Always ask..." option is selected. This patch
removes the radiogroup and replaces it with a checkbox, so that the
download folder path can be changed irrespective of useDownloadDir's
value (unless browser.download.dir is disabled by policy).

Differential Revision: https://phabricator.services.mozilla.com/D143555
2022-04-28 19:49:17 +00:00
Butkovits Atila
0755140382 Bug 1764659 - Lint fix. r=fix. CLOSED TREE 2022-04-27 23:30:54 +03:00
Tom Ritter
63ed48b5e1 Bug 1764659: Add wgpu bindings to Updatebot r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D143766
2022-04-27 20:09:38 +00:00
Andi
d7da2ecade Bug 1766262 - move clang-tidy arguments for clangd from cli to spcific file. r=marco
Differential Revision: https://phabricator.services.mozilla.com/D144577
2022-04-27 09:10:21 +00:00
Csoregi Natalia
aaaf27f5ab Backed out changeset f05729424f4d (bug 1765361) for mbu fails on test_lint.py. CLOSED TREE 2022-04-26 18:18:01 +03:00
Mitchell Hentges
89219ddfe9 Bug 1765361: Only resolve objdir from virtualenv if mozinfo not ancestor r=glandium
Virtualenv-based objdir detection doesn't work for instrumented builds,
as instrumentation-specific objdirs aren't created.

Resolve this by:
* Removing redundant cwd-based topsrcdir resolution - the
  `__file__`-based code path below covers this case.
* Only using virtualenv-based resolving if topsrcdir isn't resolved.
* Documenting that virtualenv-based resolution is problematic for
  instrumented builds.

Differential Revision: https://phabricator.services.mozilla.com/D144030
2022-04-26 13:32:48 +00:00
Mike Hommey
43a4b9f47f Bug 1762484 - Remove gcc from warning and flag function names. r=firefox-build-system-reviewers,mhentges
This is in preparation for those functions taking care of all platforms
and compilers.

Differential Revision: https://phabricator.services.mozilla.com/D144405
2022-04-25 22:21:31 +00:00
Mike Hommey
b229581b84 Bug 1762484 - Allow plain values instead of functions for depends()(). r=firefox-build-system-reviewers,mhentges
This allows to remove the requirement on "--help" for dependable(),
which avoids dependable() implying the execution of `when` when it's
within a `with only_when`.

Differential Revision: https://phabricator.services.mozilla.com/D144404
2022-04-25 22:21:29 +00:00
Alexandre Lissy
961ebf98e0 Bug 1766081 - Properly parse ccache 'never' timestamp r=mhentges
Differential Revision: https://phabricator.services.mozilla.com/D144610
2022-04-25 20:08:02 +00:00
Niklas Baumgardner
d315f5773e Bug 1654054 - Fluent migration for videocontrols. r=fluent-reviewers,mconley,flod
Depends on D139742

Differential Revision: https://phabricator.services.mozilla.com/D143622
2022-04-25 14:21:18 +00:00
Norisz Fay
88be59b607 Backed out 2 changesets (bug 1654054) for causing bc failures on browser_nimbusShowIconOnly.js
CLOSED TREE

Backed out changeset 2b6a67ada4d3 (bug 1654054)
Backed out changeset 2f9ad49eb131 (bug 1654054)
2022-04-21 22:53:22 +03:00
Niklas Baumgardner
b163e7d7a5 Bug 1654054 - Fluent migration for videocontrols. r=fluent-reviewers,mconley,flod
Depends on D139742

Differential Revision: https://phabricator.services.mozilla.com/D143622
2022-04-21 17:58:17 +00:00
Tom Ritter
dc43c03f13 Bug 1764976: Lint fix for moz_yaml. CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D144311
2022-04-21 15:56:54 +00:00
Tom Ritter
70219f856b Bug 1764976: Support an every N commits for updatebot task frequency r=jewilde
Additionally, support a combination of both every N weeks and M commits
requiring both to be satisfied.

Differential Revision: https://phabricator.services.mozilla.com/D143844
2022-04-21 15:11:56 +00:00
Tom Ritter
1ae362f6d2 Bug 1764813: Teach ./mach vendor yaml how to handle a rust yaml file r=jewilde
Differential Revision: https://phabricator.services.mozilla.com/D143765
2022-04-21 15:11:56 +00:00
Tom Ritter
3cc8351723 Bug 1764813: Rename a confusing variable in mach vendor r=jewilde
Differential Revision: https://phabricator.services.mozilla.com/D143764
2022-04-21 15:11:55 +00:00
Tom Ritter
580c2e33e7 Bug 1764813: Indicate if a project is a rust, python, or regular vendoring type r=jewilde
Differential Revision: https://phabricator.services.mozilla.com/D143763
2022-04-21 15:11:55 +00:00
Cristian Tuns
9f7f5dc7c8 Backed out 2 changesets (bug 1654054) for causing mochites failures on browser_nimbusMessageFirstTimePip.js CLOSED TREE
Backed out changeset 164e5a97cc41 (bug 1654054)
Backed out changeset dde97d800713 (bug 1654054)
2022-04-20 18:47:32 -04:00
Niklas Baumgardner
6bf30f3a8f Bug 1654054 - Fluent migration for videocontrols. r=fluent-reviewers,mconley,flod
Depends on D139742

Differential Revision: https://phabricator.services.mozilla.com/D143622
2022-04-20 21:22:45 +00:00
ganguin
e2f88e166b Bug 1661450 - 1/2 Make webrtc depend on MOZ_X11 r=ng
1. add the MOZ_X11 config flag in build/gn.mozbuild and set the gn_vars
accordingly.

2. create the new gn-config/mozconfig files and delete previous ones
dom/media/webrtc/third_party_build/gn-configs/**.mozconfig with
--enable-default-toolkit=cairo-gtk3-wayland-only for the non X11 version.
New toolkit nmae is required to force disable X11 detection as
cairo-gtk3-wayland will auto-detect X11 and make generate-gn-build-files.sh
fail.

3. Add the MOZ_X11 config flag in python/mozbuild/mozbuild/gn_processor.py

Then run
dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh

Differential Revision: https://phabricator.services.mozilla.com/D142904
2022-04-20 09:32:10 +00:00
Mike Hommey
2e1227e46b Bug 1765276 - Disable floating-point contraction. r=firefox-build-system-reviewers,andi
Until clang 14, the default was -ffp-contract=fast, but some reason
didn't really enable FP contraction in practice. GCC has the same
default, but does, in fact enable FP contraction*. This leads to more
inconsistencies in FP results between builds than would normally be
expected, and has an effect on e.g. fingerprinting resistance in fdlibm
trigonometric functions, or some other places (e.g. bug 1765436).

As far as the Firefox versions Mozilla ships are concerned, FP
contraction only really affects aarch64, but this change should in
practice make no difference with the current version of clang used (13),
and would preserve our now new default behavior with clang 14.

(*) We never noticed because we neither build with GCC for arm64 nor run
tests with GCC builds.

Differential Revision: https://phabricator.services.mozilla.com/D144136
2022-04-20 07:17:29 +00:00
Mike Hommey
6b078d7de3 Bug 1660745 - Update encoding_rs to 0.8.31 and packed_simd to 0.3.7. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D88002
2022-04-20 06:24:28 +00:00
Mitchell Hentges
47b796cd82 Bug 1763695: Move python-test poetry to ini "requirements" r=ahal
The `test_vendor.py` test needs access to `poetry` to make its
assertions. This requirement was previously satisfied by adding `poetry`
to the `python-test` site.

Unfortunately, this caused conflicts when running the `mozlint` tests,
as they use the ini "requirements" feature to install their
dependencies. Importantly, the `mozlint` dependencies aren't compatible
with the version of `poetry` we need.

Fortunately, this was a good reminder: since `poetry` is a test-specific
dependency, leverage the existing ini "requirements" feature as it
represents exactly that: the extra package dependencies of a specific
test.

Note that I had to doctor the `dataclass` line in
`vendor_requirements.txt` to include an environment marker, otherwise it
would fail to install with Python >= 3.7.

Differential Revision: https://phabricator.services.mozilla.com/D143376
2022-04-19 19:10:38 +00:00
Mitchell Hentges
d1eb9a0470 Bug 1764836: Mercurial update is now compatible with MozillaBuild 4.0 r=ahal
MozillaBuild 4.0 now uses `hg` with Python 3, so use Python 3's `pip`
accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D143921
2022-04-19 19:10:11 +00:00
criss
8d62d22b30 Backed out 10 changesets (bug 1661450) for causing build bustages on nsWindow.cpp. CLOSED TREE
Backed out changeset 2c41d82de0c5 (bug 1661450)
Backed out changeset 5f58fcd7ac0b (bug 1661450)
Backed out changeset 62e56a6dcd22 (bug 1661450)
Backed out changeset 4b422ffa729f (bug 1661450)
Backed out changeset 6ca4705772da (bug 1661450)
Backed out changeset 031a6313459f (bug 1661450)
Backed out changeset 06ddf05e97d6 (bug 1661450)
Backed out changeset 4388b1b9aafd (bug 1661450)
Backed out changeset 600f9fd09fa6 (bug 1661450)
Backed out changeset cc5e8efe3ebf (bug 1661450)
2022-04-19 12:25:14 +03:00
ganguin
d87231be26 Bug 1661450 - 1/2 Make webrtc depend on MOZ_X11 r=ng
1. add the MOZ_X11 config flag in build/gn.mozbuild and set the gn_vars
accordingly.

2. create the new gn-config/mozconfig files and delete previous ones
dom/media/webrtc/third_party_build/gn-configs/**.mozconfig with
--enable-default-toolkit=cairo-gtk3-wayland-only for the non X11 version.
New toolkit nmae is required to force disable X11 detection as
cairo-gtk3-wayland will auto-detect X11 and make generate-gn-build-files.sh
fail.

3. Add the MOZ_X11 config flag in python/mozbuild/mozbuild/gn_processor.py

Then run
dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh

Differential Revision: https://phabricator.services.mozilla.com/D142904
2022-04-19 08:35:29 +00:00
Tom Ritter
3c836a9f1c Bug 1764600: Create a script that can be used to test ./mach vendor changes r=jewilde
Differential Revision: https://phabricator.services.mozilla.com/D143633
2022-04-15 18:17:41 +00:00
Tom Ritter
5fde982e4e Bug 1763991: Allow ./mach vendor to patch libraries when the patches are in a separate directory r=jewilde
Differential Revision: https://phabricator.services.mozilla.com/D143630
2022-04-15 18:17:40 +00:00
Tom Ritter
cac3a77d97 Bug 1763991: Implement move-file update-action r=jewilde
Differential Revision: https://phabricator.services.mozilla.com/D143629
2022-04-15 18:17:40 +00:00
Tom Ritter
aae5d518f8 Bug 1762642: Add libopus to mach vendor r=kinetik,jewilde
This makes some ./mach vendor improvements needed:
 - Adds a replace-in-file-regex action
 - Allows you to skip copying the temporary extract directory
   so that a script can do it
 - Removes 'commit' from the look-in-moz.yaml-for-release match

Differential Revision: https://phabricator.services.mozilla.com/D142720
2022-04-15 18:17:39 +00:00
Tom Ritter
bac9cbf93c Bug 1762627: Condense logging statements r=jewilde
Differential Revision: https://phabricator.services.mozilla.com/D142711
2022-04-15 18:17:38 +00:00
Tom Ritter
d191cdd8bc Bug 1761335: If a version update does not modify any local files, bail r=jewilde
This change does a few things

 - Moves get_full_path from a function-local function to
   a class member
 - Makes yaml_file a class member so I don't need to pass
   it everywhere
 - Creates a new moz.yaml file directive 'generated'
 - Adds that directive to libdav1d
 - Detects if any files (other than generated ones) were
   modified by an update; and if not - do not update the
   moz.yaml. Exit with -2 so Updatebot can detect it.

Differential Revision: https://phabricator.services.mozilla.com/D141994
2022-04-15 18:17:38 +00:00
Chris H-C
9d7fd96da1 Bug 1764549 - Update Glean SDK to v44.1.1 r=TravisLong
Differential Revision: https://phabricator.services.mozilla.com/D143749
2022-04-14 20:35:08 +00:00
Mitchell Hentges
97b39cb317 Bug 1764711: Move boto3 to requirement file r=ahal
The `upload_geneated_sources.py` script needs `boto3`, but was:
* Running in CI with Mach having a site-packages-source of `None`
* Using the `common` site (which inherits Mach's site-packages-source)
* Installing `boto3` outside of the knowledge of the centralized
  dependency system.

Make a `upload-generated-sources` site, and move `boto3` to it.

Differential Revision: https://phabricator.services.mozilla.com/D143715
2022-04-14 18:00:30 +00:00
Mitchell Hentges
9cf588867c Bug 1764466: Fix perftest-test invocation of modern pytest r=perftest-reviewers,sparky
* There is no `--duration` argument, but there //is// `--durations`
* `pytest` behaves better when called via its main entry points (either
  `bin/pytest`, or `-m pytest`)

Differential Revision: https://phabricator.services.mozilla.com/D143609
2022-04-13 20:07:17 +00:00
Matthew Gaudet
f1ae8a3f13 Bug 1757241 - Remove special case handling for ReadableStream in WebIDL generator r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D143074
2022-04-13 18:57:49 +00:00
Mitchell Hentges
34599d4f60 Bug 1764534: Maintain site_packages_dir order r=emilio
De-duping with `set` causes order to no longer be maintained when the
items are distinct. Use the `OrderedDict` technique to de-dupe
consistently instead.

Differential Revision: https://phabricator.services.mozilla.com/D143604
2022-04-13 14:44:06 +00:00
Tom Ritter
41003c553b Bug 1761537: Use yaml BaseLoader instead of SafeLoader to ensure everything is a string r=jewilde
I believe this is safe because from what I've been able to find
SafeLoader is FullLoader but without the bad stuff that lets you
execute arbitrary python code.  We don't need (nor want) the more
comlpicated data types like 'dates' and 'numbers' so we can use
BaseLoader which does nothing except treat everything as a string.

Depends on D142125

Differential Revision: https://phabricator.services.mozilla.com/D142126
2022-04-13 14:03:46 +00:00
Tom Ritter
63cb2cc07b Bug 1761523: Remove empty directories before copying them in-tree r=jewilde
Depends on D142124

Differential Revision: https://phabricator.services.mozilla.com/D142125
2022-04-13 14:03:46 +00:00
Tom Ritter
438f955023 Bug 1761534: Fix prefix detection by checking if all files have the same prefix r=jewilde
Depends on D142122

Differential Revision: https://phabricator.services.mozilla.com/D142123
2022-04-13 14:03:45 +00:00
Tom Ritter
8386bf3064 Bug 1761524: Add an option to force a library to vendor r=jewilde
Depends on D142121

Differential Revision: https://phabricator.services.mozilla.com/D142122
2022-04-13 14:03:44 +00:00
Tom Ritter
ce4aff2cba Bug 1761525: Fix --patch-mode only in mach vendor r=jewilde
Differential Revision: https://phabricator.services.mozilla.com/D142121
2022-04-13 14:03:44 +00:00
Nicolas Chevobbe
5c8a5c6759 Bug 1763313 - [devtools] Migrate storage panel to Fluent. r=jdescottes,flod
Both the dtd and properties files strings are moved to the existing storage.ftl.
A migration file was added to keep the localized strings.

Some of the strings were migrated to a declarative approach, setting `data-l10n-id` and
`data-l10n-args` attributes on elements. But in other cases, this was not easily doable.
To accomodate with the asynchronicity of `formatValue`, we translate all the strings that
don't have dynamic parameters during the initialization of the panel, and store them in
a Map for easy retrieval.

We also took this opportunity to cleanup the strings key names and have them all prefixed
with `storage-*`. Some functions where refactored so it should be easier to search the
code for a specific l10n string.

Finally, the `table.headers.indexedDB.*` strings weren't migrated as they were never read
in the UI (they are referenced in `NON_L10N_STRINGS`, which bypass localization).

Differential Revision: https://phabricator.services.mozilla.com/D143012
2022-04-13 12:47:57 +00:00
Nicolas Chevobbe
abb6e53e32 Bug 1763312 - [devtools] Remove sourceeditor.dtd. r=jdescottes,flod.
It was only used in the style editor, so we migrate the existing string
to styleeditor.ftl.

Differential Revision: https://phabricator.services.mozilla.com/D143011
2022-04-13 12:47:57 +00:00
Kagami Sascha Rosylight
053dae1ade Bug 1635428 - Part 3: Remove excluded() from files.py r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D112287
2022-04-13 09:27:11 +00:00
Mike Hommey
8937b90c26 Bug 1289641 - Vendor the vsdownload script. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D143125
2022-04-12 22:52:53 +00:00
Mitchell Hentges
74386e9dba Bug 1763244: Write tests for site activation logic r=ahal
Verify that activating mach and command sites in various configurations
affects the `sys.path` accurately.
Also verify that the `sys.path` is correct between the "activated
process" and fresh processes spawned from created virtualenvs.

Finally, tweak existing path-management behaviour to be more consistent:
* Don't unnecessarily sort `pths` from requirement definitions - it's
  more consistent (and more dependable) to keep the provided order.
* Continue removing unwanted `venv` entries from the `sys.path`, but
  don't add them back (such as the `$prefix` entry)
* Always remove `venv` entries from the `sys.path` when the venv isn't
  being populated. Though this doesn't affect behaviour, it makes
  assertions easier and simplifies the runtime state a bit.

Differential Revision: https://phabricator.services.mozilla.com/D143201
2022-04-12 21:28:50 +00:00
Butkovits Atila
59ebe1ff72 Backed out 7 changesets (bug 1289641) for causing Python failures. CLOSED TREE
Backed out changeset 0c1cedebf915 (bug 1289641)
Backed out changeset 575732020bd2 (bug 1289641)
Backed out changeset 55b68a71e03a (bug 1289641)
Backed out changeset 0b16a05aa405 (bug 1289641)
Backed out changeset acbff13b91b3 (bug 1289641)
Backed out changeset 2645367da7cb (bug 1289641)
Backed out changeset 8b22a8ec44fe (bug 1289641)
2022-04-12 22:23:27 +03:00
Mitchell Hentges
15510f9f26 Bug 1761150: Mach should use fresh system python, don't inherit sys.path r=ahal
Previously, when using the system Python packages, Mach would reuse the
values already existing in the `sys.path`. This had two benefits:
1. We didn't have to do work to calculate which paths the "system
   Python" specifically referred to.
2. This allowed us to support nested Mach calls
   (such as `./mach --virtualenv psutil ./mach build`).

However, it came with its own headaches, specifically around "consistent
imports" and Python subprocesses, such as in the following example
1. Mach runs "using system Python"
2. The "build" site (for example) would be activated. The current
   `sys.path` is included in the virtualenv's `mach.pth` file so that
   subprocesses will have access to the same packages as the primary
   Mach process
3. //Something// adds something to the `sys.path`
4. The build virtualenv is redundantly re-activated (such as due to
   generic setup code for some module). Though we don't physically
   re-activate the virtualenv, we //do// check that it's up-to-date to
   validate assumptions - **and it's not!** It's missing the
   //something// that was added to the `sys.path`.
5. We can't re-create the build virtualenv because it's already active,
   so:
6. An error is raised so that unexpected out-of-date-ness doesn't fly
   under the radar.

-----

This patch solves this by calculating the "system Python" paths in a
deterministic way. Then, even when using the system Python, the Mach and
command sites use define themselves in a consistent way.

This means that we can't do `./mach --virtualenv <venv> ./mach ...` to
shares `venv`'s packages with the whole new Mach process. Fortunately,
this has been replaced with  moving such packages into the nested Mach
command's requirements  definition instead.

TL;DR: more consistent, less failures. 👍

-----

One more detail, this time around the `sys_path()` function:
Ideally, we could calculate the standard library paths *and* the
"system" paths with only one Python subprocess. Unfortunately,
that's not the case:
* If `-S` isn't provided, then it's tricky to separate the standard
  library paths from the system paths
* If `-S` is provided, then doing `site.getsitepackages()` in a
  virtualenv returns the *system* site packages, not the virtualenv's.

To work around this, we call the external python twice, and in
parallel. This allows resolving the information we need while avoiding
performance costs.

Differential Revision: https://phabricator.services.mozilla.com/D143200
2022-04-12 18:40:14 +00:00
Mike Hommey
bd90bf1f39 Bug 1289641 - Vendor the vsdownload script. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D143125
2022-04-11 23:00:08 +00:00
Joel Maher
11cbf894a4 Bug 1763478 - add isolated-process flag to mozinfo.json. r=whimboo,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D143091
2022-04-11 20:44:46 +00:00
Cosmin Sabou
c951f55e7b Backed out changeset cf0cdfc423d3 (bug 1763478) for causing wpt-medata failures. 2022-04-11 21:21:34 +03:00
Joel Maher
4cde22ea41 Bug 1763478 - add isolated-process flag to mozinfo.json. r=whimboo,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D143091
2022-04-11 16:36:21 +00:00
Botond Ballo
a5992fc88a Bug 1588396 - Add 'pureos' to DEBIAN_DISTROS. r=mhentges
Verified to work on Purism Librem running PureOS 10 (Byzantium).

Differential Revision: https://phabricator.services.mozilla.com/D143329
2022-04-11 15:01:30 +00:00
Jan-Erik Rediger
236b8d27b0 Bug 1763602 - Update to Glean v44.1.0. r=chutten
Differential Revision: https://phabricator.services.mozilla.com/D143162
2022-04-11 08:25:00 +00:00
Mitchell Hentges
09af1e78c9 Bug 1659593: Make ./mach vendor python cross-platform r=ahal
Use `poetry` instead of `pip-compile`, then leverage `pip` to assert
that there's no conflicts between environments.

This enables simplifying `requirements.in`, since `colorama` is now
automatically picked up, as vendoring is no longer linux-py3.6-specific.

`poetry==1.2.0a2` was chosen because it was the first version that would
include `pip`/`setuptools`/`wheel` in the `requirements.txt`, yet it was
also the last version that supports Python 3.6 (as still used in CI in
some spots).

Sorry about the `requirements.txt` noise, that's because poetry doesn't
sort hashes yet [1]. Fortunately, you can be confident in
`requirements.txt` changes by checking that this patch doesn't include
changes to vendored packages themselves (I'm including the results of a
`./mach vendor python`).

[1] https://github.com/python-poetry/poetry/issues/5408

Differential Revision: https://phabricator.services.mozilla.com/D142884
2022-04-07 18:00:28 +00:00
Jim Blandy
bc55cd9f9b Bug 1763305: Update minimum Rust version to >= 1.59.0 r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D143007
2022-04-07 00:34:01 +00:00
Mitchell Hentges
4aa5138fd9 Bug 1762050: Use original topobjdir for PGO build virtualenv r=glandium
The PGO-specific objdir is meant for the PGO build artifacts.
The python virtualenvs just exist for the host, so there's no need to
scope them. Besides, the existing virtualenv infrastructure doesn't know
how to distinguish between "main 'build' site" and "PGO 'build' site",
which is why it raised this "out-of-date" error.

Differential Revision: https://phabricator.services.mozilla.com/D142373
2022-04-06 12:33:47 +00:00
Mitchell Hentges
aa84828a6f Bug 1755515: symbols_archive.py should use zstandard directly r=ahal
It's no longer necessary to explicitly grab the system Python handle to
access its packages.

Differential Revision: https://phabricator.services.mozilla.com/D132081
2022-04-05 17:41:37 +00:00
Marian-Vasile Laza
9170f02778 Merge mozilla-central to autoland. a=merge CLOSED TREE 2022-04-04 19:08:34 -07:00
Marian-Vasile Laza
fbb1e8462a Backed out changeset aff0eb14d891 (bug 1755515) for causing symbol upload bustages. a=backout 2022-04-04 16:17:01 -07:00
Mitchell Hentges
6628cec10b Bug 1732795: Update pytest to 7.0.1 r=ahal
`4.6.6` was 3 years old. There's been many helpful features and
ergonomics improvements in the years since.

Differential Revision: https://phabricator.services.mozilla.com/D140679
2022-04-04 17:03:33 +00:00
Mitchell Hentges
c5ec5f3ef8 Bug 1755516: Simplify "site.py" handling of command site package source r=ahal
Now that we are gleaning a site packages source in a process-global way
(that is *not* conditional on the site that's being managed), we've
removed an edge case from occurring: the case where Mach would use
`SitePackagesSource.NONE`, but the command site would use
`SitePackagesSource.SYSTEM`. This would've occurred if none of Mach's
dependencies were found in the system Python, but instead once the
command site was initialized, one of *its* dependencies were located.

Since that can no longer happen:
* Command sites that don't populate their VENV will *always* use the
  same site packages source as Mach
* `pthfile` generation is simplified (the priority of the system paths
  is no longer variable)
* We no longer need to track `site_packages_source` in metadata, since
  we can use `mach_site_packages_source` instead.

While here, I moved the "`PIP_NETWORK_INSTALL_RESTRICTED_VIRTUALENVS`
sites shouldn't have `pypi_requirements`" check to a test, since there's
no need for it to happen at runtime.

Differential Revision: https://phabricator.services.mozilla.com/D140668
2022-04-04 15:27:08 +00:00
Mitchell Hentges
d130228d01 Bug 1755515: symbols_archive.py should use zstandard directly r=ahal
It's no longer necessary to explicitly grab the system Python handle to
access its packages.

Differential Revision: https://phabricator.services.mozilla.com/D132081
2022-04-04 14:50:53 +00:00
Mitchell Hentges
76bffc61c5 Bug 1755516: Remove "use system Python packages" inference r=ahal
Simplify Mach's decision-making in CI for where to find native Python
packages: unless `MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system` is
provided, always ignore system packages.

Removes optional dependency on system's `pip`, instead leaning on
vendored `pip` copy to see what package versions are installed.

Differential Revision: https://phabricator.services.mozilla.com/D140258
2022-04-04 13:26:53 +00:00
andrej
6cbd9c7da7 Bug 1741975 - Have WPT tests available in taskcluster r=perftest-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D140843
2022-04-01 16:59:17 +00:00
Tom Ritter
bff6a5c9a7 Bug 1761075: Update version.h for dav1d when vendoring r=jbauman,jewilde
Differential Revision: https://phabricator.services.mozilla.com/D141890
2022-04-01 16:45:42 +00:00
ahochheiden
3e352a03ed Bug 1762059 - Resolved an infinite loop by updating the control variable to be one directory up (as it was before the Pathlib changes) r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D142495
2022-03-30 19:16:00 +00:00
Alexandre Lissy
fbae530eb5 Bug 1761974 - Handle ccache 'Uncacheable/Unsupported code directive' r=mhentges
Differential Revision: https://phabricator.services.mozilla.com/D142335
2022-03-29 14:44:53 +00:00
Dan Minor
6553d6bd7f Bug 1757407 - Allow a third duplicated instance of tokio; r=firefox-build-system-reviewers,glandium
Unfortunately, the dependencies of l10nregistry-rs require tokio 1.0. This
allows this third duplicated instance. I think it makes more sense to try to
move the other uses in tree to a more modern version than to try to downgrade
the version of tokio required by l10nregistry-rs and dependencies.

Differential Revision: https://phabricator.services.mozilla.com/D139854
2022-03-25 20:39:44 +00:00
Eemeli Aro
6b9e2716f0 Bug 1732151 - Migrate dataReportingNotification strings to Fluent. r=preferences-reviewers,fluent-reviewers,flod
The dataReportingNotification is the last place where the .properties
vendorShortName is used. As notifications already support Fluent,
porting this to use Fluent as well seems pretty strqaightforward.

Differential Revision: https://phabricator.services.mozilla.com/D141860
2022-03-24 15:57:54 +00:00
Mitchell Hentges
f782dd8f45 Bug 1727819: Guard against command site -> another site activations r=ahal
The Mach site is asserted to be compatible with all command sites, but
command sites are deliberately //not// asserted to be compatible with
each other - they're //supposed// to have the flexibility of being
able to be incompatible.

Accordingly, let's fail loudly if code tries to activate from one
command site to another.

Note that, due to the Mach site being a superset of common, it's safe to
activate from "common" to "<other command site>". This is needed for
cases like `./mach python --virtualenv ...`.

This required updating the `mozproxy` tests, who would deliberately
activate the `common` site so they could call a `mozproxy` entry point
script. These tests were fixed by instead invoking `mozproxy` as a
module (`-m`) of the current `python-test` site.

Differential Revision: https://phabricator.services.mozilla.com/D141659
2022-03-24 14:27:49 +00:00
Mitchell Hentges
23cbe80fd0 Bug 1724274: Move virtualenv dependency manifests to python/virtualenvs r=ahal
This is needed for a few reasons:
* All mach commands can use virtualenvs, not just `build`-related
  commands, so the files don't make sense to be in `build/`.
* When locking is added, more files associated with virtualenvs will be
  added, and this will change will ease the related directory structure
  setup.
* This removes the need for a redundant "_virtualenv_packages" keyword
  as part of the manifest filenames.

Differential Revision: https://phabricator.services.mozilla.com/D140382
2022-03-24 14:04:34 +00:00
Tom Ritter
7a9646220a Bug 1761111: Correct the removal of files in the vendor directory r=jewilde
The intention is to remove all the files in the vendoring directory
(which may be the yaml directory or may not be) except those
specified in 'keep'.

However convert_patterns_to_paths expects a list of patterns, and
we were providing it with only one. This resulted in it iterating
over '**' as a string (one iteration for '*' and a second for '*')

This prevented it from traversing recursively. Turning it into a
list fixes it.

Depends on D141901

Differential Revision: https://phabricator.services.mozilla.com/D141902
2022-03-24 13:45:28 +00:00
Tom Ritter
c616ef091b Bug 1761111: Small typo and qualitity of life improvements r=jewilde
This creates a way to override the 'tracking: tag' mechnaism
of a moz.yaml file without having to edit it. Useful to
test a library update when there is no new tag available.

Differential Revision: https://phabricator.services.mozilla.com/D141901
2022-03-24 13:45:28 +00:00
Mitchell Hentges
f4d496e238 Bug 1759725: Mach: migrate from hosted Sentry to cloud-managed Sentry r=glob
Update DSN for reporting exceptions to the new Sentry instance, and
update CI job to create releases on the new Sentry as well.

Differential Revision: https://phabricator.services.mozilla.com/D141122
2022-03-23 15:55:44 +00:00
Mitchell Hentges
238c5f019d Bug 1760677: Remove virtualenv_packages.txt mock from test_vendor.py r=ahal
Since bug 1717104 changed `./mach vendor python` to no longer have a
manual virtualenv activation, we can remove the test mocking that
softly handled the activation.

Differential Revision: https://phabricator.services.mozilla.com/D141674
2022-03-23 14:50:47 +00:00
Mitchell Hentges
14386d0c7e Bug 1717104: Activate virtualenv before running command r=perftest-reviewers,ahal,AlexandruIonescu
All commands declaring a virtualenv will have them activated before the
command executes. Removes all now-redundant manual activations of
declared virtualenvs.

Commands that don't declare a virtualenv will still implicitly be
associated with the "common" virtualenv, but unlike explicit
virtualenv declarations it'll have to be activated manually, just
like it was before this patch.

To smooth the migration with existing usages, virtualenv activation
behaviour was changed slightly: if attempting to activate a new
virtualenv, but the source venv is already command venv, then raise an
exception. (In the future, we should improve testability of
virtualenv scaffolding logic so that tests can be added for this
sort of thing.) This did cause some issues with some tests, which
will be solved more cleanly with bug 1724273. In the meantime,
minimal modifications were made to failing tests to keep them green:
* `test_command_line.py` was activating the `common` virtualenv so
  that it could install `mozproxy`, and use its CLI. Instead, I
  modified the test to use `mozproxy` using the "module" interface
  (`python -m mozproxy ...`). At that point, `MozbuildObject` was
  unnecessary and usages were replaced with simpler variants.
* `test_vendor.py` needed its explicit `activate_virtualenv()` call
  patched out. It still needs to use a virtualenv's Python
  executable, but due to `sys.executable` now being kept up-to-date
  as of bug 1717051, it could be used directly.

Differential Revision: https://phabricator.services.mozilla.com/D122892
2022-03-23 14:50:45 +00:00
Mitchell Hentges
83f95f6c5d Bug 1723237: Move low-hanging fruit commands to centralized Python dep system r=ahal
Creates/updates virtualenvs for some mach commands, replacing
their ad-hoc usage of `install_pip_package()`, `pip install`,
and `sys.path` modifications.

Note: The `docs` virtualenv has `Sphinx==1.1.3` installed, even
though a more modern version of `Sphinx` is used when
`./mach doc` is run. This is ok for now, since `./mach doc` will
just install the newer `Sphinx` over top of the old one. Secondarily,
when we port `./mach doc` to use the centralized system, we'll
be incentivized to make the different `doc` commands use synchonized
versions of the same packages. Success!

Also, note that manual installation of `html5lib` and `requests`
isn't ported to the `wpt` site: this is because they're already
provided by the inherited Mach site.

Differential Revision: https://phabricator.services.mozilla.com/D122902
2022-03-22 20:49:42 +00:00
Mitchell Hentges
0a5464aef2 Bug 1759084: Print reason for site being out-of-date r=ahal
There are cases in CI where sites are being considered out-of-date,
despite the situation being unexpected - for example, the
"site out-of-date even though already activated" issue described in
this patch's associated bug.

Return a `reason` string from `_is_venv_up_to_date()`, and print it in
cases where a virtualenv being out-of-date is erroneous.

Differential Revision: https://phabricator.services.mozilla.com/D140855
2022-03-22 19:44:13 +00:00
Mitchell Hentges
338a1fa71c Bug 1759084: Tighten MachSiteManager API surface r=ahal
The Mach site management has been significantly simplified
in `mach_initialize.py`, so less of the `MachSiteManager`
API is used. Privatize such now-externally-unused functions,
and no longer return unneeded values.

Differential Revision: https://phabricator.services.mozilla.com/D140854
2022-03-22 19:44:12 +00:00
Mitchell Hentges
638f64a642 Bug 1760054: Add Set-ExecutionPolicy item to Windows Mach docs r=ahochheiden
By default, Windows clients are not allowed to run Powershell
scripts [1]. Since our way of understanding `./mach` in Powershell is to
have a `mach.ps1` script, we should have instructions for configuring
Windows to properly understand and invoke it.

`RemoteSigned` is a good default, because it maintains security, while
allowing "local scripts" (such as those from VCS) to run.

[1] https://docs.microsoft.com/en-ca/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.2

Differential Revision: https://phabricator.services.mozilla.com/D141400
2022-03-22 16:43:59 +00:00
Cristian Tuns
1f61733417 Backed out 3 changesets (bug 1759084) for causing symbol bustages a=backout
Backed out changeset 412197c555c6 (bug 1759084)
Backed out changeset 5f18914637a3 (bug 1759084)
Backed out changeset 13aef63ad6a5 (bug 1759084)
2022-03-22 01:18:47 -04:00
Mitchell Hentges
a822813370 Bug 1759084: Print reason for site being out-of-date r=ahal
There are cases in CI where sites are being considered out-of-date,
despite the situation being unexpected - for example, the
"site out-of-date even though already activated" issue described in
this patch's associated bug.

Return a `reason` string from `_is_venv_up_to_date()`, and print it in
cases where a virtualenv being out-of-date is erroneous.

Differential Revision: https://phabricator.services.mozilla.com/D140855
2022-03-21 21:08:23 +00:00
Mitchell Hentges
25ca8bd87b Bug 1759084: Tighten MachSiteManager API surface r=ahal
The Mach site management has been significantly simplified
in `mach_initialize.py`, so less of the `MachSiteManager`
API is used. Privatize such now-externally-unused functions,
and no longer return unneeded values.

Differential Revision: https://phabricator.services.mozilla.com/D140854
2022-03-21 21:08:22 +00:00
Mitchell Hentges
9653ddb59b Bug 1759329: Properly exclude Brew's site-packages when using Mach venv r=ahal
Previously, when trying to determine the minimal `sys.path` that just
includes the standard library (but no `pip`-installed packages), we
would resolve the `sys.path` and remove the system and user
site-packages. However, this "removal" step didn't work as-is for
`brew`'s Python, because its "system site-packages" is //different//
from its `site.getsitepackages()`.

Stepping back though, there's an easier solution: run `python` with the
`-S` flag, and no "site" paths or custom initialization logic will add
anything extra to the stdlib.

Differential Revision: https://phabricator.services.mozilla.com/D141508
2022-03-21 20:24:33 +00:00
Eemeli Aro
c3af76718f Bug 1745905 - Drop extraneous convert_xul_to_fluent script. r=jaws
The in-tree copy of the XUL+DTD -> Fluent migration script was added in bug 1517528.
The original [0] has been refactored and updated since then, while the copy
here has not been maintained. It should be removed to clarify the situation.

Firefox source docs [1] were updated for Bug 1596726 to include a link to the
original script.

[0]: https://github.com/zbraniecki/convert_xul_to_fluent
[1]: https://firefox-source-docs.mozilla.org/l10n/migrations/legacy.html

Differential Revision: https://phabricator.services.mozilla.com/D133886
2022-03-18 14:36:54 +00:00
Mitchell Hentges
ff4cd170f7 Bug 1759193: Remove workaround for handling local/ in venv paths r=ahal
Now that we're using `sysconfig` instead of `distutils`, our `purelib`
and `platlib` paths should correctly point to python environment paths
without a spurious `local/` component at their roots.

Differential Revision: https://phabricator.services.mozilla.com/D140871
2022-03-16 17:11:23 +00:00
Mitchell Hentges
40e9f7a3d6 Bug 1759585: Avoid hang in ./mach configure r=firefox-build-system-reviewers,nalexander
Depending on the subprocesses created (such as if
`--with-ccache=sccache` is set), `./mach configure` may hang.

More details about why this is is documented in bug 1753797.

The workaround is to lean on the standard library to stream-and-format
output, rather than our existing `ProcessHandler` code.

Though this still streams both `stdout` and `stderr` in real-time, I saw
some ordering differences between the two streams locally. I don't yet
have a reason to believe that these differences are harmful or otherwise
incorrect.

Differential Revision: https://phabricator.services.mozilla.com/D141028
2022-03-16 16:32:25 +00:00
Mitchell Hentges
e9b6ee396c Bug 1759125: Venv site-packages should include both purelib and platlib r=ahochheiden
On newer systems, Python is intelligently populating pure-python and
platform-specific packages into //two different directories//.
Traditionally, these directories would be symlinked - or only one would
exist. However, to support these newer systems (and be better integrated
with Python conventions), we should handle both of these directories
properly.

The solution here is, when calculating the `site_packages_dir()`,
calculate all of them, and handle the multitude at all call sites.
The one use case where we want only one path (the resolving the location
for the `mach.pth` pthfile), I've opted for the `platlib`, since both
pure python dependencies //and// platform-specific dependencies are
referenced by the pthfile.

Differential Revision: https://phabricator.services.mozilla.com/D140870
2022-03-14 20:51:23 +00:00
Mitchell Hentges
8d217e06a3 Bug 1756047: When creating Mach venv in CI, put it in $WORKSPACE r=ahal
I'm guessing that the reason we haven't been building the Mach
virtualenv in CI so far is because:
* The default location in `~/.mozbuild` may not be cleared between jobs
* There's a performance cost to `pip install`-ing packages, especially
  if they're not needed
* In the past, it was tricky to have some jobs use a Mach virtualenv and
  others not.

This led to weird workarounds where a virtualenv would be created,
populated, then masqueraded as the "system Python" so that Mach would
be able to run with access to its dependencies without needing to
"create a Mach virtualenv".

This patch addresses the first point about the Mach virtualenv location:
In CI, if `WORKSPACE` is set, the Mach venv will be created in
`$WORKSPACE/mach_virtualenv`.
The other two points are solved by explicit configuration using the
`MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE` environment variable.

Differential Revision: https://phabricator.services.mozilla.com/D140256
2022-03-10 20:41:54 +00:00
Mitchell Hentges
98bdea23c9 Bug 1755516: Add "common" to PIP_NETWORK_INSTALL_RESTRICTED_VIRTUALENVS r=ahal
There are cases in CI where we're using the system Python, but we
still want to create a virtualenv. For example, build jobs use the
system Python packages, but Mozharness wants to have access to Mach
packages. So, a virtualenv needs to be created (the `"common"`
virtualenv), whose associated `python` binary is used to invoke
Mozharness.

So, just like for the `build` site, allow creating the `common`
site even when the "native package source" is the system Python.

Since `mach_virtualenv_requirements.txt` already depends on
`common_virtualenv_requirements.txt`, this restriction should not cause
validation breakage.

Differential Revision: https://phabricator.services.mozilla.com/D140255
2022-03-10 20:41:54 +00:00
Mitchell Hentges
70e8dc46bd Bug 1755516: Expose config variable for Mach native dependency source r=ahal
Adds support and documentation for the
`MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE` environment variable.

The "fallback" behaviour here should be backwards-compatible, which will
enable us to piece-by-piece explicitly use the `"system"` where
needed, then remove the backwards-compatibility shim afterwards.

A restriction added by this change is that it's no longer possible to
have the combination of:
* Have Mach use the system Python, and
* Have the active command site do `pip install`.

This is because this case shouldn't be necessary (if `pip install` is
allowed, why use the system?) and will allow us to enforce that all
non-build command sites always use their lockfiles, when they're set up.

When referring to behaviour in CI, I've opted to only refer to the
upcoming behaviour (of `MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE="none"`)
because the current heuristic behaviour feels complex enough that it
should be understood by checking the code, rather than docs. Besides,
the heuristic will be removed pretty soon (right? ;)

Differential Revision: https://phabricator.services.mozilla.com/D138932
2022-03-10 20:41:54 +00:00
Iulian Moraru
98af6aa00f Backed out 3 changesets (bug 1756047, bug 1755516) for causing py3 failures. CLOSED TREE
Backed out changeset f0043e07ec5e (bug 1756047)
Backed out changeset 9fc187cb982e (bug 1755516)
Backed out changeset 5f956232e850 (bug 1755516)
2022-03-10 00:53:18 +02:00
Mitchell Hentges
e1e19f6e62 Bug 1756047: When creating Mach venv in CI, put it in $WORKSPACE r=ahal
I'm guessing that the reason we haven't been building the Mach
virtualenv in CI so far is because:
* The default location in `~/.mozbuild` may not be cleared between jobs
* There's a performance cost to `pip install`-ing packages, especially
  if they're not needed
* In the past, it was tricky to have some jobs use a Mach virtualenv and
  others not.

This led to weird workarounds where a virtualenv would be created,
populated, then masqueraded as the "system Python" so that Mach would
be able to run with access to its dependencies without needing to
"create a Mach virtualenv".

This patch addresses the first point about the Mach virtualenv location:
In CI, if `WORKSPACE` is set, the Mach venv will be created in
`$WORKSPACE/mach_virtualenv`.
The other two points are solved by explicit configuration using the
`MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE` environment variable.

Differential Revision: https://phabricator.services.mozilla.com/D140256
2022-03-09 22:19:13 +00:00
Mitchell Hentges
18645cf2ae Bug 1755516: Add "common" to PIP_NETWORK_INSTALL_RESTRICTED_VIRTUALENVS r=ahal
There are cases in CI where we're using the system Python, but we
still want to create a virtualenv. For example, build jobs use the
system Python packages, but Mozharness wants to have access to Mach
packages. So, a virtualenv needs to be created (the `"common"`
virtualenv), whose associated `python` binary is used to invoke
Mozharness.

So, just like for the `build` site, allow creating the `common`
site even when the "native package source" is the system Python.

Since `mach_virtualenv_requirements.txt` already depends on
`common_virtualenv_requirements.txt`, this restriction should not cause
validation breakage.

Differential Revision: https://phabricator.services.mozilla.com/D140255
2022-03-09 22:19:13 +00:00
Mitchell Hentges
253d3a9cd6 Bug 1755516: Expose config variable for Mach native dependency source r=ahal
Adds support and documentation for the
`MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE` environment variable.

The "fallback" behaviour here should be backwards-compatible, which will
enable us to piece-by-piece explicitly use the `"system"` where
needed, then remove the backwards-compatibility shim afterwards.

A restriction added by this change is that it's no longer possible to
have the combination of:
* Have Mach use the system Python, and
* Have the active command site do `pip install`.

This is because this case shouldn't be necessary (if `pip install` is
allowed, why use the system?) and will allow us to enforce that all
non-build command sites always use their lockfiles, when they're set up.

When referring to behaviour in CI, I've opted to only refer to the
upcoming behaviour (of `MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE="none"`)
because the current heuristic behaviour feels complex enough that it
should be understood by checking the code, rather than docs. Besides,
the heuristic will be removed pretty soon (right? ;)

Differential Revision: https://phabricator.services.mozilla.com/D138932
2022-03-09 22:19:12 +00:00
Mitchell Hentges
af1de54c49 Bug 1758584: Fix virtualenv-path scrubbing from command _pthfile_lines r=ahal
We want `_pthfile_lines()` to consistently and accurately represent a
virtualenv's `sys.path` modifications.

However, this becomes tricky when comparing expected `pthfile_lines`
//before// activating a virtualenv versus //afterwards//, especially
since Python implicitly adds some paths (such as the path to
`site-packages`).

The current solution made this scrubbing only happen if we were
`pip install`-ing into the site. Unfortunately, it //doesn't// work for
the "use system Python for the `build` site", because:
* Pre-activation result: `site-packages` isn't added, because we aren't
  using it
* Post-activation result, implicitly-added `site-packages` isn't
  scrubbed, because **scrubbing only happened for
  `SitePackagesSource.VENV`**

Stepping back, the solution here is:
* `pthfile_lines` only represents Mach modifications //on top// of
  implicit virtualenv behaviour: since `site-packages` is always added
  by default, it shouldn't be in our explicit `pthfile_lines`.
* The only time when implicit `sys.path` additions throws us off is when
  `SitePackagesSource.SYSTEM`: so, move the scrubbing to happen in that
  case instead.

Finally refactor the "conditional deprioritization" comment to be more
useful and more accurate: we've implemented the "nontrivial complexity"
of purging site-packages, and the other piece about nothing being
`pip install`-ed feels self-explanatory enough.

Differential Revision: https://phabricator.services.mozilla.com/D140580
2022-03-09 22:18:34 +00:00
Mitchell Hentges
9e039efcfa Bug 1758584: Add in-proc venv activation paths to the end of sys.path r=ahal
So far, we've been using `virtualenv`'s `activate_this.py` script.
However, unlike earlier expectations, it adds its `sys.path` additions
to the //front//, not the back! This breaks our prioritization
requirements, such as:
* When using any package from the system environment, import *all
  possible* packages from the system to avoid compatibility issues.
* Use vendored packages instead of virtualenv-installed packages
  wherever possible, because it more-closely matches developer
  expectations ("why is this package vendored if it's not used?")

Define an `activate_virtualenv()` function that replicates the logic
of `activate_this.py` [1], except for three differences:
* Don't modify `sys.real_prefix`, since it's a non-standard property of
  `sys`.
* Only add seen-with-`venv`-module paths to the `sys.path` (`$prefix`,
  `$prefix/.../$site_packages_dir`) - don't do the paths in-between.
* And, of course, append instead of prepend `sys.path` entries.

As an aside, this is one of the few remaining blockers from allowing
us to fully embrace `venv` instead of `virtualenv` - the last piece is
waiting on the fix for bug 1697833 to propagate.

[1]
https://github.com/pypa/virtualenv/blob/20.7.2/src/virtualenv/activation/python/activate_this.py

Differential Revision: https://phabricator.services.mozilla.com/D140579
2022-03-09 22:18:33 +00:00
Mitchell Hentges
264cb79386 Bug 1758584: Raise error if active site is out-of-date r=ahal
Unless either the site's requirements or its on-disk virtualenv
changes, it shouldn't become out-of-date.
This will also catch situations where sites are incorrectly
being marked out-of-date due to `sys.path` mismanagement.

Differential Revision: https://phabricator.services.mozilla.com/D140578
2022-03-09 22:18:33 +00:00
Mitchell Hentges
68aff032ed 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
andrej
950f616c3e Bug 1741971 - Add MozPerfTest Testing Section to WPT Layer r=perftest-reviewers,sparky
Depends on D133785

Differential Revision: https://phabricator.services.mozilla.com/D137459
2022-03-09 20:53:29 +00:00
andrej
c601667cc8 Bug 1741971 - Make MozPerfTest Layer to run WPT r=perftest-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D133785
2022-03-09 20:44:48 +00:00
Alexis Beingessner
ec10d290e7 Bug 1755602 - consistently use minidump-stackwalk instead of minidump_stackwalk. r=glandium
Inconsistency confuses some of our tools. As part of this, I:

* Updated some docs to point to rust-minidump
* Added a fallback to mozcrash.py to try both versions
* Make mozcrash.py use --brief output when the local mdsw is used
* Remove the renaming hack from build-minidump-stackwalk.sh

This isn't as simple as a sed because we still have breakpad in tree
for minidump-analyzer. I did my best to replace the right strings.

Differential Revision: https://phabricator.services.mozilla.com/D138971
2022-03-09 16:44:42 +00:00
Mitchell Hentges
2da98775fb Bug 1756224: Update MozlintParser docs about default paths r=ahal
Updates parser documentation to clarify that, if no `paths` are
provided, then only those discovered by `--outgoing` and `--workdir`
are linted.

Differential Revision: https://phabricator.services.mozilla.com/D139158
2022-03-09 15:52:48 +00:00
Mitchell Hentges
8c04017a04 Bug 1750632: ./mach lint should bootstrap clang-format r=ahal
Tie into `code_analysis`'s `get_clang_tools()` functionality to
intelligently bootstrap clang if it either doesn't exist or is
out-of-date.

This required exposing `command_context` to the linting logic, as it's
needed to call `artifact_toolchain(...)`.

Note that this means that the standalone `runcli.py` file won't be able
to support bootstrapping `clang-format`, or other linters that lean on
`command_context` in the future.

Finally, `substs.get("HOST_BIN_SUFFIX")` was replaced with a
windows-specific `binary += ".exe"`, because not all contexts where
the tests are run will have access to populated `substs` data.
Note that this worked before without the extension because it was
only used for starting a process, in which context Windows automatically
tries all `PATHEXT` options. Since we're now doing an `isfile()` check
(to enable more intelligent failure cases when `clang-format` doesn't
exist), we need the path to be fully correct.

Differential Revision: https://phabricator.services.mozilla.com/D137335
2022-03-04 19:39:32 +00:00
Nick Alexander
77ecd3dc6b Bug 1752630 - Use UNIX permissions in packaged omnijars and XPIs. r=glandium
This unifies the ZIP permissions in omnijars and internal XPIs
produced by the packager directly and those repacked by l10n
single-repacks.

Differential Revision: https://phabricator.services.mozilla.com/D137340
2022-03-04 16:52:45 +00:00
mvollmer
96c7648608 Bug 1755305 - Fix invalid mach command for Visual Studio clean target r=mhentges DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D139595
2022-03-03 14:17:59 +00:00
Mitchell Hentges
fc251d248b Bug 1710287: ./mach clang-format should update tools if out-of-date r=andi,marco
Before, clang tools would only be bootstrapped if they didn't exist.
Now, bootstrapping also occurs if the version doesn't meet requirements.

Differential Revision: https://phabricator.services.mozilla.com/D137331
2022-03-02 18:13:32 +00:00
Nick Alexander
38725ef570 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-03-02 17:43:49 +00:00
Nick Alexander
1288cd82fa 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-03-02 17:43:48 +00:00
Mitchell Hentges
1ba4a4ea2d Bug 1755562: Document Mach dependency management r=ahal
* Restructure "Using third-party Python packages" page to focus on the
 "Mach commands"/"adding a Python package" use case since that's why
 most people will be looking at these docs.
* Document the `<site>_virtualenv_packages.txt` behaviour and how it
  relates to a Mach command's definition.
* Simplify the information around using a non-PyPI index to reference
  the RelEng docs directly. It's a shame that the existing docs don't
  explain how to identify tasks that need to use the internal mirror,
  because I'm not sure either. There's existing cases of ad-hoc `pip`
  installs //not// using the mirror, but the pattern isn't clear to me.
* Remove the "specify hashes" information, since the centralized
  solution (will) automatically manage this internally.
  * Arguably, it's still beneficial instructions for ad-hoc
  `pip install` usages, but those are frowned upon today anyways - use
  the centralized solution!

Differential Revision: https://phabricator.services.mozilla.com/D138931
2022-03-02 15:51:30 +00:00
Nika Layzell
6f3de9dc9b Bug 1751948 - Part 3: Build IPDL sources within the directory they were declared, r=glandium
This change allows IPDL sources to respect FINAL_LIBRARY when building, which
is important for allowing us to build gtest-only IPDL_SOURCES files.

Differential Revision: https://phabricator.services.mozilla.com/D137167
2022-02-28 21:01:47 +00:00
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