Commit Graph

6544 Commits

Author SHA1 Message Date
Mitchell Hentges
d73b2e2be9 Bug 1670197: "Universal" python binaries shouldn't cause setup.py fails r=firefox-build-system-reviewers,rstewart
"distutils" builds packages to fit the architectures of the active
python.
However, the system Mac SDK doesn't always support all the same
architectures as the local Python binary.
To resolve this, we explicitly influence the build to only compile for
the specific architecture that the system runs on.

Assumes that "platform.machine()" will always line up with the "-arch"
flag of compilers.

Differential Revision: https://phabricator.services.mozilla.com/D96276
2020-11-09 18:00:58 +00:00
Mike Hommey
688e669eaf Bug 1675707 - Allow not to activate the virtualenv when running mach python. r=firefox-build-system-reviewers,mhentges
This allows PATH not to be altered such that `python` would resolve to
the virtualenv python.

Differential Revision: https://phabricator.services.mozilla.com/D96167
2020-11-06 21:53:56 +00:00
Mitchell Hentges
aadd76c48c Bug 1675306: Add mocks so Java-detection doesn't hit real file system r=firefox-build-system-reviewers,rstewart
Previously, configure checked for Java binaries using
"configure"-specific "which()" and environment-variable-getter
functions. When bug 1670264 changed Java detection to use logic shared
between "configure" and "bootstrap", more general "which()"
/environment-variable-getter functions were used.

The test used to work because the "configure"-specific functions
respect the mocked-out file system and environment variables.
This patch adjusts the test to add mocks so the more general logic
is redirected to respect the mocked data.

Differential Revision: https://phabricator.services.mozilla.com/D96189
2020-11-06 22:15:02 +00:00
Mike Hommey
03113b989f Bug 1675384 - Show an hexdump diff for non-UTF-8 text files that fail to unify. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D95978
2020-11-06 11:27:14 +00:00
Mike Hommey
e7bd434ff1 Bug 1675384 - Resurrect mac unification code. r=firefox-build-system-reviewers,mhentges
This adds back part of the code that was removed in bug 1339182,
reformats it with black, adjusts it to make flake8 happy, and converts
it to python 3.

This also adjusts the script after bug 1534003, which changed the
about:buildconfig page title.

Differential Revision: https://phabricator.services.mozilla.com/D95977
2020-11-06 08:58:08 +00:00
Ricky Stewart
3a5e389ce2 Bug 1675498 - Add more informative error message if a build environment is not found when running mach vendor rust r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D96266
2020-11-06 21:18:32 +00:00
Ricky Stewart
7860c29e4c Bug 1674923 - Pass down virtualenv_manager from mach lint down to linters r=ahal
Before, on Windows, this resulted in installing the package in the parent environment (not the `virtualenv`). We fix this by passing down the `virtualenv_manager` so linters can install packages they need using that object's helper methods.

Differential Revision: https://phabricator.services.mozilla.com/D95738
2020-11-06 20:51:16 +00:00
Mike Hommey
af94e85e8d Bug 1675675 - Only put mach_bootstrap paths in PYTHONPATH for mach python --no-virtualenv. r=firefox-build-system-reviewers,rstewart
With PYTHONPATH containing other directories, such as the python ones,
bad things can happen when the python script that is being run then
goes on to subprocess.Popen a python process for a different virtualenv,
or a different version, or whatever.

Differential Revision: https://phabricator.services.mozilla.com/D96155
2020-11-06 17:30:58 +00:00
Nick Alexander
f6dcf71170 Bug 1675338 - Allow arbitrary --app binaries to mach run. r=firefox-build-system-reviewers,mhentges
This is simply a convenient way to pass developer-focused options to a
Firefox binary.

Differential Revision: https://phabricator.services.mozilla.com/D95898
2020-11-04 19:41:33 +00:00
Mike Hommey
e252f66166 Bug 1533642 - Allow to run mach from outside the src or obj directories. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D95981
2020-11-05 14:54:40 +00:00
Mike Hommey
ead183252e Bug 1675437 - Avoid using iconv to create InfoPlist.strings. r=firefox-build-system-reviewers,mhentges
Since python creates little-endian utf-16 consistently whether
cross-compiling from Linux or compiling natively on macOS, we could
write a small script that essentially replaces iconv. On the other hand,
we're also doing some manual preprocessing on the InfoPlist.strings.in
files, and we might as well use the preprocessor for that.

So, we augment the preprocessor to allow an explicit output encoding
other than utf-8, and use the preprocessor instead of `sed | iconv`.

Differential Revision: https://phabricator.services.mozilla.com/D96013
2020-11-05 15:07:30 +00:00
Tarek Ziadé
83a9dd6f9f Bug 1667151 - add support for pre-compiled scipy/numpy r=sparky
This patch will make sure that we select the right
wheels for numpy and scipy when `--visualmetrics` is used,
so we don't need to compile them.

It also make sure we don't install all those packages
unless the environment wants to use visual metrics.

Differential Revision: https://phabricator.services.mozilla.com/D91740
2020-11-05 17:16:34 +00:00
Victor Porof
8c1171c7f8 Bug 1638977 - Convert 'mach prettier-format' to run with Python 3, r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D93350
2020-11-05 09:45:14 +00:00
Mitchell Hentges
0bf01c3c96 Bug 1670264: Validate detected Java directory to ensure it's a JDK r=nalexander
Also consolidates bootstrap and configure Java-detection logic so
there's less surprises.

Differential Revision: https://phabricator.services.mozilla.com/D94664
2020-11-03 23:32:43 +00:00
Ricky Stewart
e1e9ea0e63 Bug 1645423 - Sentry ignores errors caused by local changes r=mhentges
Here, "errors caused by local changes" means "errors whose stack traces contain a reference to a file that is in the set of files changed locally". This implementation is a trade-off:

1. This check will not catch issues caused transitively by changes to local files. For example, consider a function that has been updated and its return type changed in a backwards-incompatible way, whereas callers were not updated appropriately. This would likely manifest as a type error in the calling function after the callee has returned.

2. This check WILL catch issues that come from locally changed files where the cause of the error doesn't originate from those local changes. For example, consider a function that's been locally updated but is never called in the failing codepath; if an exception is thrown, it's not due to this local change, and we shouldn't filter it out.

There are conceivable improvements that we could apply to fix deficiency (1); for example, we could track imports recursively starting from the oldest frame in the stack trace and match on that set of imported files. Note this would not handle dynamic imports properly, and that this could exacerbate issue (2).

Issue (2) could conceivably be addressed by attempting to filter the actual local diffs down to changes that actually may be causing the error. This is difficult to do generally especially in light of Python's dynamism, but there mayb be conservative improvements that we could make in this space.

Overall, neither of the above caveats are deemed to be sufficiently concerning that this patch should be blocked as-is, and the current situation with our Sentry logs is unusable due to all the noise. This patch will probably have a substantial impact on that noise without incidentally filtering out too much signal.

Differential Revision: https://phabricator.services.mozilla.com/D95607
2020-11-03 19:22:51 +00:00
Rob Lemley
43c5c39cb5 Bug 1674398 - Follow-up: Correct base path and pattern for comm mozharness.zip. r=ahal
The original change was tested as working on try/try-c-c, but was done during
the window when bug 1673992 had been backed out on mozilla-central. As a result,
the mozharness.zip that was tested had the "mozharness/" top level directory and
everything worked.

Differential Revision: https://phabricator.services.mozilla.com/D95741
2020-11-03 18:15:36 +00:00
Andrew Halberstadt
1648140b33 Bug 1673874 - [mozlint] Add some verbose logging after calling a linter's setup function, r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D95082
2020-10-28 22:02:07 +00:00
Tarek Ziadé
6bc860d7cd Bug 1671330 - create a telemetry layer r=sparky
Differential Revision: https://phabricator.services.mozilla.com/D94809
2020-11-03 14:32:33 +00:00
Andi-Bogdan Postelnicu
e6d2e5c167 Bug 1671224 - make static-analysis check --outgoing cross-platform. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D95262
2020-11-02 17:47:21 +00:00
Rob Lemley
4fd6fbbc89 Bug 1674398 - test_archive.py changes for comm-central mozharness directory move. r=ahal
Moving comm-central's /mozharness directory to /testing/mozharness/configs so
that it is layed out the same as mozilla-central's. This also opens the door
for other possibilities such as /comm/testing/mozharness/scripts.

Differential Revision: https://phabricator.services.mozilla.com/D95373
2020-11-02 17:02:53 +00:00
Ricky Stewart
119ff36277 Bug 1674498 - Remove references to jarsigner from configure and delete the debug_sign_tool r=geckoview-reviewers,nalexander,snorp
This is no longer used by Android devs.

Differential Revision: https://phabricator.services.mozilla.com/D95417
2020-11-02 16:50:56 +00:00
Tarek Ziadé
8497b291c2 Bug 1673871 - fix test for win32 r=padenot
Fix test for win32

Differential Revision: https://phabricator.services.mozilla.com/D95267
2020-10-30 15:46:38 +00:00
Andrew Halberstadt
14d0784d5e Bug 1673992 - [taskgraph] Ensure we stop extracting mozharness.zip in the cwd r=bhearsum
Rather than putting a top-level "mozharness" directory in "mozharness.zip",
this puts the root of mozharness at the root of the archive. Then we extract
the archive into a "mozharness" directory. This way the path on disk ends up
being the same, but generic-worker won't attempt to modify the permissions of
files in the cwd.

Differential Revision: https://phabricator.services.mozilla.com/D95138
2020-10-30 13:32:01 +00:00
Greg Tatum
5054c8bf2a Bug 1674189 - Warn the user if their PYTHONPATH is set in mach bootstrap; r=rstewart DONTBUILD
This environment variable can cause the module resolution to break
and have unexpected behavior while running mach bootstrap.

Differential Revision: https://phabricator.services.mozilla.com/D95185
2020-10-30 09:28:05 +00:00
Gregory Mierzwinski
9ed7a7b8be Bug 1674243 - Check for colon when deciding between old/new metric format. r=tarek
Differential Revision: https://phabricator.services.mozilla.com/D95218
2020-10-29 23:39:08 +00:00
Razvan Maries
ba834e9f0e Backed out changeset e281605f0fd2 (bug 1673992) for Android wrench bustage. CLOSED TREE 2020-10-29 23:10:22 +02:00
Andrew Halberstadt
93710a04d5 Bug 1673992 - [taskgraph] Ensure we stop extracting mozharness.zip in the cwd r=bhearsum
Rather than putting a top-level "mozharness" directory in "mozharness.zip",
this puts the root of mozharness at the root of the archive. Then we extract
the archive into a "mozharness" directory. This way the path on disk ends up
being the same, but generic-worker won't attempt to modify the permissions of
files in the cwd.

Differential Revision: https://phabricator.services.mozilla.com/D95138
2020-10-29 17:30:56 +00:00
Ricky Stewart
fbe2b42f80 Bug 1673700 - Don't use double quotes around strings in definition of fork_interpose r=firefox-build-system-reviewers,glandium
The definition of `patch_main()` has behavior that kicks in only on Windows and for Python 2. Unfortunately, not all of our `mach` commands have been migrated to Python 3, so this still matters.

Bug 1654103 replaced the single-quoted strings in this function with double-quoted strings. This should be fine, except that we call into `multiprocessing.forking.main()` with some monkey-patching that is meant to fix a Windows-specific bug (see bug 1316140). We don't do any clever serialization or anything here and we end up just passing that source to `multiprocessing.forking.main()` which aggregates that source code [dumbly](https://github.com/python/cpython/blob/2.7/Lib/multiprocessing/forking.py#L259), wrapping everything in double-quotes again and passing it to `_subprocess.CreateProcess()`, which ends up failing if the source contains strings formatted with double quotes.

We could revert bug 1654103 and exempt this file from linting, but that is overkill given that this file otherwise contains useful stuff. Instead we move everything to another file, exempt that file from linting, and update `util.py` accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D94909
2020-10-29 15:47:14 +00:00
pbz
876cc64abb Bug 1565574 - Migrate protocol handler dialog strings to fluent. r=Gijs,flod
Differential Revision: https://phabricator.services.mozilla.com/D94150
2020-10-29 13:44:01 +00:00
Dorel Luca
cfaedde161 Backed out 6 changesets (bug 1565574) as per dev's request. CLOSED TREE
Backed out changeset fbe972f837d9 (bug 1565574)
Backed out changeset 2852c526acd6 (bug 1565574)
Backed out changeset fa731b373f42 (bug 1565574)
Backed out changeset c7ed89a9afc7 (bug 1565574)
Backed out changeset 3e87d1b83069 (bug 1565574)
Backed out changeset 93955bcbaf4b (bug 1565574)
2020-10-29 12:55:28 +02:00
pbz
db5f99b15c Bug 1565574 - Migrate protocol handler dialog strings to fluent. r=Gijs,flod
Differential Revision: https://phabricator.services.mozilla.com/D94150
2020-10-27 16:43:45 +00:00
Ricky Stewart
127255c31f Bug 1654084 - Log build project to telemetry r=firefox-build-system-reviewers,dmajor
Differential Revision: https://phabricator.services.mozilla.com/D94868
2020-10-27 18:08:49 +00:00
Ricky Stewart
e6c9007806 Bug 1655845 - Collect OS version information in mach telemetry r=firefox-build-system-reviewers,dmajor
We add new metrics `distro` and `distro_version`. Their meaning varies based on the actual OS:

1. For Linux, the pair will be the name of the distribution and the distribution's version (e.g. `ubuntu`/`20.04`);

2. for macOS, the pair will be the string `macos` and the macOS version (e.g. `10.15.7`); and

3. for Windows, the pair will be the string (`windows`, `MAJOR.MINOR.BUILD`);

4. and for all other OS'es, the first will be the value of `sys.platform`, and the version string will be empty.

Differential Revision: https://phabricator.services.mozilla.com/D94781
2020-10-27 20:35:17 +00:00
Aaron Klotz
c592bffdfb Bug 1650118: Part 6 - Update test harnesses; r=bc,sparky,perftest-reviewers,jgraham
e10s is no longer a GeckoView option, so I'd like to remove it from test
harnesses when possible.

Depends on D90934

Differential Revision: https://phabricator.services.mozilla.com/D91640
2020-10-27 18:16:30 +00:00
Razvan Maries
f3f6721caa Backed out 8 changesets (bug 1650118) for wpt failures on inside-dedicated-worker.html. CLOSED TREE
Backed out changeset ab6218dd84f5 (bug 1650118)
Backed out changeset a99d1aae6e2e (bug 1650118)
Backed out changeset ed357b8bb07e (bug 1650118)
Backed out changeset cd5155e732d9 (bug 1650118)
Backed out changeset 63cc752924f2 (bug 1650118)
Backed out changeset 7f0a281a399e (bug 1650118)
Backed out changeset 0fd77fef3c95 (bug 1650118)
Backed out changeset f397e86fd61e (bug 1650118)
2020-10-27 18:39:11 +02:00
Aaron Klotz
b7a9856e97 Bug 1650118: Part 6 - Update test harnesses; r=bc,sparky,perftest-reviewers,jgraham
e10s is no longer a GeckoView option, so I'd like to remove it from test
harnesses when possible.

Depends on D90934

Differential Revision: https://phabricator.services.mozilla.com/D91640
2020-10-27 11:41:28 +00:00
Ricky Stewart
210585edd2 Bug 1672023 - Remove excluded files from black.yml
These files were omitted from the original patch because reformatting them required some manual intervention in order to avoid breaking unit tests. Generally the `noqa` lines were already there and just needed to be moved from one line to another (due to the reformatting by `black`), but sometimes `black` saw fit to move a bunch of stuff all onto one line, requiring me to introduce new `noqa` lines.

Besides the autoformat by `black` and some manual fixups, this patch contains no other changes.

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94052

Depends on D94045
2020-10-26 18:21:44 +00:00
Ricky Stewart
02a7b4ebdf Bug 1654103: Standardize on Black for Python code in mozilla-central.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Mike Hommey
0de02ed0fb Bug 1672913 - Use the right arch for dsymutil -a for arm64 mac. r=firefox-build-system-reviewers,dmajor DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D94560
2020-10-23 11:57:36 +00:00
Mike Hommey
2bf535bb2b Bug 1672895 - Bootstrap nasm from toolchain artifacts on mac. r=firefox-build-system-reviewers,rstewart DONTBUILD
Rather than homebrew/macports.

Differential Revision: https://phabricator.services.mozilla.com/D94539
2020-10-23 13:54:18 +00:00
Mike Hommey
d4daba77e3 Bug 1672894 - Don't bootstrap autoconf 2.13. r=firefox-build-system-reviewers,rstewart DONTBUILD
We've vendored it in bug 1663863 so we don't need it installed on the
system anymore.

Differential Revision: https://phabricator.services.mozilla.com/D94538
2020-10-23 13:54:08 +00:00
Bogdan Tara
da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart
fe80718d67 Bug 1672023 - Remove excluded files from black.yml r=sylvestre,perftest-reviewers,geckoview-reviewers,agi
These files were omitted from the original patch because reformatting them required some manual intervention in order to avoid breaking unit tests. Generally the `noqa` lines were already there and just needed to be moved from one line to another (due to the reformatting by `black`), but sometimes `black` saw fit to move a bunch of stuff all onto one line, requiring me to introduce new `noqa` lines.

Besides the autoformat by `black` and some manual fixups, this patch contains no other changes.

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94052
2020-10-23 20:40:44 +00:00
Ricky Stewart
c0cea3b0fa Bug 1654103: Standardize on Black for Python code in mozilla-central. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Mitchell Hentges
398dcb4fff Bug 1669862: Errors in process_install_manifest show nicely on TH r=firefox-build-system-reviewers,rstewart
process_install_manifest now only prints the message (not the stack
trace) of ErrorMessage exceptions, and the error config has been updated
to consider such messages to have the "ERROR" severity.

Differential Revision: https://phabricator.services.mozilla.com/D93854
2020-10-23 15:38:18 +00:00
Myeongjun Go
27e4a2b691 Bug 1672207 - [perfdocs] Remove legacy code on build_test_description r=sparky,perftest-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D94127
2020-10-23 13:04:19 +00:00
Csoregi Natalia
4bcb7f8c6d Bug 1672838 - Fix linting issue. r=fix CLOSED TREE 2020-10-23 01:00:16 +03:00
Agi Sferro
c47a1c9361 Bug 1672838 - Add --enable-fission to |mach run| r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D94488
2020-10-22 21:39:14 +00:00
Mike Hommey
198ea0303d Bug 1671569 - Normalize Xcode clang version to the underlying plain clang version. r=firefox-build-system-reviewers,rstewart
We used to have a complicated scheme to figure out the minimum supported
version of clang on OSX, based on some compiler feature, which wouldn't
allow to do other version checks further down the line.

The main blocker for better tests was to be able to distinguish between
Xcode clang and plain clang, which turns out to be possible with the
__apple_build_version__ define.

We still need to map versions manually, but it's better than the current
status quo.

Differential Revision: https://phabricator.services.mozilla.com/D94261
2020-10-22 01:31:17 +00:00
Dorel Luca
1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00