Commit graph

7952 commits

Author SHA1 Message Date
Mike Hommey
45696b71c9 Bug 1774059 - Try harder to find an appropriate macos SDK. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D149186
2022-06-14 04:32:29 +00:00
Mike Hommey
1527794ac9 Bug 1773642 - Adjust openbsd webrtc config after bug 1661450. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D148891
2022-06-14 04:19:03 +00:00
Marian-Vasile Laza
8d68418a04 Backed out 4 changesets (bug 1769405) for causing regression in Bug 1774100. CLOSED TREE
Backed out changeset 813147df341c (bug 1769405)
Backed out changeset 6de9495c467d (bug 1769405)
Backed out changeset 9099ba749b1f (bug 1769405)
Backed out changeset 5f8e0141a0ed (bug 1769405)
2022-06-14 01:36:48 +03:00
Stephen A Pohl
d777cdbc58 Bug 1696513: Require macOS 11 SDK at configure time and update docs. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D148933
2022-06-13 17:44:51 +00:00
criss
537f7f6e84 Backed out changeset e186162443a6 (bug 1696513) for causing bustages. CLOSED TREE 2022-06-11 05:31:53 +03:00
Stephen A Pohl
b40f4b0786 Bug 1696513: Require macOS 11 SDK at configure time and update docs. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D148933
2022-06-11 01:05:31 +00:00
Tooru Fujisawa
8c499b6eb5 Bug 1769405 - Part 4: Detect mismatch between the default mozconfig and the selected build target. r=firefox-build-system-reviewers,glandium
When `./mach bootstrap` is called with the default mozconfig file,
verify the content matches the selected build target, and if not,
show a warning and ask whether to overwrite or not.

Differential Revision: https://phabricator.services.mozilla.com/D146384
2022-06-10 19:17:00 +00:00
Tooru Fujisawa
c9df923ba2 Bug 1769405 - Part 3: Return project and artifact-builds options from MozbuildObject.get_base_mozconfig_info. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D147012
2022-06-10 19:16:59 +00:00
Tooru Fujisawa
7dd33d0a6e Bug 1769405 - Part 2: Rename mozconfig_and_target to base_mozconfig_info and return dictionary. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D147272
2022-06-10 19:16:59 +00:00
Bobby Holley
5bdca3b88c Bug 1773592 - Pass --frozen to cargo-vet in CI. r=glandium
This is the new flag to ensure we don't hit the network.

Differential Revision: https://phabricator.services.mozilla.com/D148869
2022-06-10 02:11:07 +00:00
Dave Townsend
39c666e393 Bug 1772808: Install minidump-stackwalk binaries on arm64 macOS. r=glandium DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D148636
2022-06-09 08:54:22 +00:00
Mike Hommey
d889ccf504 Bug 1773189 - Reject windows and windows-sys crates when vendoring for now. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D148586
2022-06-08 22:41:53 +00:00
Bobby Holley
fed6fb8901 Bug 1773320 - Tweak error message displayed when cargo vet fails. r=glandium DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D148665
2022-06-08 22:41:06 +00:00
ahochheiden
dd6a7c90d3 Bug 1761849 - Consistently apply os.path.normpath to paths that end up in the same list r=firefox-build-system-reviewers,glandium
Depends on D148177

Differential Revision: https://phabricator.services.mozilla.com/D148204
2022-06-08 16:11:17 +00:00
Gabriele Svelto
1b76ade349 Bug 1773028 - Install watchman in all Linux & BSD variants that have it in the default package repository r=andi
Differential Revision: https://phabricator.services.mozilla.com/D148635
2022-06-08 11:02:11 +00:00
Mike Hommey
e94670dcc6 Bug 1773222 - Speed up gn config filtering. r=firefox-build-system-reviewers,andi
This brings down the operation from 12s to 8ms on my machine. Yes,
that's seconds versus milliseconds.

Differential Revision: https://phabricator.services.mozilla.com/D148624
2022-06-08 08:49:06 +00:00
Mike Hommey
2427ce6b93 Bug 1773187 - Turn cargo vet failures into errors instead of warnings. r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D148580
2022-06-08 01:55:31 +00:00
Norisz Fay
b86a9a0782 Bug 1772036 - Fix python3 failures r=fix CLOSED TREE 2022-06-08 00:14:22 +03:00
Mike Hommey
6aed0d9685 Bug 1772459 - Ignore --help after -- in mach subcommand invocations. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D148229
2022-06-07 20:39:09 +00:00
Mike Hommey
96ebf0ece8 Bug 1772036 - Enable cargo vet when running mach vendor rust locally. r=firefox-build-system-reviewers,ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D148219
2022-06-07 20:37:12 +00:00
Mike Hommey
662b0ed7ec Bug 1772036 - Add a mach cargo vet command. r=firefox-build-system-reviewers,ahochheiden
The cargo-vet toolchain is auto-bootstrapped and setup for things to
work properly. We modify `mach vendor rust` to invoke `mach cargo vet`
instead of doing its own setup, but in a underhanded way to work around
bug 1772453.

Differential Revision: https://phabricator.services.mozilla.com/D148218
2022-06-07 20:37:11 +00:00
Mike Hommey
037099a13b Bug 1772036 - Avoid "configure" output from the bootstrap sandbox when using bootstrap_toolchain. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D148217
2022-06-07 20:37:11 +00:00
Mike Hommey
4956da1564 Bug 1772036 - Move toolchain bootstrapping code to some shared module. r=firefox-build-system-reviewers,ahochheiden
We're going to use it to auto-bootstrap cargo-vet in the upcoming `mach
cargo vet` command.

Differential Revision: https://phabricator.services.mozilla.com/D148216
2022-06-07 20:37:11 +00:00
Mike Hommey
1d1d4cc62a Bug 1772980 - Check for unused crates in build/rust. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D148473
2022-06-07 20:34:35 +00:00
Jeff Muizelaar
8f41fc26fe Bug 1772955 - Remove broken ns[Int]Region lldb pretty printers. r=mstange
These were broken with Bas's region rewrite. They seem to just
pretty 'empty' now which is less useful than not having a pretty
printer at all.

Differential Revision: https://phabricator.services.mozilla.com/D148459
2022-06-07 17:16:04 +00:00
Jan-Erik Rediger
8182bee632 Bug 1768834 - Switch to Glean with UniFFI integration r=glandium,chutten
Upgrades to Glean v50.0.1, which comes with a rewritten core and
UniFFI-powered bindings.
Glean has some API changes, so we swap it over to that. Mostly mechanical changes.
Also upgrades to inherent v1.0 in fog.
This matches what Glean uses internally and gets rid of one duplicated crate.

Also upgrades to glean-parser==6.0.1

One crate duplication now (change in `python/mozbuild/mozbuild/vendor/vendor_rust.py` required).
Some new crates now vendored.
These are transitive dependencies of Glean dependencies, all with valid
licenses and already used in other products (mobile).

Differential Revision: https://phabricator.services.mozilla.com/D146062
2022-06-07 12:37:20 +00:00
Mike Hommey
57c2d48e4f Bug 1772960 - Upgrade geckodriver to base64 0.13. r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D148460
2022-06-07 09:26:16 +00:00
Geoff Lankow
28e851f616 Bug 1741360 - Fix Thunderbird artifact builds from comm-esr* trees. r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D147840
2022-06-02 23:09:56 +00:00
ahochheiden
6b662685df Bug 1766497 - Updated a log call to use command_context instead of self (since self would never work in this instance) r=firefox-build-system-reviewers,nalexander
Depends on D142274

Differential Revision: https://phabricator.services.mozilla.com/D148176
2022-06-02 22:15:40 +00:00
ahochheiden
606803ce1d Bug 1761849 - Added missing pathlib conversions in mach.util r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D142274
2022-06-02 22:16:39 +00:00
Nika Layzell
5caf4ef842 Bug 1743020 - Part 2: Vendor the function2 library, r=glandium,mhoye
The function2 library is a header-only library which provides support
for defining move-only function types, similar to the proposed
std::move_only_function in C++23, but with support for additional
customization.

This appears to be the first time we've vendored code using the boost
license, so I've added it to license.html and moz_yaml.py, and have
requested review to ensure it is OK to use code with this license.

Differential Revision: https://phabricator.services.mozilla.com/D145690
2022-06-02 13:24:10 +00:00
Mike Hommey
c88be1e316 Bug 1772035 - Hook cargo vet into rust vendoring lint. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D147821
2022-06-02 06:54:25 +00:00
Mike Hommey
0e3dacb973 Bug 1772043 - Allow duplicate crates when one depends on the other. r=firefox-build-system-reviewers,andi
In bug 1769902, we allowed such duplicate crates when one of them is
under build/rust. This changes the logic to be more generic and allow
a crate duplicate when it depends on a crate of the same name, whether
in build/rust or elsewhere, which could happen for vendored transitional
crates (rare, but happens). This is also a more generic way to handle
our situation with build/rust and doesn't rely on parsing Cargo.toml.

Differential Revision: https://phabricator.services.mozilla.com/D147824
2022-06-02 06:49:18 +00:00
Mike Hommey
b11cccf425 Bug 1771089 - Add a lint-like task to check rust vendoring. r=firefox-build-system-reviewers,linter-reviewers,marco,andi
This is deliberately simple. Future improvements will report if the
vendoring doesn't produce the same content as what's in the tree, and
attach errors to a better location than the first line of Cargo.lock.

Differential Revision: https://phabricator.services.mozilla.com/D147466
2022-06-02 06:42:02 +00:00
ahochheiden
964834abba Bug 1769631 - Remove 'U' from 'mode' parameters for various 'open' calls to ensure Python3.11 compatibility r=firefox-build-system-reviewers,glandium
The 'U' flag represents "universal newline". It has been deprecated
since Python3.3. Since then "universal newline" is the default when a
file is opened in text mode (not bytes). In Python3.11 using the 'U'
flag throws errors. There should be no harm in removing 'U' from 'open'
everywhere it is used, and doing allows the use of Python3.11.

For more reading see: https://docs.python.org/3.11/whatsnew/3.11.html#changes-in-the-python-api

Differential Revision: https://phabricator.services.mozilla.com/D147721
2022-06-02 06:27:44 +00:00
Mike Hommey
46156fb100 Bug 1710421 - [webdriver] Update warp and hyper dependencies. r=mjf,webdriver-reviewers
At the same time, update mdns_service to socket2 0.4 to avoid a duplicate.

Differential Revision: https://phabricator.services.mozilla.com/D147479
2022-06-01 22:05:53 +00:00
Mike Hommey
709d91019f Bug 1710421 - [webdriver] Update time and cookie dependencies. r=webdriver-reviewers,glandium,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D147000
2022-06-01 22:05:53 +00:00
Butkovits Atila
923df44073 Bug 1760161 - lint fix. a=testonly. CLOSED TREE 2022-06-01 21:19:40 +03:00
Simon Farre
dbea53e911 Bug 1760161 - Enhance string & smartptr pretty printers. r=nalexander
Added two additional string types to be pretty printed by the string
pretty printer.

Added the children method to smartpr, which yields 1 child. Has
the added benefit of returning (name, gdb.Value) which can be used
from an IDE with support for Python in GDB.

Differential Revision: https://phabricator.services.mozilla.com/D141404
2022-06-01 17:23:45 +00:00
Marian-Vasile Laza
03a1ff18e4 Backed out 6 changesets (bug 1772068, bug 1710421) for causing multiple web-platform failures. CLOSED TREE
Backed out changeset 7dc183461431 (bug 1772068)
Backed out changeset 437682fe4871 (bug 1772068)
Backed out changeset 717912ea0672 (bug 1772068)
Backed out changeset 6790f990c322 (bug 1772068)
Backed out changeset 33831638ba99 (bug 1710421)
Backed out changeset b35aaa56fa54 (bug 1710421)
2022-06-01 15:01:10 +03:00
Mike Hommey
d50e4bf7f4 Bug 1710421 - [webdriver] Update warp and hyper dependencies. r=mjf,webdriver-reviewers
At the same time, update mdns_service to socket2 0.4 to avoid a duplicate.

Differential Revision: https://phabricator.services.mozilla.com/D147479
2022-06-01 09:57:13 +00:00
Mike Hommey
477fbb9ce7 Bug 1710421 - [webdriver] Update time and cookie dependencies. r=webdriver-reviewers,glandium,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D147000
2022-06-01 09:57:13 +00:00
Marian-Vasile Laza
5d7edc0d2e Backed out 2 changesets (bug 1710421) for causing web-platform failures on context.rs. CLOSED TREE
Backed out changeset bdd6f29ebeeb (bug 1710421)
Backed out changeset 1739da34411f (bug 1710421)
2022-06-01 10:34:41 +03:00
Mike Hommey
2bfc571ce5 Bug 1710421 - [webdriver] Update warp and hyper dependencies. r=mjf,webdriver-reviewers
At the same time, update mdns_service to socket2 0.4 to avoid a duplicate.

Differential Revision: https://phabricator.services.mozilla.com/D147479
2022-06-01 06:44:07 +00:00
Mike Hommey
2edc1ca2ed Bug 1710421 - [webdriver] Update time and cookie dependencies. r=webdriver-reviewers,glandium,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D147000
2022-06-01 06:44:06 +00:00
Mike Hommey
c84e4eef26 Bug 1770894 - Update style to uluru 3.0. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D147477
2022-05-31 22:05:05 +00:00
ahochheiden
c69126de73 Bug 1761849 - Removed 'ancestors' function and replaced the only use of it with a Pathlib equivalent r=firefox-build-system-reviewers,mhentges
While testing the change, I noticed that the old implementation also
considered the 'current' path as a part of all ancestors. As such, I
added an additional path component to the path that is immediately
discarded so that the behavior is consistent.

Differential Revision: https://phabricator.services.mozilla.com/D142273
2022-05-31 15:45:24 +00:00
Tom Ritter
823c091aa5 Bug 1770895: Support specifying a blocking bug r=jewilde
Differential Revision: https://phabricator.services.mozilla.com/D147214
2022-05-31 15:43:38 +00:00
ahochheiden
f2d180af99 Bug 1761849 - Removed 'samepath' function and replaced the only use of it with a Pathlib equivalent r=firefox-build-system-reviewers,mhentges
In test_base.py the backslashes had to be replaced with forward slashes,
otherwise the string isn't read properly from the mozconfig during the
test. This was always 'broken', but the test just happened to pass since
the old path comparison was naive.

Differential Revision: https://phabricator.services.mozilla.com/D142272
2022-05-31 03:38:25 +00:00
Mike Hommey
ea29d69603 Bug 1771089 - Report the vendor_rust.py path relative to topsrcdir. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D147461
2022-05-30 21:54:30 +00:00
Mike Hommey
4206e06896 Bug 1771089 - Fail more gracefully when cargo update/vendor fail during mach vendor rust. r=firefox-build-system-reviewers,ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D147458
2022-05-30 21:54:29 +00:00
Mike Hommey
2b5ef1f23c Bug 1771089 - Fix typo in extra dupes error message. r=firefox-build-system-reviewers,andi
and clarify we prefer avoiding dupes.

Differential Revision: https://phabricator.services.mozilla.com/D147406
2022-05-30 21:54:29 +00:00
Mike Hommey
7023f65280 Bug 1771089 - Make VendorRust.vendor return a bool rather than hard exit on error. r=firefox-build-system-reviewers,ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D147403
2022-05-30 21:54:29 +00:00
Mike Hommey
396566d4a1 Bug 1771089 - Error out with a message when cargo is missing. r=firefox-build-system-reviewers,ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D147402
2022-05-30 21:54:28 +00:00
Mike Hommey
a8a9285375 Bug 1771089 - Properly error out on license errors in mach vendor rust. r=firefox-build-system-reviewers,ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D147401
2022-05-30 21:54:28 +00:00
Mike Hommey
1b60385e51 Bug 1770894 - Update profiler-helper to object 0.28. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D147256
2022-05-30 21:37:36 +00:00
Mike Hommey
f686964c71 Bug 1770894 - Force update memmap2 to 0.3. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D147255
2022-05-30 21:37:35 +00:00
Mike Hommey
4d1c26ec5d Bug 1770894 - Update cert_storage to base64 0.13. r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D147254
2022-05-30 21:37:35 +00:00
Mike Hommey
f9d9d6369f Bug 1770894 - Force update itertools to 0.10. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D147249
2022-05-30 21:37:33 +00:00
Mike Hommey
8f5e659734 Bug 1770894 - Force update cfg-if to 1.0. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D147248
2022-05-30 21:37:32 +00:00
Cosmin Sabou
3419858c99 Backed out changeset 2ad8e52fa3e6 (bug 1761849) for causing python failures on test_objdir_mismatch. 2022-05-31 00:17:59 +03:00
ahochheiden
026134af4f Bug 1761849 - Removed 'samepath' function and replaced the only use of it with a Pathlib equivalent r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D142272
2022-05-30 19:46:22 +00:00
ahochheiden
c9ebd0b85d Bug 1770993 - Remove the .strip() from the MOZCONFIG_SUGGESTION_TEMPLATE so that a newline is output before the shell prompt r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D147485
2022-05-27 18:48:56 +00:00
ahochheiden
efa7c0d842 Bug 1770991 - Added an extra space and removed .strip() so that the spacing between the ./mach bootstrap choice prompt and the choice input matches textual conventions r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D147486
2022-05-27 18:48:23 +00:00
Nicklas Boman
0832272ff8 Bug 1767204 - NetBSD Bootstrapper r=firefox-build-system-reviewers,glandium,ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D145186
2022-05-26 20:49:45 +00:00
Bernard Igiri
23156ab69a Bug 1768881 - Created GeneratedFile method implementing HTML Fragment Preprocessor r=firefox-build-system-reviewers,glandium
Created GeneratedFile method implementing HTML Fragment Preprocessor.

Usage in a `moz.build` file will be as follows

```
GeneratedFile(
    "example.js",
    script="/python/mozbuild/mozbuild/action/html_fragment_preprocesor.py",
    entry_point="generate",
    inputs=["example_a.xml", "example_b.xml"],
)
```

Example XML files for testing are in `python/mozbuild/mozbuild/test/action/data/html_fragment_preprocesor/`

Differential Revision: https://phabricator.services.mozilla.com/D146255
2022-05-26 14:37:52 +00:00
ahochheiden
129e18dbac Bug 1771016 - Updated ./mach doctor to check for erroneously enabled Artifact Builds r=sheehan
Differential Revision: https://phabricator.services.mozilla.com/D147219
2022-05-25 18:10:31 +00:00
Raphael Ferrand
c50724ef05 Bug 907297 - improve UI resource_usage r=sylvestre DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D146999
2022-05-21 19:23:05 +00:00
Cosmin Sabou
839d232742 Backed out changeset 2ce131c8742e (bug 1768881) for causing python failures on test_html_fragment_preprocessor.py. CLOSED TREE 2022-05-21 22:12:48 +03:00
Bernard Igiri
e887386531 Bug 1768881 - Created GeneratedFile method implementing HTML Fragment Preprocessor r=firefox-build-system-reviewers,glandium
Created GeneratedFile method implementing HTML Fragment Preprocessor.

Usage in a `moz.build` file will be as follows

```
GeneratedFile(
    "example.js",
    script="/python/mozbuild/mozbuild/action/html_fragment_preprocesor.py",
    entry_point="generate",
    inputs=["example_a.xml", "example_b.xml"],
)
```

Example XML files for testing are in `python/mozbuild/mozbuild/test/action/data/html_fragment_preprocesor/`

Differential Revision: https://phabricator.services.mozilla.com/D146255
2022-05-21 18:41:28 +00:00
Tom Ritter
db68e7ce96 Bug 1769307: Add support for giving a test path to mach try fuzzy r=ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D146336
2022-05-20 19:25:47 +00:00
Barret Rennie
b245063a9c Bug 1769275 - Generate topsrcdir with correct casing on Windows in mozbuild r=firefox-build-system-reviewers,ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D146853
2022-05-19 22:10:19 +00:00
ahochheiden
b0f288a33c Bug 1769117 - Improved the ValueError for SourcePath by also specifying the invalid path in the error message itself. r=firefox-build-system-reviewers,whimboo,glandium
Differential Revision: https://phabricator.services.mozilla.com/D146498
2022-05-19 18:03:01 +00:00
Ryan VanderMeulen
27a77459c7 Bug 1769735 - Add packaging to the mozharness archive. r=aki
Differential Revision: https://phabricator.services.mozilla.com/D146732
2022-05-19 00:38:14 +00:00
Mike Hommey
83c74198fa Bug 1769902 - Allow duplicate crates in build/rust. r=firefox-build-system-reviewers,andi
We're going to add crates in build/rust that help reduce crate
duplication by providing older versions of crates based on newer ones,
which implies there would be at least 2 crates with the same name, one
of them being under build/rust. Allow that when vendoring.

Differential Revision: https://phabricator.services.mozilla.com/D146661
2022-05-18 21:04:31 +00:00
Nicholas Rishel
733aeed8d7 Bug 1744865 - Add breadcrumb to bootstrap build selection to tip off important information in the backscroll. r=ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D146642
2022-05-18 00:16:34 +00:00
Nicholas Rishel
08d020a47b Bug 1768078 - Simplify the warning in vendor_rust.py now that the fix in Cargo is stable. r=Gankra,glandium
Differential Revision: https://phabricator.services.mozilla.com/D145673
2022-05-18 00:15:22 +00:00
Mike Hommey
ad7af8cc29 Bug 1769680 - Use download.py instead of git cinnabar download. r=firefox-build-system-reviewers,andi
Future releases of git cinnabar may not have a "git cinnabar" command
running out of the box, and the future-proof way to download the
cinnabar helper is to use download.py.

Differential Revision: https://phabricator.services.mozilla.com/D146526
2022-05-17 08:40:56 +00:00
Ryan VanderMeulen
b1015d9c01 Bug 1766085 - Replace some uses of distutils.version with packaging.version. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D145806
2022-05-17 01:04:17 +00:00
Francesco Lodolo (:flod)
8247c7c0d8 Bug 1768502 - Add esr102 to cross-channel configuration, drop esr91, r=aki
Differential Revision: https://phabricator.services.mozilla.com/D146412
2022-05-16 16:55:45 +00:00
Rob Lemley
ac33bf8bc8 Bug 1766928 - Configure Taskgraph to support comm-esr102. r=releng-reviewers,ahal
Differential Revision: https://phabricator.services.mozilla.com/D145907
2022-05-16 16:13:57 +00:00
Gabriel Bustamante
b094ef5722 Bug 1766928 - Configure Taskgraph to support esr102 r=releng-reviewers,jcristau,gbrown,aki
Differential Revision: https://phabricator.services.mozilla.com/D145900
2022-05-16 16:13:57 +00:00
Molnar Sandor
74e42d0f2f Backed out 5 changesets (bug 1743020) for causing linux build bustages in function2.hpp CLOSED TREE
Backed out changeset cf237471cf75 (bug 1743020)
Backed out changeset 78eb51447ce5 (bug 1743020)
Backed out changeset c486f95d55ec (bug 1743020)
Backed out changeset c0abfda55404 (bug 1743020)
Backed out changeset 16be18ca73fb (bug 1743020)
2022-05-14 10:31:12 +03:00
Nika Layzell
2f30490823 Bug 1743020 - Part 2: Vendor the function2 library, r=glandium,mhoye
The function2 library is a header-only library which provides support
for defining move-only function types, similar to the proposed
std::move_only_function in C++23, but with support for additional
customization.

This appears to be the first time we've vendored code using the boost
license, so I've added it to license.html and moz_yaml.py, and have
requested review to ensure it is OK to use code with this license.

Differential Revision: https://phabricator.services.mozilla.com/D145690
2022-05-13 23:43:52 +00:00
criss
a6ee3f4082 Bug 1768658 - Fix lint failure,r=fix 2022-05-11 22:39:36 +03:00
Connor Sheehan
3ba41129d7 Bug 1768658: avoid returning None and add type hints to doctor.py r=ahochheiden DONTBUILD
The filesystem lastaccess check can return `None` on some platforms,
which is unexpected. Return a `DoctorCheck` indicating the check is
skipped instead.

The filesystem lastaccess check only accounts for possible values {0, 1},
when the spec returned by `fsutil` indicates 2 and 3 are also possible
values, mapped to "system managed" lastaccess. Account for these values
in the check.

Finding this bug is simple when adding type hints, since the function
with the bug will have the return type `Optional[DoctorCheck]` as
detected by the type checker, so add them as a ridealong.

Differential Revision: https://phabricator.services.mozilla.com/D145972
2022-05-11 18:41:17 +00:00
hanbowen
cde0295b47 Bug 1767023: Bootstrap support for this Linux distro not yet available: deepin. r=ahochheiden mach bootstrap is not working on deepin distro, which is a debian based os. this patch treat deepin as a DEBIAN_DISTRO, so mach could work correctly.
Differential Revision: https://phabricator.services.mozilla.com/D146083
2022-05-11 18:02:20 +00:00
Connor Sheehan
f8376594fe Bug 1768223: encoding subprocess output to utf-8 before use r=ahochheiden DONTBUILD
Since we don't encode the output, the resulting value is a `bytes`
and therefore using `"="` to split results in a `TypeError`.
Add a specified encoding to force a `str` and fix the exception.

Differential Revision: https://phabricator.services.mozilla.com/D145881
2022-05-09 18:46:43 +00:00
andrej
80d11774cc Bug 1767567 - Resolve WPT intermittent fail Issue r=perftest-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D145638
2022-05-06 13:34:28 +00:00
Ryan VanderMeulen
4f31deb6d4 Backed out changeset cadaa6aac4ce (bug 1767856) on a CLOSED TREE 2022-05-04 20:36:53 -04:00
Agi Sferro
1d37934c07 Bug 1767856 - Add emulator to android-packages.txt ON A CLOSED TREE r=gbrown,owlish,calu
We used to get this as a transitive dependency but we don't anymore so we need
to specify it explicitly.

Differential Revision: https://phabricator.services.mozilla.com/D145502
2022-05-04 19:28:21 +00:00
Narcis Beleuzu
4c1ccf6db3 Backed out changeset 6369b96a0162 (bug 1766497) for python failures on test_site_compatibility.py . CLOSED TREE 2022-05-05 01:38:18 +03:00
Mitchell Hentges
75adc8066f Bug 1766497: Mach: use venv instead of virtualenv . CLOSED TREE
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
andrej
23829f29b7 Bug 1766009 - Create WPT chrome job r=perftest-reviewers,sparky,davehunt
Differential Revision: https://phabricator.services.mozilla.com/D144444
2022-05-04 17:10:39 +00:00
Agi Sferro
dd404f43c7 Bug 1767856 - Add emulator to android-packages.txt. CLOSED TREE
We used to get this as a transitive dependency but we don't anymore so we need
to specify it explicitly.

Differential Revision: https://phabricator.services.mozilla.com/D145502
2022-05-04 19:19:15 +00:00
Norisz Fay
97b570a3d1 Backed out changeset 4b6378a06816 (bug 1766497) for causing docker images bustages CLOSED TREE 2022-05-04 17:50:36 +03:00
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