Граф коммитов

6703 Коммитов

Автор SHA1 Сообщение Дата
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
Dorel Luca 26941cf2f5 Backed out changeset 94ec15429e21 (bug 1672023) for Backout conflicts with Bug 1654103. CLOSED TREE 2020-10-22 03:43:01 +03:00
Ricky Stewart 8b352f1843 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-21 21:29:30 +00:00
Ricky Stewart 50762dacab 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. 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-21 21:27:27 +00:00
Steve Fink 30dc736c88 Bug 1672506 - FailedCommandError does not have e.message field r=rstewart
Differential Revision: https://phabricator.services.mozilla.com/D94378
2020-10-21 21:22:14 +00:00
Francesco Lodolo (:flod) 8d308fac8c Bug 1672315 - Remove Fluent migration recipes for Firefox 79-82, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D94258
2020-10-21 13:01:15 +00:00
Razvan Maries 5e0d52e2cc Backed out 6 changesets (bug 1650118) as per Aaron's request. CLOSED TREE
Backed out changeset 4a7fc6398ad6 (bug 1650118)
Backed out changeset b9fa3dd9c05d (bug 1650118)
Backed out changeset 2cb9109dee0a (bug 1650118)
Backed out changeset a6ca38804021 (bug 1650118)
Backed out changeset 66b9527aecad (bug 1650118)
Backed out changeset 74fd3eb970a6 (bug 1650118)
2020-10-21 07:32:57 +03:00
Mike Hommey 54f6141287 Bug 1671424 - Move configure execution from client.mk to `mach configure`. r=firefox-build-system-reviewers,rstewart
`mach configure` currently runs the equivalent to `make -f client.mk`.
This is history, and essentially does the following:
- Create `configure` and `js/src/configure` from `configure.in` and
`js/src/configure.in` respectively.
- Create the objdir.
- Run `configure` from the objdir.

The `configure` script is, nowadays, only really used as a means to set
OLD_CONFIGURE (and also for people who want to run `configure`,
literally, as in the `configure; make` workflow). `mach configure`
actually doesn't need it. Neither does recursing into `js/src` require
`js/src/configure`, since bug 1520340 (and now as of bug 1669633, we
don't even recurse).

Because configure.py can actually derive OLD_CONFIGURE on its own
(except for `js/src/configure`, but `mach configure` doesn't run that),
we don't really need `configure` for `mach configure`.

So all in all, we're at a point in history where it's straightforward to
just initiate configure.py from mach configure, so we just do that.

And in the hypothetical case where the `mach configure` code is somehow
running in python2, we get the mach virtualenv python3 and use it to
execute `configure.py`.

Differential Revision: https://phabricator.services.mozilla.com/D93741
2020-10-20 20:41:52 +00:00
Tarek Ziadé ec120ea38c Bug 1615884 - Handle Windows separators correctly when calling clang-format -d on Windows, while allowing writing path with '/' on the command-line. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D93339
2020-10-19 12:33:50 +00:00
Marco Bonardo a3414a5108 Bug 1668284 - Unknown content type change settings label is no longer accurate. r=Gijs,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D94027
2020-10-20 12:34:45 +00:00
Mike Hommey 5afb69830c Bug 1670156 - Use the same prefix/suffix for rust libraries on mingw builds. r=firefox-build-system-reviewers,dmajor
Rustc >= 1.44 changed the file names of the static libraries it
produces with -windows-gnu targets, to match that of mingw clang/gcc.

Considering we still build on 1.43, the best fix would be to derive the
prefix/suffix based on the version of rust, but that actually turns into
a hard-to-solve problem because of configure tests for bindgen also
depending on the prefix/suffix value to be known.

On the other hand, we're soon due to an update to 1.47, so the simpler
solution is to just push mingw builds to require 1.44 (settling for the
smallest upgrade possible for now) and to remove the split between C and
rust library prefix/suffixes.

Differential Revision: https://phabricator.services.mozilla.com/D93726
2020-10-16 16:06:19 +00:00
Narcis Beleuzu 9252175982 Backed out changeset e34634758f51 (bug 1671424) for bustages on configure.py . CLOSED TREE 2020-10-20 00:16:22 +03:00
Aaron Klotz 1876a00d8b Bug 1650118: Part 6 - Update test harnesses; r=bc,sparky,perftest-reviewers
e10s is no longer a GeckoView option, so I'd like to remove it from test
harnesses when possible.

Differential Revision: https://phabricator.services.mozilla.com/D91640
2020-10-19 18:17:16 +00:00
Mike Hommey fcd16177c6 Bug 1671424 - Move configure execution from client.mk to `mach configure`. r=firefox-build-system-reviewers,rstewart
`mach configure` currently runs the equivalent to `make -f client.mk`.
This is history, and essentially does the following:
- Create `configure` and `js/src/configure` from `configure.in` and
`js/src/configure.in` respectively.
- Create the objdir.
- Run `configure` from the objdir.

The `configure` script is, nowadays, only really used as a means to set
OLD_CONFIGURE (and also for people who want to run `configure`,
literally, as in the `configure; make` workflow). `mach configure`
actually doesn't need it. Neither does recursing into `js/src` require
`js/src/configure`, since bug 1520340 (and now as of bug 1669633, we
don't even recurse).

Because configure.py can actually derive OLD_CONFIGURE on its own
(except for `js/src/configure`, but `mach configure` doesn't run that),
we don't really need `configure` for `mach configure`.

So all in all, we're at a point in history where it's straightforward to
just initiate configure.py from mach configure, so we just do that.

And in the hypothetical case where the `mach configure` code is somehow
running in python2, we get the mach virtualenv python3 and use it to
execute `configure.py`.

Differential Revision: https://phabricator.services.mozilla.com/D93741
2020-10-19 16:24:34 +00:00
Myeongjun Go 10359c348a Bug 1663708 - [perfdocs] Find tests to add to documentation using manifests instead of path searching r=sparky,perftest-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D91703
2020-10-19 15:17:04 +00:00
Dave Townsend b313c5f808 Bug 1666035: Strip ccache compilation wrappers from the clangd compilation database. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D93533
2020-10-16 18:47:28 +00:00
Mitchell Hentges 5835177a65 Bug 1669934: Virtualenv should use the correct python packages r=firefox-build-system-reviewers,glandium
Due to the MacOS `__PYVENV_LAUNCHER__` environment variable, some
virtualenv operations were being run with the system python (and
packages), rather than the python and packages within the venv.

This was already partially solved by having `__PYVENV_LAUNCHER__`
get unset when some virtualenv operations were run.
This change makes this more consistent by unsetting the environment
variable once a `VirtualenvManager` is created.

Differential Revision: https://phabricator.services.mozilla.com/D93615
2020-10-16 16:14:22 +00:00
Tarek Ziadé f3c2b155b5 Bug 1670631 - browsertime keeps on reinstalling itself r=sparky
Let's use `_from` instead of `_resolved`

Differential Revision: https://phabricator.services.mozilla.com/D93629
2020-10-15 14:07:09 +00:00
Ricky Stewart 362abcf949 Bug 1670357 - Remove `make` targets for cleaning: `clean`, `realclean`, `clobber`, `distclean`, `clobber_all`, `everything` r=firefox-build-system-reviewers,mhentges
The `clobber` targets are superseded by `mach clobber`, so we don't need them for any reason. The `clean` target is meant to get you to a post-`configure` state, but it doesn't really work, and if it's necessary for you to be in that state for some reason you can just clobber and re-`configure`, so it doesn't seem worth it to get it working again. Instead, delete all of them. Also delete `everything` which is not useful when `clobber` doesn't exist.

Differential Revision: https://phabricator.services.mozilla.com/D93514
2020-10-15 20:37:18 +00:00
Dave Townsend e3c500eacb Bug 1671203: Auto-detect VSCode insiders build when the release build is not found. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D93532
2020-10-15 19:28:30 +00:00
Tarek Ziadé 616eb184b2 Bug 1670216 - Speed up tests. r=sparky
Shaved off 15 seconds (and fixed small code issues in the proxy layer)

Differential Revision: https://phabricator.services.mozilla.com/D93080
2020-10-14 19:31:51 +00:00
Andrew Halberstadt 7d1ba96692 Bug 1670385 - [mach] Move 'TestBase._run_mach' to a pytest fixture, r=firefox-build-system-reviewers,rstewart
I accidentally broke the 'mach' unittests on Python 2 due to some difference in the unittest
module. Rather than poking into 'unittest', this patch moves us closer to the pytest format
while also fixing the issue.

Differential Revision: https://phabricator.services.mozilla.com/D93420
2020-10-14 03:32:04 +00:00
Ricky Stewart 50597da87a Bug 1671016 - Improve error message when dirty files cause artifact builds or `mach bootstrap` to fail r=firefox-build-system-reviewers,mhentges
I try to increase the probability of this error message getting read and heeded by enumerating the list of changed files from the latest `central`, and printing them out.

Also, bug 1636797 I think renders unnecessary the advice to run `mach clobber python`, so I delete that suggestion.

Differential Revision: https://phabricator.services.mozilla.com/D93422
2020-10-13 20:51:15 +00:00
Ricky Stewart 30abdd148e Bug 1670977 - Remove errant spaces from expression `fpath+=~/.zfunc` in `zsh` `mach` autocompletion docs r=ahal DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D93423
2020-10-13 20:33:17 +00:00
Ricky Stewart d8915aa0c8 Bug 1670167 - Fix janky Python 3 logic in `configure` from bug 1656993 r=firefox-build-system-reviewers,glandium
The `try : import mozfile; except ImportError: ...` thing was completely broken since it unconditionally triggered [this exception](https://searchfox.org/mozilla-central/rev/165e8d8f80c02605c2f3e89c5de462abfce91c32/python/mozbuild/mozbuild/configure/__init__.py#248). The `MOZBUILD_VIRTUALENV` thing should work now, so just use that as a signal for whether we're already in the `virtualenv` instead.

Also delete some `PATH` munging in `building.py`, which I think should be unnecessary after we make the above change.

Differential Revision: https://phabricator.services.mozilla.com/D93138
2020-10-13 16:05:51 +00:00
Razvan Maries 580c003812 Backed out changeset 8f481c06bcd7 (bug 1670039) for Android build bustages. CLOSED TREE 2020-10-10 02:39:01 +03:00
Mike Hommey 6d61924d28 Bug 1670039 - Always call virtualenv with python -S. r=firefox-build-system-reviewers,perftest-reviewers,mhentges
It disables site modules from the caller python, which are irrelevant
anyways as virtualenv is self-contained.

Differential Revision: https://phabricator.services.mozilla.com/D93064
2020-10-09 15:39:22 +00:00
Mike Hommey 5a6250bf22 Bug 1670169 - Fix hack from bug 914563 when python gets more arguments somehow. r=firefox-build-system-reviewers,rstewart DONTBUILD
Some recent change apparently made the multiprocessing code reenter
python with the arguments `-s -c "..."` instead of `-c "..."`, which
broke the assumption of the hack.

Differential Revision: https://phabricator.services.mozilla.com/D93060
2020-10-09 14:27:28 +00:00
Mike Hommey cd2608386e Bug 1670168 - Fix configure lint error when a template uses an undefined variable. r=firefox-build-system-reviewers,rstewart DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D93057
2020-10-09 16:25:25 +00:00
Ricky Stewart be180789f3 Bug 1669332 - Add specific error message singling out `gecko-dev` if no `hg` revisions for the `git` repo can be found r=firefox-build-system-reviewers,mhentges,glandium
People keep using `gecko-dev` and trying to run artifact builds, although this very unsupported, and the existing error message is useless if you're not knowledgeable about how these systems work. Since this is the most common case where people come in with questions about artifact builds not working, try to detect this case and print a helpful error message.

Differential Revision: https://phabricator.services.mozilla.com/D92492
2020-10-09 16:40:07 +00:00
Andrew Halberstadt ef21656e00 Bug 1519990 - [mach] Add ability to generate completion scripts via 'mach mach-completion <shell>', r=mhentges
Supported shells are 'bash', 'zsh' and 'fish'. Here are installation
instructions with various shells and contexts:

### bash

    $ mach mach-completion bash -f _mach
    $ sudo mv _mach /etc/bash_completion.d

### bash (homebrew)

    $ mach mach-completion bash -f $(brew --prefix)/etc/bash_completion.d/mach.bash-completion

### zsh

    $ mkdir ~/.zfunc
    $ mach mach-completion zsh -f ~/.zfunc/_mach

then edit ~/.zshrc and add:

    fpath += ~/.zfunc
    autoload -U compinit && compinit

### zsh (oh-my-zsh)

    $ mkdir $ZSH/plugins/mach
    $ mach mach-completion zsh -f $ZSH/plugins/mach/_mach

then edit ~/.zshrc and add 'mach' to your enabled plugins:

    plugins(mach ...)

### zsh (prezto)

    $ mach mach-completion zsh -f ~/.zprezto/modules/completion/external/src/_mach

### fish

    $ ./mach mach-completion fish -f ~/.config/fish/completions/mach.fish

### fish (homebrew)

    $ ./mach mach-completion fish -f (brew --prefix)/share/fish/vendor_completions.d/mach.fish

Differential Revision: https://phabricator.services.mozilla.com/D90416
2020-10-09 16:03:30 +00:00
Andrew Halberstadt 1f357936b2 Bug 1519990 - [mach] Some light refactoring in commandinfo.py, r=mhentges
Differential Revision: https://phabricator.services.mozilla.com/D90415
2020-10-08 16:15:03 +00:00
Florin Strugariu c6a83dc1a4 Bug 1666264 - [Mozproxy] Implement a recording .zip file manager r=tarek,perftest-reviewers,AlexandruIonescu
Differential Revision: https://phabricator.services.mozilla.com/D90954
2020-10-09 12:32:26 +00:00
Sylvestre Ledru cad53f4804 Bug 1588458 - Replace dxr links by searchfox in the code/test r=kats,sparky
Differential Revision: https://phabricator.services.mozilla.com/D92792
2020-10-08 14:02:40 +00:00
Ricky Stewart ca78eeaa6f Bug 1670047 - Don't point to `sccache-dist` documentation in build output r=firefox-build-system-reviewers,mhentges
Bug 1666244 added this. `sccache-dist` is not the recommended build configuration for arbitrary build scenarios, is not actively supported, and is only relevant for a subset of those building Firefox. Instead, point to more relevant general documentation.

Differential Revision: https://phabricator.services.mozilla.com/D92973
2020-10-08 17:12:16 +00:00
Ricky Stewart 0edcb2e938 Bug 1669701 - Catch `MissingVCSTool` when attempting to register Sentry r=firefox-build-system-reviewers,mhentges
Without this, running ANY `mach` command can fail if you don't have a VCS installed, which isn't the right behavior.

Differential Revision: https://phabricator.services.mozilla.com/D92834
2020-10-08 15:06:19 +00:00
Mark Banner d453a422a7 Bug 1666172 - Update node to 10.22.1. CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D91838
2020-09-29 20:42:10 +00:00
pbz e7019d518b Bug 1667781 - Refactored ETP blocklist dialog to use dialog element. r=Gijs,fluent-reviewers,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D92269
2020-10-07 18:46:22 +00:00
pbz 5a1511dfb0 Bug 1667781 - Refactored translation dialog to use dialog element. r=Gijs,fluent-reviewers,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D92268
2020-10-07 18:44:02 +00:00
pbz 65d9212250 Bug 1667781 - Refactored siteDataSettings dialog to use dialog element. r=Gijs,fluent-reviewers,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D92267
2020-10-07 18:42:49 +00:00
pbz 8a1c7b1c7c Bug 1667781 - Refactored permission preferences dialog to use dialog element. r=Gijs,fluent-reviewers,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D92263
2020-10-07 18:41:35 +00:00
pbz f074cb218d Bug 1667781 - Refactored container preferences dialog to use dialog element. r=Gijs,fluent-reviewers,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D92262
2020-10-07 18:39:20 +00:00
pbz 9b18585a93 Bug 1667781 - Refactored ClearSiteData dialog to use dialog element. r=Gijs,fluent-reviewers,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D92261
2020-10-07 18:37:57 +00:00
pbz 3c9542daf6 Bug 1667781 - Refactored addEngine dialog to use dialog element. r=Gijs,fluent-reviewers,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D92270
2020-10-07 18:36:32 +00:00
Aki Sasaki dea69bae37 Bug 1669635 - add debugging info to missing pushdate. r=releng-reviewers,mtabara
Differential Revision: https://phabricator.services.mozilla.com/D92812
2020-10-07 21:33:30 +00:00
Mike Hommey ab7e0d0170 Bug 1669615 - Go through gyp targets deterministically. r=nalexander
For some reason, this only had an effect on the fastermake backend.

Differential Revision: https://phabricator.services.mozilla.com/D92701
2020-10-07 01:35:08 +00:00
Mike Hommey 38543a6397 Bug 1654457 - Update virtualenv to 20.0.31. r=firefox-build-system-reviewers,mhentges,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D92173
2020-10-07 00:20:01 +00:00
Ricky Stewart e75cd2004d Bug 1669471 - Get rid of `DeprecationWarning` in `file_generate.py` r=firefox-build-system-reviewers,mhentges
`imp` is deprecated since Python 3.4 and later Python versions are very noisy about printing `DeprecationWarning`s; instead, use its replacement, `importlib`.

Differential Revision: https://phabricator.services.mozilla.com/D92632
2020-10-06 16:38:29 +00:00
Ricky Stewart ba155900e9 Bug 1665675 - Fix sporadic `AttributeError: module distutils has no attribute sysconfig` error in `configure` r=glandium
The existing implementation of `@imports()` in the `configure` sandbox doesn't translate an import of the form `@imports('distutils.sysconfig')` into an `import distutils.sysconfig` statement; instead, it transforms the input `@imports()` request a few times in such a way that we eventually just do `import distutils`, and expect that `distutils.sysconfig` will be populated that way. This would be fine, except that this isn't the way that Python's `import` system works:

```
>>> import distutils
>>> distutils.sysconfig
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'distutils' has no attribute 'sysconfig'
>>> import distutils.sysconfig
>>> distutils.sysconfig
<module 'distutils.sysconfig' from '/usr/lib/python3.8/distutils/sysconfig.py'>
```

i.e., we can't just import a parent module and expect that we can indirectly access all child packages of that module without importing them specifically.

So instead, we simplify the current model somewhat by not transforming the `@imports()` request at all and instead just performing the exact `import` that the user requested. This resolves the `distutils.sysconfig` issue as well as hopefully preventing any other similar issues popping up in the future.

While I'm here, I also refactored some stuff so that the way that we're patching in wrapped modules for the sandbox is more structured.

Differential Revision: https://phabricator.services.mozilla.com/D90627
2020-10-06 14:59:46 +00:00
Ricky Stewart 56a1a229f2 Bug 1668718 - Don't `import mach_bootstrap` for `virtualenv`s that don't have `populate_local_paths` set, or in Python 3 r=mhentges,firefox-build-system-reviewers
Before, this would be written to `sitecustomize.py` irrespective of the value of `populate_local_paths`. This doesn't make sense -- since the local paths aren't included in the `virtualenv`'s `PYTHONPATH` when Python starts up, it doesn't know how to `import mach_bootstrap`. Since on `mach` startup the import hook will be loaded anyway, and the `virtualenv`s in `~/.mozbuild` (i.e. the only `virtualenv`s for which we don't `populate_local_paths`) are just used to run `mach`, this is fine and won't regress anything.

Also, since the `import` hook is only necessary for Python 2, add a couple conditional checks to get rid of the added overhead when we're running with Python 3.

This was never noticed because importing `sitecustomize` is allowed to throw an `ImportError`, which failure is ignored silently. This may be fixed in the latest version of `virtualenv`.

Differential Revision: https://phabricator.services.mozilla.com/D92290
2020-10-05 17:05:05 +00:00
Ricky Stewart e6fd6a6aa7 Bug 1667436 - Merge content of `docs/setup/mach.rst` into existing documentation r=firefox-build-system-reviewers,mhentges DONTBUILD
This document was imported from MDN and contained very outdated/incorrect information, and much of the information here is duplicated from the existing `mach` documentation. For the little content that isn't already expressed in the existing documentation in a better way, merge it into `python/mach/docs`.

The unique content is mainly in the FAQ, so I added a new page for that.

Differential Revision: https://phabricator.services.mozilla.com/D91455
2020-10-05 16:51:41 +00:00
Gregory Mierzwinski 96be950645 Bug 1667180 - Reinstall existing browsertime package if its outdated. r=tarek
This patch changes how/when we decide to (re-)install browsertime. We do this by checking the package.json entries to see if they match or not.

Differential Revision: https://phabricator.services.mozilla.com/D91329
2020-10-01 07:14:37 +00:00
Andi-Bogdan Postelnicu ed9f7b17b0 Bug 1611515 - Add test cases for CompileDB command output. r=rstewart
Also this patch adds tests for `ClangdBackend` and `StaticAnalysisBackend` since
both of them are derived from `CompileDB`.

Differential Revision: https://phabricator.services.mozilla.com/D91768
2020-09-30 14:52:54 +00:00
Andi-Bogdan Postelnicu 0ec28a45b6 Bug 1666993 - new bakend for static-analysis that prevents regressing issues with files that can be built outside of the unified environment. r=botond
1. Provide a new backend dedicated for C++ static-code_analysis
2. Build a list with directories, from non-unified-compat that have been fixed and
permit compiling of C++ files outside of the unified environment. With this list
we eliminate the unified sources and instead use the original source for command
attribute from compile_commands.json.
In this way if a regression appears clang-tidy will report it since it no longer uses
the unified environment for files that are compatible to be compiled standalone.
3. Remove the coverity functionality that was reading and using non-unified build files
since in practive it proved to be sub-optimal.

Differential Revision: https://phabricator.services.mozilla.com/D91011
2020-09-30 04:29:25 +00:00
Marco Bonardo 04fc7ba215 Bug 1658629 - Update heuristic action when cycling through local one-offs with a search string. r=adw,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D91574
2020-09-29 10:07:08 +00:00
Ricky Stewart d6d752863b Bug 1667394 - Check for presence of `pip3` and `distutils.sysconfig` in `bootstrap` r=firefox-build-system-reviewers,mhentges
`bootstrap` does not/cannot "fix" a broken Python environment, but we can do some checks and make sensible suggestions about how to fix the problem.

We expect that both of the checks we do here are primarily going to be triggered on new installs of Ubuntu. For macOS, installing `python` with `brew` will also install `pip`, and Windows has MozillaBuild. It's just Ubuntu that goes out of its way to be confusing, so add particularly informative error messages for Debian/Ubuntu.

Note that this doesn't change the functionality of `bootstrap` in any fundamental way -- `mach` is already broken if either of these conditions don't hold, but now we show an informative error message.

Differential Revision: https://phabricator.services.mozilla.com/D91470
2020-09-28 19:19:58 +00:00
Mitchell Hentges 3d3a31abb7 Bug 1667750: safely handle unexpected hg ui.username format r=firefox-build-system-reviewers,rstewart
If the "ui.username" config option doesn't have a value in the expected
format, assume that the user email address is unknown instead of
throwing an exception.

Differential Revision: https://phabricator.services.mozilla.com/D91626
2020-09-28 19:02:35 +00:00
Dan Minor 67f56c312d Bug 1665166 - Normalize non_unified_source paths in gn_processor.py r=firefox-build-system-reviewers,rstewart
In order to support building with relative paths to third-party code we need
to normalize the non-unified source paths prior to comparing them to incoming
source paths during moz.build file generation.

Depends on D91319

Differential Revision: https://phabricator.services.mozilla.com/D91320
2020-09-24 18:55:02 +00:00
Andi-Bogdan Postelnicu f2893f78a5 Bug 1667041 - Do not consume all cores when indexing C++ with `clangd` from `vscode`. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D91258
2020-09-25 07:00:21 +00:00
Emma Malysz f73e3431ed Bug 1634042, Part 1: migrate page action titles to fluent. r=Gijs,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D87822
2020-09-24 17:29:16 +00:00
Ted Campbell 220c2b6e90 Bug 1666873 - Add missing self.metrics argument for local MOZ_PGO build_commands r=firefox-build-system-reviewers,mhentges
This argument was recently added to the normal build invocation below but was
missed in the MOZ_PGO branch.

Differential Revision: https://phabricator.services.mozilla.com/D91184
2020-09-23 18:08:03 +00:00
Gregory Mierzwinski 05a0d1e9b3 Bug 1665972 - Parse metrics correctly from test scripts. r=tarek
Differential Revision: https://phabricator.services.mozilla.com/D90727
2020-09-23 15:00:19 +00:00
Tarek Ziadé 7e373ac7fd Bug 1666699 - Keep the hooks module state r=sparky
Some hooks modules use global variables to share state between hooks calls.
This patch makes sure we reuse the same module instance once it's loaded by a
Hook class.

Differential Revision: https://phabricator.services.mozilla.com/D91096
2020-09-23 17:10:19 +00:00
Botond Ballo 7fd68bc2ed Bug 1666370 - Use --log=info rather than --log=error for clangd. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D90925
2020-09-23 10:15:32 +00:00
Harnaman Kaur b2d04eb931 Bug 1588185 - Show an error when an old/incorrect version of clang-format is used r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D86469
2020-09-23 17:02:50 +00:00
Mitchell Hentges ade8b6be08 Bug 1665232: Run "mach install-moz-phab" in bootstrap r=firefox-build-system-reviewers,rstewart
The supported way of submitting Firefox patches is via moz-phab, so
install it automatically in bootstrap rather than redirecting to docs.

Depends on D90455

Differential Revision: https://phabricator.services.mozilla.com/D90459
2020-09-22 21:06:12 +00:00
Andi-Bogdan Postelnicu d13f799bfc Bug 1666513 - Format with black the python code that generates the C++ database. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D91010
2020-09-22 16:14:03 +00:00
Mitchell Hentges 0d9c3f79b6 Bug 1666585: bootstrap version parsing supports case insensitive fs r=firefox-build-system-reviewers,rstewart
Windows handles files in a case-insensitive way. So, when checking if a
file matches a certain extension, that check needs to be
case-insensitive as well.

Differential Revision: https://phabricator.services.mozilla.com/D91057
2020-09-22 20:27:32 +00:00
Tarek Ziadé c7cf4bad66 Bug 1665556 - make the try-platform option handle multiple platforms r=sparky
Differential Revision: https://phabricator.services.mozilla.com/D90550
2020-09-22 15:59:15 +00:00
Mitchell Hentges 862d284885 Bug 1666032: ensure java from PATH == java from JDK_BIN_DIR r=rstewart
In the build process, there's two ways that java is used:
* From the path
* From the java-bin-path specified in the mozconfig

Before, to assert that both "java" usages would be consistent, the
implementation assumed that there was only a single "java" binary
per-JDK-version, and all duplicate "binaries" were symlinks to the
original.

However, in Fedora, it has two identical full binaries: one in
$JDK/bin, and one in $JDK/jre/bin. The symlink theory was incorrect.

So instead, we can assert that both "java" usages are consistent
by checking their versions and asserting that they are equivalent.

Differential Revision: https://phabricator.services.mozilla.com/D90918
2020-09-21 20:59:32 +00:00
Dorel Luca bc089edbb6 Backed out changeset fded12622108 (bug 1663837) as requested by dev. CLOSED TREE 2020-09-22 00:42:45 +03:00
Mitchell Hentges 16f13b00de Bug 1663837: ensure java from PATH == java from JDK_BIN_DIR r=firefox-build-system-reviewers,rstewart
In the build process, there's two ways that java is used:
* From the path
* From the java-bin-path specified in the mozconfig

Before, to assert that both "java" usages would be consistent, the
implementation assumed that there was only a single "java" binary
per-JDK-version, and all duplicate "binaries" were symlinks to the
original.

However, in Fedora, it has two identical full binaries: one in
$JDK/bin, and one in $JDK/jre/bin. The symlink theory was incorrect.

So instead, we can assert that both "java" usages are consistent
by checking their versions and asserting that they are equivalent.

Differential Revision: https://phabricator.services.mozilla.com/D90774
2020-09-21 17:22:15 +00:00
David Major efc436a4c8 Bug 1666004 - Use new-pass-manager flags for wasm-sandboxed code r=firefox-build-system-reviewers,rstewart
I randomly noticed in a log file that we don't apply the flags to wasm compilations. I don't have a super strong motivation for this, but eh, we might as well.

Differential Revision: https://phabricator.services.mozilla.com/D90741
2020-09-18 19:19:02 +00:00
Sylvestre Ledru dba81844c2 Bug 1666244 - Update of the wording + url at the end of the build r=mhoye
Differential Revision: https://phabricator.services.mozilla.com/D90855
2020-09-21 13:43:52 +00:00
Ricky Stewart a7be3f2b68 Bug 1665494 - In `mach python-test`, don't install requirements.txt in parallel r=ahal
If you set a `DEFAULT` `requirements` file in a Python test manifest, the current implementation of `python-test` will try (and usually fail) to install the file once for every test file in parallel. Instead, initializing the environment should be done once when the command starts up.

Differential Revision: https://phabricator.services.mozilla.com/D90475
2020-09-18 01:38:46 +00:00
Gregory Mierzwinski d0ec0cd96a Bug 1659072 - Add commit timestamps to Fenix batch-mode tests. r=tarek
Differential Revision: https://phabricator.services.mozilla.com/D89642
2020-09-17 12:28:30 +00:00
Kris Maglione 387300d358 Bug 1662855: Remove defunct httpd.manifest file. r=mccr8,necko-reviewers,valentin
The manifest file hasn't actually done anything since XPT definitions were
moved to the libxul binary, and now just generates warnings in local builes.

Differential Revision: https://phabricator.services.mozilla.com/D89197
2020-09-17 03:15:11 +00:00
Dorel Luca d5b7a5666c Backed out changeset 0a4e7303358b (bug 1662855) for XPCshell failures in netwerk/test/httpserver/test/test_async_response_sending.js. CLOSED TREE 2020-09-17 03:31:11 +03:00
Ricky Stewart 58c8bb3559 Bug 1663367 - Use `mozfile.which` to locate Java binary r=mhentges
This avoids duplicating code to add the `.exe` suffix, which we weren't doing before.

Differential Revision: https://phabricator.services.mozilla.com/D89488
2020-09-16 21:44:31 +00:00
Kris Maglione fa5c3a435d Bug 1662855: Remove defunct httpd.manifest file. r=mccr8,necko-reviewers,valentin
The manifest file hasn't actually done anything since XPT definitions were
moved to the libxul binary, and now just generates warnings in local builes.

Differential Revision: https://phabricator.services.mozilla.com/D89197
2020-09-16 21:57:29 +00:00
Mike Hommey b297cc22e4 Bug 1664077 - Remove _NON_GLOBAL_ACDEFINES. r=firefox-build-system-reviewers,mhentges,rstewart
I think they're remnants from the past that we don't really need anymore.
And they're making things more complicated for some pending work of mine.

Differential Revision: https://phabricator.services.mozilla.com/D89687
2020-09-15 14:25:14 +00:00
Ricky Stewart f44b26911e Bug 1663748 - Use `mozfile.which` in `bootstrap` r=mhentges,glandium
We don't need the homebrewed implementation any longer after bug 1647792.

Differential Revision: https://phabricator.services.mozilla.com/D89487
2020-09-16 16:46:28 +00:00
Mitchell Hentges 648ccad85b Bug 1654074: Publish glean handle to mach commands r=firefox-build-system-reviewers,rstewart
Allows mach commands to define their own glean metrics with the `metrics_path` @CommandProvider parameter.
When `metrics_path` is defined:
* A `metrics` kwarg is provided to the decorated class. This `metrics` handle is a Glean instance, so Glean documentation should be consulted for usage information.
* When `mach doc telemetry` is run, metrics docs will be generated from all the registered metrics files.

Note: there was some consideration between making `metrics_path` a @CommandProvider or @Command parameter.
In the end, @CommandProvider seemed like a better fit because:
* Metrics seem to be more associated with the entire class than a specific command/method. This is because a class represents a "domain", and that domain may have different commands that have overlapping metrics.  Accordingly, all the metrics should be defined once as available to the entire class.
* Currently, @Command methods only take parameters that map one-to-one with CLI arguments. It could seem inconsistent to have one exception: the metrics handle

Differential Revision: https://phabricator.services.mozilla.com/D85953
2020-09-15 21:15:20 +00:00
Tarek Ziadé 5f7fe6ede4 Bug 1663937 - add options metadata r=sparky,perftest-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D89922
2020-09-16 14:00:18 +00:00
Mitchell Hentges b1c1e629c0 Bug 1665164: remove unused get_command logic from CommandAction r=firefox-build-system-reviewers,rstewart
In the patch for bug 1656993, the case in which
get_command was being set was removed.
Accordingly, its usage in CommandAction will always be evaluated to
`False`, and it can be deleted.

Differential Revision: https://phabricator.services.mozilla.com/D90198
2020-09-15 18:56:03 +00:00
Mitchell Hentges 1a5995b622 Bug 1663837: bootstrap should store java path in mozconfig r=firefox-build-system-reviewers,rstewart
When multiple java versions are in use, some OSes have a mechanism to
change the "default"/system Java.
This can cause unexpected build failures if the system Java changes.
So, in bootstrap, if the Java version found is valid, then its path
should be encoded into mozconfig.

Differential Revision: https://phabricator.services.mozilla.com/D90163
2020-09-15 17:56:55 +00:00
Ricky Stewart b9f69c11b9 Bug 1663786 - Remove "copy" support from `virtualenv` handling r=ahal
This is unused.

Differential Revision: https://phabricator.services.mozilla.com/D89509
2020-09-10 12:54:49 +00:00
Ricky Stewart 4822d7dd4c Bug 1663755 - Remove `inherit-from-parent-environment` implementation r=ahal
This was originally meant to allow `virtualenv`s to use packages from a parent Python environment without having to re-install them. This turned out to not pan out as we would have liked, so we're going another way to solve the same problem. Bug 1660351 walked back a bunch of this logic; this patch deletes the rest of it.

Differential Revision: https://phabricator.services.mozilla.com/D89492
2020-09-11 22:14:41 +00:00
Razvan Maries f46af2adfc Backed out changeset ee6dbeaf8852 (bug 1664077) for build bustages on gfxFontUtils.h. CLOSED TREE 2020-09-15 04:02:01 +03:00
Mike Hommey 3fd47263f8 Bug 1664077 - Remove _NON_GLOBAL_ACDEFINES. r=firefox-build-system-reviewers,mhentges,rstewart
I think they're remnants from the past that we don't really need anymore.
And they're making things more complicated for some pending work of mine.

Differential Revision: https://phabricator.services.mozilla.com/D89687
2020-09-14 16:31:31 +00:00
Ricky Stewart 9ca5df0699 Bug 1664408 - Don't delete `~/.mozbuild/mozboot` directory after use in `bootstrap` r=mhentges,nalexander
The idea here was that we keep the NDK's downloaded in this directory as a "cache", such that if the download gets interrupted, then we can resume the download from an earlier point. This logic was walked back by bug 1637379, which deletes the cache.

In the spirit of the original version of the code, remove the `os.rmdir()` that was introduced by that bug.

An alternative fix for this is to download the NDK to a temporary directory and just clean that up entirely after every call to `mach bootstrap`, but then we would be forgoing the build cache behavior, which I'm not sure makes sense at this point in time.

Differential Revision: https://phabricator.services.mozilla.com/D90125
2020-09-14 21:16:49 +00:00
Ricky Stewart 821d955268 Bug 1664581 - Explicitly recommend putting `hg` in your `PATH` if `bootstrap` can't find it r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D90171
2020-09-14 21:18:27 +00:00
Tom Ritter 559727d2a0 Bug 1657952 - When ./mach vendor adds/removes files, also edit the moz.build files r=firefox-build-system-reviewers,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D86393
2020-09-14 18:44:49 +00:00
Alexis Beingessner e7aa36447a Bug 1647582 - add new version checks to mach vendor rust. r=njn
Differential Revision: https://phabricator.services.mozilla.com/D87337
2020-08-24 04:46:51 +00:00
Andi-Bogdan Postelnicu 286dbe9634 Bug 1664540 - when using `mach ide vscode` on MacOs also look in Applications folder. r=marco
VSCode doesn't install by default it's command line integration toolset on MacOS
 so w don't have a link to `/usr/local/bin/code` instead we must use the binary from the
 `Applications` folder.
 Also extens this to other platforms even though it's improbable that we are going to use it
 there.

Differential Revision: https://phabricator.services.mozilla.com/D90088
2020-09-14 12:30:02 +00:00
Mark Banner 02ae3b9de6 Bug 863474 - Centralise OpenSearch install failure prompts into SearchUIUtils. r=daleharvey,flod,geckoview-reviewers,esawin
Differential Revision: https://phabricator.services.mozilla.com/D89879
2020-09-14 11:08:43 +00:00
Gijs Kruitbosch b2dee52fd3 Bug 1663879 - migrate fullscreen and pointer lock warnings to fluent, r=jaws,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D89675
2020-09-12 20:09:26 +00:00
Razvan Maries e3020a8f57 Backed out 2 changesets (bug 863474) for build bustages on search.properties. CLOSED TREE
Backed out changeset 5f00eaaa4e2d (bug 863474)
Backed out changeset 42d66b1f9b82 (bug 863474)
2020-09-12 19:41:12 +03:00
Mark Banner d1abbfeaf8 Bug 863474 - Centralise OpenSearch install failure prompts into SearchUIUtils. r=daleharvey,flod
Differential Revision: https://phabricator.services.mozilla.com/D89879
2020-09-12 14:57:34 +00:00
Mitchell Hentges 82521cb272 Bug 1663838: Refresh pacman before installing Arch Linux deps r=firefox-build-system-reviewers,rstewart
In bootstrap, pacman should ensure its database is up-to-date.
Otherwise, when installing packages, pacman will slowly query every
mirror when attempting to download an out-of-date package.

Differential Revision: https://phabricator.services.mozilla.com/D89958
2020-09-11 19:20:51 +00:00
Tarek Ziadé 3021e5b216 Bug 1662706 - add a fuzzy runner r=sparky,necko-reviewers,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D89123
2020-09-11 08:13:27 +00:00
Tarek Ziadé 9c8bb6e963 Bug 1663417 - make scriptinfo compatible with xpcshell tests r=sparky
Differential Revision: https://phabricator.services.mozilla.com/D89372
2020-09-10 23:15:09 +00:00
Tarek Ziadé 0bf97a3ebc Bug 1661809 - use mach lint r=sparky
Removed our custom linter calls and use mach lint

Differential Revision: https://phabricator.services.mozilla.com/D89703
2020-09-10 23:15:07 +00:00
Narcis Beleuzu f837964009 Backed out 3 changesets (bug 1661809, bug 1662706, bug 1663417) for SM bustages. CLOSED TREE
Backed out changeset 96e69574f7ee (bug 1662706)
Backed out changeset a584b11a503a (bug 1663417)
Backed out changeset 655ce94f20f3 (bug 1661809)
2020-09-11 01:50:09 +03:00
Mitchell Hentges 565f11ba0a Bug 1651424: Report build telemetry using Glean r=firefox-build-system-reviewers,Dexter,rstewart
In addition to the existing build telemetry, also gather the stats and
report with Glean. This new telemetry is reported in tandem with the existing
telemetry to allow testing and confidence before a full roll-out.

Additionally, Glean isn't compatible with Python 2, so the new telemetry only runs
on Python 3 mach commands.

Differential Revision: https://phabricator.services.mozilla.com/D83572
2020-09-09 23:51:57 +00:00
Mihai Alexandru Michis b1839ed65d Merge mozilla-central to autoland a=merge on a CLOSED TREE 2020-09-10 18:15:20 +03:00
Mihai Alexandru Michis 8b42ade55d Merge autoland to mozilla-central. a=merge 2020-09-10 18:12:07 +03:00
Csoregi Natalia 7909e86bd0 Backed out 2 changesets (bug 1663755, bug 1663786) for causing bustages in Bug 1664106. a=backout
Backed out changeset 972df2adcffa (bug 1663786)
Backed out changeset f97f4ae8e721 (bug 1663755)
2020-09-10 15:50:24 +03:00
Mitchell Hentges 76523a630e Bug 1651424: Bump glean version to 32.3.1 r=firefox-build-system-reviewers,rstewart
32.3.0 was missing Python wheels for macOS.

Differential Revision: https://phabricator.services.mozilla.com/D89641
2020-09-09 22:28:16 +00:00
Tarek Ziadé 282632b3a0 Bug 1662706 - add a fuzzy runner r=sparky,necko-reviewers,rstewart DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D89123
2020-09-10 11:36:29 +00:00
Tarek Ziadé 2e207a9e80 Bug 1663417 - make scriptinfo compatible with xpcshell tests r=sparky DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D89372
2020-09-10 11:18:26 +00:00
Tarek Ziadé fa3f23fe40 Bug 1661809 - use mach lint r=sparky DONTBUILD
Removed our custom linter calls and use mach lint

Differential Revision: https://phabricator.services.mozilla.com/D89703
2020-09-10 14:00:15 +00:00
Mitchell Hentges c3ed90120c Bug 1664058: Bootstrap should prompt for telemetry r=firefox-build-system-reviewers,rstewart
Bootstrap should always prompt to opt into telemetry if it hasn't been
opted in/out yet.

Differential Revision: https://phabricator.services.mozilla.com/D89678
2020-09-09 22:35:14 +00:00
Ricky Stewart c5875f6639 Bug 1663786 - Remove "copy" support from `virtualenv` handling r=ahal
This is unused.

Differential Revision: https://phabricator.services.mozilla.com/D89509
2020-09-09 18:15:46 +00:00
Ricky Stewart be7fcb68ee Bug 1663755 - Remove `inherit-from-parent-environment` implementation r=ahal
This was originally meant to allow `virtualenv`s to use packages from a parent Python environment without having to re-install them. This turned out to not pan out as we would have liked, so we're going another way to solve the same problem. Bug 1660351 walked back a bunch of this logic; this patch deletes the rest of it.

Differential Revision: https://phabricator.services.mozilla.com/D89492
2020-09-09 18:15:28 +00:00
Myeongjun Go b53336d5a4 Bug 1653326 - [perfdocs] Add documentation about individual mozperftest tests to perfdocs r=sparky,perftest-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D86488
2020-09-09 17:58:39 +00:00
Mike Hommey 3c3839d4b3 Bug 1664083 - Remove support for external source directories. r=nalexander
It was there for comm-central, and hasn't been used since bug 1479904.

Differential Revision: https://phabricator.services.mozilla.com/D89691
2020-09-10 03:44:30 +00:00
Nicholas Nethercote 0f7f399e93 Bug 1426269 - Change the `slashslash` filter in preprocessor.py. r=glandium
This commit does the following.

- Renames `slashslash` as `dumbComments`. As a result, it now comes before
  `emptyLines` in alphabetical ordering, which means that if you apply both
  `dumbComments` and `emptyLines`, lines that contain only comments will be
  fully removed.

  (I contemplated changing the filter ordering to match the order specified,
  rather than using alphabetical ordering, but that was more invasive and not
  obviously better.)

- Changes `dumbComments` so it only applies if the comment is at the start of
  the line (with optional leading whitespace). This is so it can be used with
  prefs files, which contain lines like `pref("foo", "https://mozilla.org");`
  where the `//` must not be treated as a comment.

Note that `slashslash` wasn't being used anywhere.

Depends on D88240

Differential Revision: https://phabricator.services.mozilla.com/D88242
2020-09-08 23:04:51 +00:00
Nicholas Nethercote 1aa3d23435 Bug 1426269 - Remove the `spaces` filter from preprocessor.py. r=glandium
It's not used, probably because it's pretty strange and hard to imagine using
safely. (Stripping leading and trailing space could be useful, but collapsing
sequences of spaces? Hmm.)

Differential Revision: https://phabricator.services.mozilla.com/D88240
2020-09-08 06:54:04 +00:00
David Major a9939a7f60 Bug 1658632 - Don't strip d3dcompiler_47.dll r=glandium
The llvm-strip from clang-11 complains about this file. This file doesn't really interest us anyway -- it's imported from elsewhere -- so just avoid it.

Differential Revision: https://phabricator.services.mozilla.com/D89491
2020-09-08 21:46:32 +00:00
Ricky Stewart c53f2cc191 Bug 1662893 - Refactor `bootstrap` to reflect that the `~/.mozbuild` state directory and a local checkout are both mandatory r=glandium
`bootstrap` is written in such a way that we don't necessarily assume the existence of either the global state directory (`~/.mozbuild`) or a local checkout of `mozilla-central`. The independence from `~/.mozbuild` is a design decision that may have been appropriate at some point, but today it's arguably useless to continue executing `bootstrap` without a global state directory (we install a bunch of build dependencies there, as well as the `mach` `virtualenv`s that are needed for running non-`bootstrap` `mach` commands after bug 1656993). The independence from a local checkout is an artifact of the old design of `python/mozboot/bin/bootstrap.py`, which is no longer necessary as of bug 1647792.

With that in mind, 1) throw errors if we can't create the global state directory or find the topsrcdir, and 2) remove all existing conditionals of the form "if the global state directory exists" or "if the root of the checkout exists" since these conditions are always going to be true in practice.

Differential Revision: https://phabricator.services.mozilla.com/D89220
2020-09-08 16:33:06 +00:00
Ricky Stewart ed81bffdb9 Bug 1662775 - Refactor logic to locate `mach` `virtualenv`s r=glandium
This will be found in a couple places, so we might as well make a helper function. For symmetry put it in the same file where we keep the helper function to locate the `state_dir`.

Differential Revision: https://phabricator.services.mozilla.com/D89156
2020-09-08 08:41:03 +00:00
Andrew Halberstadt fc6e2af3a2 Bug 1662867 - [mach] Fix busted |mach settings| command, r=rstewart
Differential Revision: https://phabricator.services.mozilla.com/D89206
2020-09-02 20:14:35 +00:00
Sylvestre Ledru da34b6a58e Bug 1661514 - Reformat some python files with black 20.8b1 r=rstewart
# ignore-this-changeset

Depends on D88711

Differential Revision: https://phabricator.services.mozilla.com/D88712
2020-09-07 14:05:10 +00:00
Mihai Alexandru Michis 7fb69eef2a Backed out changeset 71edbf86ce85 (bug 1662855) for causing xpcshell failures.
CLOSED TREE
2020-09-03 01:56:09 +03:00
Ricky Stewart 59ed932290 Bug 1662856 - Delete `MercurialNativeRevisionFinder` and associated test r=dmajor
Bug 1659539 caused the unit tests of this class to suddenly start running on Linux; it failed with a type error that suggests this test has never really properly worked, at least not with the version of Mercurial we're using in CI (`unsupported changeid '0' of type <type 'unicode'>`). The class itself isn't used anywhere besides these tests, so just delete the entire class.

Differential Revision: https://phabricator.services.mozilla.com/D89205
2020-09-02 21:00:23 +00:00
Ricky Stewart 204ea8222e Bug 1659542 - Remove support for `pipenv` in `mozilla-central` r=mhentges,dmajor
Differential Revision: https://phabricator.services.mozilla.com/D89192
2020-09-02 19:55:57 +00:00
Kris Maglione d2863ca956 Bug 1662855: Remove defunct httpd.manifest file. r=mccr8,necko-reviewers,valentin
The manifest file hasn't actually done anything since XPT definitions were
moved to the libxul binary, and now just generates warnings in local builes.

Differential Revision: https://phabricator.services.mozilla.com/D89197
2020-09-02 20:14:12 +00:00
Ricky Stewart 4c46edb8ed Bug 1660559 - In `mach bootstrap`, initialize the `mach` `virtualenv`s early and run `mach artifact` with them r=mhentges,ahal
`mach artifact` has a dependency on `zstandard`, which is installed in the `mach` `virtualenv`s, so we have to run `mach artifact` with the correct `virtualenv`. Also create the `virtualenv`s earlier in the process to account for this.

This all has a dependency on the existence of a checkout (which has the `mach` script with all its dependencies on everything else), but after bug 1647792 that's not a concern.

Differential Revision: https://phabricator.services.mozilla.com/D87920
2020-09-02 17:02:12 +00:00
Ricky Stewart 792b74bafb Bug 1662819 - Refactor `virtualenv` script path locating logic r=mhentges,froydnj
The ability to get the path to the Python executable from a given `virtualenv` location is generally useful outside the context of all the extra stuff a `VirtualenvManager` provides, so refactor it out into a lighter-weight helper class.

Differential Revision: https://phabricator.services.mozilla.com/D89175
2020-09-02 18:52:58 +00:00
Ricky Stewart 4c6985333a Bug 1659539 - [python-test] Remove '--python' and stop using pipenv to manage virtualenvs r=ahal
Pipenv is heavy weight and overkill for the purposes it is being used. We'd like to remove it from the tree and |mach python-test| was one of the last remanining use cases.

Remove the `--python` command-line argument as a result. Users who wish to run unit tests with Python 2 can do `MACH_PY2=1 ./mach python-test ...` or `python2 ./mach python-test ...`.

Also update a few unit tests that would break otherwise in the presence of this change.

There were a couple lines in the `setup.py` for `mozlog` that were problematic for tests and was resulting in errors due to the `mozlog` plugin being loaded by `pytest` more than once. We just delete those lines and bump up the major version number of the package to fix it.

Differential Revision: https://phabricator.services.mozilla.com/D88296
2020-09-02 17:05:24 +00:00
Ricky Stewart 0afe96bbf7 Bug 1662793 - Set `python` appropriately in `gyp_reader` r=froydnj
Otherwise `gyp` can choose incorrectly when trying to figure out which Python to use to run its internal scripts, which can manifest as test failures in certain circumstances.

Differential Revision: https://phabricator.services.mozilla.com/D89165
2020-09-02 16:17:21 +00:00
Ricky Stewart 6d5c9de81b Bug 1662632 - Fix `UnboundLocalError` due to undefined variable `have_clone` in `mach bootstrap` r=froydnj
This consolidates the `have_clone` logic in one place unconditionally. After bug 1647792 we're deprecating the use case where `bootstrap` is run without a clone, so that's not a problem.

In reality the whole `have_clone` thing isn't necessary any more (`have_clone` is always going to be `True` in practice), but I'll save that for a bigger refactoring.

Differential Revision: https://phabricator.services.mozilla.com/D89152
2020-09-02 14:57:22 +00:00
Yue Zhang 72faa9da2c Bug 1639693 - Allow mach perftest users to provide their own custom tranformer from the command line. r=sparky,tarek
Differential Revision: https://phabricator.services.mozilla.com/D86417
2020-09-01 15:03:32 +00:00
Ricky Stewart 6245dd6daa Bug 1647792 - Standalone `bootstrap.py` script clones before running `mach bootstrap` r=mhentges,froydnj,mhoye
Note that when I refer to "standalone `bootstrap.py`" here, I'm referring to the file `python/mozboot/bin/bootstrap.py` and no other similarly-named file in-tree.

The current design, where standalone `bootstrap.py` downloads a small portion of the `mozilla-central` repo and then works through all the `bootstrap` logic, performing a clone in the middle of the `bootstrap` process, has some deficiencies, namely:

1. Refactoring code that is shared between the `bootstrap` logic and the mainline `mach` logic is, if not impossible, more difficult than it needs to be, since standalone `bootstrap.py` needs to download a set of files that bootstraps a build environment perfectly with no other dependencies in `mozilla-central`. As a result we have some [duplicated or redundant code](https://searchfox.org/mozilla-central/rev/c6676771df58c6e0098574bc6b11517acbf264cf/python/mozboot/mozboot/base.py#349) and some stuff that has been [refactored into the `mozboot` directory](https://searchfox.org/mozilla-central/source/python/mozboot/mozboot/util.py) irrespective of whether it actually makes sense to go there (see bug 1649850).

2. Since `mach bootstrap` has access to the entire `mozilla-central` environment, but the (much less frequently exercised) standalone `bootstrap.py` script does *not*, this can lead people to write patches that work fine in `mach bootstrap` but which regress standalone `bootstrap.py`. Furthermore, testing `bootstrap` patches with standalone `bootstrap.py` is difficult. So this is a not infrequent source of regressions; bugs 1652736 and 1643158 are recent examples. Furthermore, typically these regressions are "fixed" by adding more code duplication or by replacing battle-tested frequently-used libraries (either `m-c`-internal or third-party) with less robust bespoke code.

3. Issue (2) is avoidable if people are sufficiently critical during code review, but at *best*, this is a weird extra level of mental overhead that we need to keep in mind only for `bootstrap` patches.

This patch preserves back-compatibility and the validity of existing documentation by factoring out all the logic to clone `mozilla-central` into standalone `bootstrap.py` directly, and cloning *before* calling into `mach bootstrap` directly. This gives us only one official entry point into the bootstrapper, namely, `mach bootstrap`.

There are a couple concrete implications of this change:

1. Now, the clone happens before any other interesting work happens, so people may have to wait ~an hour before actually beginning to engage with the `bootstrap` wizard. While it's arguably slightly less convenient, I'm not sure it matters enough that we should block this patch or a similar one on it.

2. The `hg`/`git` configuration step now happens *after* the clone rather than before it. Looking at what the `hg` and `git` configuration wizards actually do today, I don't think this matters either (all of the configurations can easily happen after cloning the repo).

Another note: `bootstrap` installs `git-cinnabar` to the `.mozbuild` state directory. We could have duplicated all of that logic over to standalone `bootstrap.py`, but it's non-trivial and I didn't think that made any sense, so instead we have standalone `bootstrap.py` download a temporary version and use it for the initial clone if necessary.

Differential Revision: https://phabricator.services.mozilla.com/D85058
2020-09-01 18:42:36 +00:00
Ricky Stewart 013bce3e16 Bug 1662530 - Update minimum required `hg` version in `bootstrap` r=mhentges,dmajor
This brings it up-to-date with the minimum allowable version in `version-control-tools`; these two versions should be equal to each other, as the [comment in the source code](4b0de666d1/hgext/configwizard/__init__.py (l59)) suggests. Also add a similar comment in this file to prevent the likelihood of a mismatch going into the future.

Differential Revision: https://phabricator.services.mozilla.com/D89022
2020-09-01 18:49:45 +00:00
Ricky Stewart df4289ddcc Bug 1662130 - Walk back new `inherit-from-parent-environment` logic in `virtualenv` handling r=ahal
This logic is meant to expose packages from a globally-installed Python to be used by the in-`objdir` `virtualenv`s, so for example we don't have to figure out how to install `zstandard` (or other Python packages with native code that may or may not have prebuilt wheels for any given platform) in those `virtualenv`s. Bug 1660351 augmented that logic to work within the requirements of bug 1660353. This worked mostly, but is causing builds to unconditionally break on Arch Linux, caused a couple test failures, and in general is just introducing other weird behaviors downstream, and issues with the resultant `PYTHONPATH`s are hard to diagnose and fix.

In the long-term we'll have to permanently solve the `zstandard` problem and pave the way for other Python packages with native code as well, but that's not an urgent need.

The ultimate goal is to completely remove `inherit-from-parent-environment`, but we can't do that until bug 1659539 is solved.

Partially reverts bugs 1660351. Entirely reverts bug 1660353, restoring that file to as it was before that patch.

Differential Revision: https://phabricator.services.mozilla.com/D89001
2020-09-01 16:54:27 +00:00
Cristina Coroiu 8eaafae8fd Backed out 2 changesets (bug 1661514) for lint failure on a CLOSED TREE
Backed out changeset 8e58c88f756b (bug 1661514)
Backed out changeset aef89f9a8031 (bug 1661514)
2020-09-01 19:34:12 +03:00
Sylvestre Ledru 5ee2fbd7cb Bug 1661514 - Reformat some python files with black 20.8b1 r=rstewart
# ignore-this-changeset

Depends on D88711

Differential Revision: https://phabricator.services.mozilla.com/D88712
2020-08-31 17:06:22 +00:00
Florian Quèze 2bfae616c0 Bug 1547769 - add --packaged parameter on |mach run| to run a packaged build, r=andi
Differential Revision: https://phabricator.services.mozilla.com/D88620
2020-08-31 05:31:29 +00:00
Gregory Mierzwinski 756d14a209 Bug 1662278 - Simplify mozperftest metric names. r=tarek
This patch adds two new options to mozperftest. The --simplify-names argument can be provided to enable simplification of metric names and the --simplify-exclude option allows users to select which metrics to skip in the simplification. A bug relating to setting the default of a list option is also fixed here.

Differential Revision: https://phabricator.services.mozilla.com/D88917
2020-09-01 15:29:41 +00:00
Gregory Mierzwinski b2e2d7432f Bug 1662278 - Fix test_visualmetrics local linux failure. r=tarek
This fixes a local failure in mozperftest by mocking the find_node_executable function in the visual-metrics tests. It is not needed for those tests.

Depends on D88915

Differential Revision: https://phabricator.services.mozilla.com/D88916
2020-09-01 14:57:19 +00:00
Gregory Mierzwinski ae98f6130b Bug 1662278 - Pin black to version 19.10b0. r=tarek
Differential Revision: https://phabricator.services.mozilla.com/D88915
2020-09-01 15:09:44 +00:00
Gregory Mierzwinski 7101f264ef Bug 1650879 - Upgrade browsertime to v9.4.0. r=tarek,perftest-reviewers,Bebe
Differential Revision: https://phabricator.services.mozilla.com/D88324
2020-09-01 14:01:18 +00:00
Mitchell Hentges 4f7b73a741 Bug 1651424: Bump glean version to 32.3.0 r=firefox-build-system-reviewers,rstewart
Improves glean performance.
Prior to this change, using Glean adds ~500ms to each `mach` run.
After this change, using Glean adds ~200ms to each `mach` run.

Differential Revision: https://phabricator.services.mozilla.com/D88691
2020-08-31 16:06:18 +00:00
Mike Hommey 95629a4c24 Bug 1661635 - Make windows/!windows and python2/python3 entries in virtualenv.txt non-optional. r=firefox-build-system-reviewers,rstewart
Except when optional is actually specified.

Differential Revision: https://phabricator.services.mozilla.com/D88527
2020-08-28 14:49:00 +00:00
Ricky Stewart 32252b6aa5 Bug 1660353 - Remove subprocessing into global Python 3 in `symbols_archive.py` r=mhentges,froydnj
This was always a temporary hack because getting `zstandard` installed into the `objdir` `virtualenv`s was impossible. With the changes made in bug 1656993, this is possible now, so we can remove all this.

Differential Revision: https://phabricator.services.mozilla.com/D87809
2020-08-21 15:04:24 +00:00
Ricky Stewart 408991e871 Bug 1660351 - Tweak `inherit-from-parent-environment` implementation in `virtualenv.py` r=ahal
The intended behavior of `inherit-from-parent-environment` is that the packages from the parent Python environment are available to the sub-`virtualenv`. The implementation of that behavior thus far has been around "site directories", the idea being that custom (non-stdlib) packages are likely to be installed in the "site directory". The limitation of this approach is that there's no one location, in practice, where packages are installed, and it's hard to enumerate a static list of all those possible locations across all platforms.

This patch circumvents the issue by ignoring the "site directory" question entirely and just looking at `sys.path`. If we're inheriting from the parent environment when creating a `virtualenv`, we just ask the parent Python what its `sys.path` is and configure the `virtualenv`'s `sys.path` on startup.

Differential Revision: https://phabricator.services.mozilla.com/D87808
2020-08-27 21:48:06 +00:00
Ricky Stewart 8ae4bd16ba Bug 1661762 - strengthen `recognize_repo_paths` checks in `files.py` and `hg.py` r=mhentges,froydnj
We `normpath()` the `_root` path when we save it, but the input `path` to `get()` is not necessarily also normalized. Normalizing it prevents unnecessary test failures.

Differential Revision: https://phabricator.services.mozilla.com/D88635
2020-08-28 19:19:56 +00:00
Francesco Lodolo (:flod) cbefc75135 Bug 1661640 - Add Fluent migration for bug 1660259, r=emcminn
Differential Revision: https://phabricator.services.mozilla.com/D88533
2020-08-28 16:20:50 +00:00
Mitchell Hentges e8d0020e8d Bug 1660396: Removes no-op path operation r=firefox-build-system-reviewers,glandium
There's a usage of `mozpath.join(...)` found while investigating
wildcard-management. Since the return value isn't used here, and the
parameters here aren't mutated, this function call doesn't do anything.

Differential Revision: https://phabricator.services.mozilla.com/D88508
2020-08-28 04:50:02 +00:00
Mike Hommey a34742d98f Bug 1620133 - Allow generated file rules to run in parallel in a given directory. r=firefox-build-system-reviewers,rstewart
Bug 1645986 solved the problem for most generated files by moving their
rules to the top-level, but we're going to add rules that will end up in
subdirectories, so we have to solve the same problem again, in the
subdirectories.

Differential Revision: https://phabricator.services.mozilla.com/D88389
2020-08-28 01:58:48 +00:00
Nick Thomas ffceb1c957 Bug 1653476 - import partner repack script into tree and convert to py3, r=aki
Differential Revision: https://phabricator.services.mozilla.com/D88374
2020-08-27 22:19:32 +00:00
Nick Thomas e9938dc1de Bug 1630809 - generate partner attribution task r=aki
A single task is created to do all partner attributions. The partner_attribution transform processes the configuration into an environment variable for the tools/attribution/attribute.py script to use. This is quite verbose so a large number of configurations may cause problems.

Applies the same priority modification to attribution tasks as to partner repacks, to not impede the main part of the graph.

Differential Revision: https://phabricator.services.mozilla.com/D87729
2020-08-27 22:19:36 +00:00
Mitchell Hentges d0c3095f77 Bug 1660396: RecursiveMake should support wildcards with reltargets r=firefox-build-system-reviewers,glandium
Relative targets (e.g.: on top of "dist/bin") were being ignored when
the target path had a wildcard.

Differential Revision: https://phabricator.services.mozilla.com/D88361
2020-08-27 01:10:04 +00:00
Butkovits Atila b8629b8d1e Backed out 9 changesets (bug 1630809, bug 1653476) for Gecko Decision failures. CLOSED TREE
Backed out changeset 02a27bfc76dd (bug 1653476)
Backed out changeset afb5df61943a (bug 1630809)
Backed out changeset 04628c1f98e9 (bug 1630809)
Backed out changeset 4b4d50e0b1bf (bug 1630809)
Backed out changeset 2fa2deb5c993 (bug 1630809)
Backed out changeset d6652114cac3 (bug 1630809)
Backed out changeset ad5e4caa3291 (bug 1630809)
Backed out changeset d3d841cd14f3 (bug 1630809)
Backed out changeset b3746502e227 (bug 1630809)
2020-08-28 01:15:03 +03:00
Nick Thomas 9c0467f88b Bug 1653476 - import partner repack script into tree and convert to py3, r=aki
Differential Revision: https://phabricator.services.mozilla.com/D88374
2020-08-27 14:56:47 +00:00
Nick Thomas c5e9d12304 Bug 1630809 - generate partner attribution task r=aki
A single task is created to do all partner attributions. The partner_attribution transform processes the configuration into an environment variable for the tools/attribution/attribute.py script to use. This is quite verbose so a large number of configurations may cause problems.

Applies the same priority modification to attribution tasks as to partner repacks, to not impede the main part of the graph.

Differential Revision: https://phabricator.services.mozilla.com/D87729
2020-08-27 05:46:51 +00:00
Mike Hommey 9851f58c4b Bug 1661391 - Read the output from setup.py as unicode. r=froydnj
There are various problems happening when dealing with the output from
setup.py during virtualenv setup, all of which step from the process
command output not being a unicode string in python.

As this code is still used to setup python2 virtualenv, we need to use
the backwards-compatible universal_newlines=True trick.

Differential Revision: https://phabricator.services.mozilla.com/D88372
2020-08-27 12:27:54 +00:00
Ricky Stewart 1989d12e47 Bug 1646794 - Add basic infrastructure for collecting data on the performance of individual build actions r=mhentges,froydnj
This, hopefully, begins to address an ongoing global problem where we have few, if any, insights into the performance of individual build tasks (compilations, calls into Python scripts, etc.) At most we have aggregated statistics about how long tiers last, combined with `sccache` aggregates across the entire build (which don't cover non-compilation tasks). This has a few implications:

1. It's impossible to identify bottlenecks, except by going out of your way to notice and reproduce them. e.g. no one, to my knowledge, was aware that `make_dafsa.py` was a bottleneck until someone happened to notice and report it in bug 1629337. We could have systems that automatically detect this sort of thing, or at least that make it easier to do so than by CTRL-C'ing in the middle of the build several times to try to reproduce the problem.

2. It's impossible to detect regressions, unless the regression is so pronounced and severe that it has an immediate impact on the overall build time and triggers build time alerts.

3. It's impossible to identify that you have *fixed* regressions, except by doing ad-hoc timing measurements by building individual `make` targets. This is error-prone and annoying.

Here we propose a low-friction system wherein individual build tasks log their build own perf info. For now, that's a write to `stdout` consisting of the string `BUILDTASK ` followed by a simple JSON object with a start time, end time, the `argv` of the task, and an additional `"context"` key (I anticipate this could be used to annotate the task with relevant per-task for later aggregation, for example: was this an `sccache` cache hit or not? For now, it's empty everywhere). The build controller then collects this data, validates it, and writes out the entire list of build tasks as a JSON file after the build has completed, similarly to what we already do with `build_resources.json`. We already parse some `make` output to do stuff like tracking when we switch tiers, so this isn't a huge architectural shift or anything.

In my opinion this "should" happen at the build system, or `make`, level, but `make` doesn't expose anything resembling this information to my knowledge, so this has to be implemented outside of `make`. One could implement something like this at the `sccache` level but that doesn't touch anything but C/C++/Rust compilation tasks; an ideal solution would support other generic build tasks. We could also fork `make` to add this feature ourselves, but for several reasons I don't think that's tractable. :)

Of course, this approach has downsides:

1. We depend on parsing the `stdout` of `make`, and processes can unfortunately sometimes trample on each other, leading to data loss for individual build tasks occasionally. This is a necessary limitation of the model to my knowledge, and I don't know that it can be fixed generally. In my testing, not much data tends to be lost usually.

2. Dumping arbitrary data to `stdout` isn't always possible or desirable. If you're not careful about it this can also result in noisier-than-necessary tasks, especially when those tasks are not invoked by a parent process that knows how to handle the special `BUILDTASK` lines.

3. This data is raw enough where aggregation is not completely trivial.

4. This functionality has to be added for any new kind of build task whose performance we'd like to track; it doesn't come "for free" due to not being able to be implemented at the build system level.

5. The data isn't awfully small due to the `argv`'s (at this point, not nearly big enough where we need to be concerned about it IMO, but maybe that will change in the future?)

One can imagine a couple other architectures that could avoid the first two problems, namely: 1) we could use a "real" database that would not dump info to `stdout` and wouldn't lose data, like `sqlite3`; or, 2) we could set up another server, similar to `sccache`, that collects this data from subprocesses and aggregates it, making sure not to lose any along the way. Both of these have enough overhead, in terms of engineering effort or actual impact on latency, where I dont know that they make any sense to even attempt implementing. The remaining continue to be real issues, however.

After this is landed there are a few ways forward. We can start uploading these files as build artifacts in CI to allow us to reason about performance impacts of changes in `central`. We can easily add this functionality to the `sccache` client to start tracking those builds as well. We already have a very simple visualization of build tier timing in `mach resource-usage`; we could join that data against the `BUILDTASK` data to produce a very clear visualization of build bottlenecks, i.e., "why is the `export` tier taking so long", etc.

Differential Revision: https://phabricator.services.mozilla.com/D80284
2020-08-26 22:47:58 +00:00
Mitchell Hentges 4bdf055603 Bug 1661298: Log if artifact fails and Taskcluster URL overridden. r=froydnj
It can be tricky to find out why artifact-lookup fails, especially since
it can be implicitly affected by environment variables.
Log if a known troublemaker (TASKCLUSTER_ROOT_URL) is set when an
artifact-lookup fails.

Differential Revision: https://phabricator.services.mozilla.com/D88304
2020-08-26 17:33:31 +00:00
Tarek Ziadé bbb7d4b5d5 Bug 1659411 - add missing dep r=sparky
Differential Revision: https://phabricator.services.mozilla.com/D88295
2020-08-26 15:47:02 +00:00
Ricky Stewart 6e1d74e077 Bug 1624667 - Allow running `mach jit-test` if tests are disabled r=mhentges,froydnj
This works fine, so no reason not to allow it.

Differential Revision: https://phabricator.services.mozilla.com/D86398
2020-08-26 14:45:52 +00:00
Ricky Stewart 93f6564a24 Bug 1660124 - Don't trample existing `mach` `virtualenv`s if they're already up-to-date r=mhentges,ahal
On some platforms re-creating the `virtualenv`s can be very time-consuming so we'd like to avoid deleting these `virtualenv`s unnecessarily.

Preserve the existing behavior behind a `-f` flag in case unconditionally wiping the `virtualenv`s is what's needed for any reason.

Differential Revision: https://phabricator.services.mozilla.com/D87668
2020-08-25 21:21:19 +00:00
june wilde fcec357fc8 Bug 1661021 - add timestamp to mach vendor --check-for-update output r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D88148
2020-08-25 14:38:41 +00:00
Mike Hommey 922b27a089 Bug 1660880 - Support topobjdir-relative generated files in the faster make backend. r=froydnj
Bug 1659906 removed `../`s from some generated files paths which turned
up not being supported by the faster make backend. Instead of returning
to those relative paths, just support the topobjdir-relative paths
correctly. The new code is derived from the equivalent code in the
recursive make backend.

Differential Revision: https://phabricator.services.mozilla.com/D88097
2020-08-25 01:38:33 +00:00
Ricky Stewart a292021326 Bug 1660566 - Warn in `artifacts.py` if no git revisions are found r=mhentges,froydnj
This generally happens because people cleverly create custom forks of `mozilla-central` that don't have `git-cinnabar` metadata. This is ALWAYS broken in for artifact builds, but people generally don't know that and the error message isn't informative. Instead, identify when this happens as it happens and suggest an immediate, working alternative.

Differential Revision: https://phabricator.services.mozilla.com/D87923
2020-08-24 15:47:56 +00:00
Nick Alexander 9c623dbc86 Bug 1658040 - Part 2: Deny `mach package-multi-locale ...` when it's going to fail. r=froydnj
Depends on D87331

Differential Revision: https://phabricator.services.mozilla.com/D87332
2020-08-18 17:07:47 +00:00
Nick Alexander a1aff5b241 Bug 1658040 - Part 1: Fix local `mach package-multi-locale ...` locally. r=snorp
This succeeded in automation because we [check for `MOZILLA_OFFICIAL`
before invoking `mach` from within
Gradle](https://searchfox.org/mozilla-central/rev/8df04ff073d0fa70f692935c5dcddc0e23cb0117/build.gradle#110-146).
Locally, the check for `AB_CD=multi` in the environment used to catch
this but it's no longer used.  Rather than continue confusion with
`AB_CD=multi make ...` versus `make AB_CD=multi ...`, we'll use the
Gradle-specific environment variable.

Differential Revision: https://phabricator.services.mozilla.com/D87331
2020-08-18 18:13:26 +00:00
Ricky Stewart 64d5f3b565 Bug 1660105 - Allow installing `glean_sdk` to fail in `create-mach-environment`. r=mhentges,froydnj
`glean_sdk` can't currently be installed on Apple Silicon or OpenBSD since Glean can't be built from source. While that issue is being resolved (see bug 1660120), allow this installation to fail.

Differential Revision: https://phabricator.services.mozilla.com/D87667
2020-08-20 16:46:59 +00:00
Mike Hommey 9c86ddc0da Bug 1659411 - Default virtualenv_name to None in MachCommandBase. r=firefox-build-system-reviewers,rstewart
Bug #985141 added this argument without changing all the callers.
Instead of fixing each caller individually, just allow a value not to be
passed in. This is what the underlying MozbuildObject class does
anyways.

Differential Revision: https://phabricator.services.mozilla.com/D87386
2020-08-18 12:41:07 +00:00
Mark Hammond b0ffe6a42b Bug 1659615 - handle the fact Windows Defender might have exclusions on different disks. r=mhentges,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D87382
2020-08-18 11:28:50 +00:00
Ricky Stewart 1218762d08 Bug 1659575 - Delete `mach python-safety` r=ahal
There are zero uses of this `mach` command over the past 90 days according to our telemetry. There are no external references to `mach python-safety` in-tree, and indeed if you track the history of the originating bug 1468394, it appears that once the `mach` command was created, none of the follow-up work that was discussed (i.e. running this in CI and triaging failures to appropriate owners) was done over the following 2 years.

If this ever does appear to be useful in the future, we can just resurrect this code from source control.

Differential Revision: https://phabricator.services.mozilla.com/D87351
2020-08-18 14:18:24 +00:00
Jonathan Kew 65ccd8816d Bug 1659685 - Quote parameters passed to mozconfig_loader, in case of spaces in paths. r=rstewart
Differential Revision: https://phabricator.services.mozilla.com/D87427
2020-08-18 13:28:32 +00:00
Ricky Stewart 9ad232391e Bug 1659602 - Fix type error in `mozversioncontrol` for Windows+`hg`+Python 3 r=dmajor
These arguments will get converted to `bytes` later on if necessary; if we don't defer to `hglib`, then we need proper strings.

Differential Revision: https://phabricator.services.mozilla.com/D87440
2020-08-18 12:51:49 +00:00
Ricky Stewart bbfa258584 Bug 1656993: Create and require by default global `virtualenv`s in `~/.mozbuild` for `mach` r=mhentges,ahal
In two different places we've been encountering issues regarding 1) how we configure the system Python environment and 2) how the system Python environment relates to the `virtualenv`s that we use for building, testing, and other dev tasks. Specifically:

1. With the push to use `glean` for telemetry in `mach`, we are requiring (or rather, strongly encouraging) the `glean_sdk` Python package to be installed with bug 1651424. `mach bootstrap` upgrades the library using your system Python 3 in bug 1654607. We can't vendor it due to the package containing native code. Since we generally vendor all code required for `mach` to function, requiring that the system Python be configured with a certain version of `glean` is an unfortunate change.

2. The build uses the vendored `glean_parser` for a number of build tasks. Since the vendored `glean_parser` conflicts with the globally-installed `glean_sdk` package, we had to add special ad-hoc handling to allow us to circumvent this conflict in bug 1655781.

3. We begin to rely more and more on the `zstandard` package during build tasks, this package again being one that we can't vendor due to containing native code. Bug 1654994 contained more ad-hoc code which subprocesses out from the build system's `virtualenv` to the SYSTEM `python3` binary, assuming that the system `python3` has `zstandard` installed.

As we rely more on `glean_sdk`, `zstandard`, and other packages that are not vendorable, we need to settle on a standard model for how `mach`, the build process, and other `mach` commands that may make their own `virtualenv`s work in the presence of unvendorable packages.

With that in mind, this patch does all the following:

1. Separate out the `mach` `virtualenv_packages` from the in-build `virtualenv_packages`. Refactor the common stuff into `common_virtualenv_packages.txt`. Add functionality to the `virtualenv_packages` manifest parsing to allow the build `virtualenv` to "inherit" from the parent by pointing to the parent's `site-packages`. The `in-virtualenv` feature from bug 1655781 is no longer necessary, so delete it.

2. Add code to `bootstrap`, as well as a new `mach` command `create-mach-environment` to create `virtualenv`s in `~/.mozbuild`.

3. Add code to `mach` to dispatch either to the in-`~/.mozbuild` `virtualenv`s (or to the system Python 3 for commands which cannot run in the `virtualenv`s, namely `bootstrap` and `create-mach-environment`).

4. Remove the "add global argument" feature from `mach`. It isn't used and conflicts with (3).

5. Remove the `--print-command` feature from `mach` which is obsoleted by these changes.

This has the effect of allowing us to install packages that cannot be vendored into a "common" place (namely the global `~/.mozbuild` `virtualenv`s) and use those from the build without requiring us to hit the network. Miscellaneous implementation notes:

1. We allow users to force running `mach` with the system Python if they like. For now it doesn't make any sense to require 100% of people to create these `virtualenv`s when they're allowed to continue on with the old behavior if they like. We also skip this in CI.

2. We needed to duplicate the global-argument logic into the `mach` script to allow for the dispatch behavior. This is something we avoided with the Python 2 -> Python 3 migration with the `--print-command` feature, justifying its use by saying it was only temporarily required until all `mach` commands were running with Python 3. With this change, we'll need to be able to determine the `mach` command from the shell script for the forseeable future, and committing to this forever with the cost that `--print-command` incurs (namely `mach` startup time, an additional .4s on my machine) didn't seem worth it to me. It's not a ton of duplicated code.

Differential Revision: https://phabricator.services.mozilla.com/D85916
2020-08-17 17:21:02 +00:00
Ricky Stewart 9719a9a5a9 Bug 1636797 - In `hash.py`, enumerate files from the VCS rather than searching the filesystem directly r=ahal
This resolves a long-standing issue in development where `mach artifact` (and therefore `mach bootstrap`) would fail unpredictably if you had dirty, but ignored, files in your checkout. Resolving this problem often required unwieldy `hg purge`/`git ignore` incantations that are easy to get wrong.

This patch addresses the problem by doing what we "should" have been doing all along, and consulting the VCS to list tracked files rather than listing EVERY file on disk and applying heuristics to determine whether they should be included in the hash.

Differential Revision: https://phabricator.services.mozilla.com/D86780
2020-08-17 15:19:34 +00:00
Ricky Stewart 7301a3d06b Bug 1659154 - Bad call to __init__ of Build object in mach ide after bug 985141 r=froydnj,dmajor
Differential Revision: https://phabricator.services.mozilla.com/D87103
2020-08-14 17:39:39 +00:00
Ricky Stewart 2eae41178a Bug 985141 - Allow mach commands to specify what virtualenv they should use. r=mhentges,dmajor
Now you can pass the `virtualenv_name` kwarg to the `Command` decorator which will configure the `_virtualenv_manager` accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D86256
2020-08-13 22:19:44 +00:00
Csoregi Natalia 8027f811c2 Backed out changeset 330b617b585c (bug 985141) for bustage and test info failures due to missing argument. CLOSED TREE 2020-08-14 01:09:29 +03:00
Ricky Stewart c3dc1fbe77 Bug 1658651 - When determining whether `virtualenv`s are up to date, don't take file size into account r=mhentges,ahal
This check is unsound; `virtualenv` binaries are apparently not guaranteed to have the same file size as the `python` binaries used to create those `virtualenv`s, at least not with our current vendored version of the `virtualenv` library on macOS. This is trivially reproducible on my own Macbook:

```
rickystewart-a5lvdq:mozilla-unified rickystewart$ rm -rf obj-x86_64-apple-darwin19.5.0/
rickystewart-a5lvdq:mozilla-unified rickystewart$ ./mach configure
...
rickystewart-a5lvdq:mozilla-unified rickystewart$ python3 -c 'import os; print(os.path.getsize("obj-x86_64-apple-darwin19.5.0/_virtualenvs/init_py3/bin/python"))'
16644  # <- ACTUAL VIRTUALENV SIZE
rickystewart-a5lvdq:mozilla-unified rickystewart$ python3 -c 'import os; print(os.path.getsize("/usr/local/opt/python/bin/python3.7"))'
17704  # <- SIZE OF THE PYTHON USED TO CREATE THE VIRTUALENV
```

Concretely, this was causing unit tests to be very aggressive about deleting the parent `init_py3` `virtualenv` repeatedly in unit tests, resulting in failures. The removal of this check fixes the issue.

Differential Revision: https://phabricator.services.mozilla.com/D86872
2020-08-13 19:29:54 +00:00
Ricky Stewart fcb0052827 Bug 985141 - Allow mach commands to specify what virtualenv they should use. r=mhentges,dmajor
Now you can pass the `virtualenv_name` kwarg to the `Command` decorator which will configure the `_virtualenv_manager` accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D86256
2020-08-13 18:26:07 +00:00
Mike Hommey d736c1381f Bug 1658853 - Make GnMozbuildWriter output more deterministic. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D86887
2020-08-13 13:20:04 +00:00
Mitchell Hentges 2e29bfb1f0 Bug 1658486: Don't re-install pipenv if "pipenv.exe" exists on Windows r=firefox-build-system-reviewers,rstewart
To check if pipenv is installed, the existing logic looked to see if the "pipenv" binary existed. However, on Windows, this binary is named "pipenv.exe".

Differential Revision: https://phabricator.services.mozilla.com/D86680
2020-08-11 18:43:51 +00:00
Mitchell Hentges 031dcb9d05 Bug 1657717: pipenv should use same version of python as currently active, if possible r=firefox-build-system-reviewers,rstewart
Pipenv enthusiastically checks pyenv for possible Python installations, and it seems to always want to use the most
up-to-date version possible. This can lead to issues if the version of python used for the regular venvs is older
than another version of python that exists on the machine (such as if the system python is 3.8.2, but pyenv has
3.8.3 installed).

This patch addresses this by scoping pipenv to match the currently-running version of python (if major versions line
up).

Differential Revision: https://phabricator.services.mozilla.com/D86448
2020-08-12 20:14:37 +00:00
Ricky Stewart f6051c3aa8 Bug 1658626 - When listing files from git in `mozversioncontrol`, ignore empty paths r=froydnj,mhentges
Without this patch, the last "path" in this list will always be the empty string due to how the `-z` option to `git` works. This mirrors what we already do in the `get_files_in_working_directory` implementation for `hg`.

Differential Revision: https://phabricator.services.mozilla.com/D86752
2020-08-12 00:10:43 +00:00
Ben Hearsum 9ece148d45 Bug 1607619: only run rusttests when rust files are modified. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D86434
2020-08-12 14:36:12 +00:00
Mitchell Hentges 710be25312 Bug 1655361: Prints a warning if Windows Defender is watching the Firefox checkout directory r=firefox-build-system-reviewers,rstewart
There's a Windows Defender CLI (`Get-MpComputerStatus`) available, but MozillaBuild
can't (easily) access PowerShell. So, instead, we find Windows Defender status and path exclusions
by checking the registry at HKLM\SOFTWARE\Microsoft\Windows Defender.

Determining if Windows Defender is "on" or not is a surprisingly vague task.
Not only does it encompass a lot of components (of which Ricky and I believe "Real-time protection"
is the part slowing down the build), but there's (at least?) two different kinds of "disabled"
states that it can be in:
* If "disabled" via Settings, it will turn itself back on after a reboot
* If an antivirus is installed, it will turn itself off permanently

Unfortunately, disabling "Real-time protection" in Settings doesn't affect any registry keys, but
I'm opting to ignore this because I doubt many users are manually disabling this protection before
each build. The repercussion of this is that users may be incorrectly warned "your Firefox
directory isn't excluded from Windows Defender!".

Focusing on the antivirus use case and querying the registry I found that:
* Querying the `IsServiceRunning` value wasn't sufficient because new Windows installations didn't have that key
* Querying the `DisableRealtimeMonitoring` value was inconsistent - it can be missing, and not always because an antivirus removed it
* Querying the `DisableAntiVirus` value doesn't _sound_ accurate (we care about Real-time Protection), but it's consistently "off" for non-AV machines, and "on" for machines with an AV installed. So, this is our winner!

TL;DR: there may be some "false positive" warnings about excluding the Firefox srcdir, but they're
accurate for my test cases and workaround-able (just add the exclusion to Windows Defender).

Also, this patch updates our Windows Defender docs to make them:
* More easily link-able
* Have direct advice to resolve the issue

Differential Revision: https://phabricator.services.mozilla.com/D85952
2020-08-11 20:59:40 +00:00
Ricky Stewart e6d1d2a4dd Bug 1656614 - Delete existing `virtualenv` before re-creating it r=mhentges,ahal
I wrote this patch because I noticed that the `.pth` files in my `objdir` `virtualenv`s were extremely repetitive, containing multiple references to the same directories. This happens because we [append](https://searchfox.org/mozilla-central/rev/03794edd6edcc3fc1e222de966cb27256ce08998/python/mozbuild/mozbuild/virtualenv.py#366) to the in-`virtualenv` `.pth` files when calling `populate()`, but we don't ever clean up the old ones, meaning that whenever we determine that the `virtualenv`s are out of date and need to be recreated, we actually leave A LOT of state lying around on-disk that is going to go on to impact further uses of the `virtualenv`. Concretely, how this manifested is that when I erroneously removed an entry from `virtualenv_packages.txt`, the build actually succeeded because that entry was still in the `.pth` file in the `virtualenv`; instead of "creating" a new `virtualenv` with the correct `.pth` files, it just appended the new `.pth` data to the old, stale data.

I've chosen to address this by completely deleting the entire `virtualenv` when we try to re-create it. Another way you might solve this problem is by doing a `find $VIRTUALENV -name '*.pth' | xargs rm` before doing the `virtualenv` re-creation, but I'm suggesting we do it this way because we have had a long history of difficulty with `virtualenv` persistence. Bug 1628498 is an obvious example; note that we would never have encountered that bug if we always unconditionally deleted the `virtualenv` before creating a new one, as in this patch. A patch that is laser-targeted at handling the issue with `.pth` files might be fine for now but this is more foolproof and future-proof.

Differential Revision: https://phabricator.services.mozilla.com/D85636
2020-08-07 15:35:27 +00:00
Tarek Ziadé 2909efb662 Bug 1650363 - Performance testing of HTTP3 in Firefox using only xpcshell tests r=michal,sparky
Differential Revision: https://phabricator.services.mozilla.com/D84021
2020-08-10 06:26:39 +00:00
Mike Hommey c9ae9101aa Bug 1651680 - Replace PKG_SKIP_STRIP with PKG_STRIP. r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D86648
2020-08-11 02:44:17 +00:00
Razvan Maries 6d82f7f1a0 Backed out 2 changesets (bug 1651680) for L10n bustages. CLOSED TREE
Backed out changeset 09a5f4dcd92a (bug 1651680)
Backed out changeset 13a881966dda (bug 1651680)
2020-08-11 05:40:47 +03:00
Mike Hommey 6714f1ec83 Bug 1651680 - Replace PKG_SKIP_STRIP with PKG_STRIP. r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D86648
2020-08-11 00:07:02 +00:00
Gregory Mierzwinski f87d8a4859 Bug 1657898 - Fix fenix artifact paths. r=jlorenzo,tarek
Differential Revision: https://phabricator.services.mozilla.com/D86351
2020-08-08 12:16:49 +00:00
Tarek Ziadé abb4969c3e Bug 1656235 - support visual metrics r=acreskey,sparky
Differential Revision: https://phabricator.services.mozilla.com/D85561
2020-08-08 12:17:48 +00:00
Tarek Ziadé 5a38472369 Bug 1651818 - fixed logger when runner is used directly r=acreskey
Differential Revision: https://phabricator.services.mozilla.com/D86305
2020-08-08 12:17:48 +00:00
Mitchell Hentges 7759de2362 Bug 1657719: Don't create init_py3_py3 venv in python-test r=firefox-build-system-reviewers,rstewart
To ensure that a python 3 virtualenv exists for tests, python-test will ensure that it's created (regardless of which version of python is currently in use).
However, the existing logic was incorrectly creating an "extra py3 virtualenv", even if currently running python 3 and having already created a "first" py3 virtualenv

Differential Revision: https://phabricator.services.mozilla.com/D86269
2020-08-07 22:11:41 +00:00
Ricky Stewart 31755b431d Bug 1657650 - Require that Mach command providers subclass MachCommandBase. r=remote-protocol-reviewers,marionette-reviewers,maja_zf,mhentges,froydnj
Today we don't require that `mach` `CommandProvider`s subclass from any particular parent class and we're very lax about the requirements they must meet. While that's convenient in certain circumstances, it has some unfortunate implications for feature development.

Today the only requirements that we have for `CommandProvider`s are that they have an `__init__()` method that takes either 1 or 2 arguments, the second of which must be called `context` and is populated with the `mach` `CommandContext`. Again, while this flexibility is occasionally convenient, it is limiting. As we add features to `mach`, having a better idea what the shape of our `CommandProvider`s are and how we can instantiate them and use them is increasingly important, and this gives us additional control when having `mach` configure `CommandProvider`s based on data that is only available at the `mach` level. In particular, we plan to leverage this in bugs 985141 and 1654074.

Here we add validation to the `CommandProvider` decorator to ensure all classes inherit from `MachCommandBase`, update all `CommandProvider`s in-tree to inherit from `MachCommandBase`, and update source and test code accordingly.

Follow-up work: we now require (de facto) that the `context` be populated with a `topdir` attribute by the `populate_context_handler` function, since instantiating the `MachCommandBase` requires a `topdir` be provided. This is fine for now in the interest of keeping this patch reasonably sized, but some additional refactoring could make this cleaner.

Differential Revision: https://phabricator.services.mozilla.com/D86255
2020-08-07 18:24:59 +00:00
Mitchell Hentges 7efb4ba7b0 Bug 1657677: Resolves FileNotFoundError when running python-test from PyCharm r=firefox-build-system-reviewers,rstewart
When subprocessing to get the venv from pipenv with PyCharm, the returned path has a command sequence to reset the terminal color.
This command sequence is unexpected, and causes the returned path to be incorrect.

The root issue is that colorama mistakenly believes that, if it's ever running underneath PyCharm, it's probably attached to a tty.
However, this assumption isn't true if PyCharm is running a script which subprocesses out a colorama-enabled script.
This issue has already been reported here: https://github.com/tartley/colorama/issues/263

To workaround this issue, we clear the "PYCHARM_HOSTED" environment variable when we invoke pipenv, which works around the colorama logic.

Differential Revision: https://phabricator.services.mozilla.com/D86242
2020-08-06 20:10:56 +00:00
Ricky Stewart 3ddb065650 Bug 1656611 - Remove `objdir` support from `virtualenv_packages.txt` handling r=mhentges,froydnj
I noticed that the `objdir:build` entry in `build/virtualenv_packages.txt` entry was apparently unused. This originates from bug 841713, seven years ago, when the `objdir` handling was introduced. Today, this doesn't appear to be serving a purpose. There is no Python library in my `$objdir/build` directory; nor can I see anything in `build/moz.build` or any related files suggesting one could ever appear. I can only assume this feature has outlived its usefulness, so delete it and the relevant in-tree support.

This necessitates slightly changing the signature and implementation of the `activate_pipenv()` method; also update all callers.

Differential Revision: https://phabricator.services.mozilla.com/D85635
2020-08-07 16:03:36 +00:00
Bogdan Tara 57ed67928b Backed out changeset 760fc38c793b (bug 1656611) for doc failure complaining about virtualenv_root CLOSED TREE 2020-08-07 18:57:56 +03:00
Ricky Stewart 41e473f17b Bug 1656611 - Remove `objdir` support from `virtualenv_packages.txt` handling r=mhentges,froydnj
I noticed that the `objdir:build` entry in `build/virtualenv_packages.txt` entry was apparently unused. This originates from bug 841713, seven years ago, when the `objdir` handling was introduced. Today, this doesn't appear to be serving a purpose. There is no Python library in my `$objdir/build` directory; nor can I see anything in `build/moz.build` or any related files suggesting one could ever appear. I can only assume this feature has outlived its usefulness, so delete it and the relevant in-tree support.

This necessitates slightly changing the signature and implementation of the `activate_pipenv()` method; also update all callers.

Differential Revision: https://phabricator.services.mozilla.com/D85635
2020-08-06 18:21:35 +00:00
Hamzah 8a86250605 Bug 1408051 - Remove mozharness' copy of virtualenv and use the one under /third_party/python instead r=ahal,rail
Differential Revision: https://phabricator.services.mozilla.com/D83181
2020-08-05 19:52:24 +00:00
Andrew Halberstadt bc270b20f5 Bug 1657604 - [mozlint] Support multiple linters per yaml file, r=linter-reviewers,sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D86206
2020-08-07 07:12:41 +00:00
Mike Hommey 5a5a1edd0e Bug 1656141 - Remove RESFILE. r=firefox-build-system-reviewers,rstewart
The resource file is always generated so being able to configure its name
is not useful. On the other hand, the way things are currently implemented,
the lack of RESFILE also makes RCFILE ignored, which we fix at the same
time.

And remove a spurious RESFILE in widget/windows/moz.build, where no binary
is produced, which means RESFILE had no meaning.

Differential Revision: https://phabricator.services.mozilla.com/D86154
2020-08-06 22:51:59 +00:00
Mihai Alexandru Michis c4e805857f Backed out 9 changesets (bug 1656141) for causing multiple failures.
CLOSED TREE

Backed out changeset 9033b0400339 (bug 1656141)
Backed out changeset e43dd57dc61a (bug 1656141)
Backed out changeset eb450457a9b7 (bug 1656141)
Backed out changeset 194a994cf9c9 (bug 1656141)
Backed out changeset ce6831acb5e3 (bug 1656141)
Backed out changeset 29653ea85d49 (bug 1656141)
Backed out changeset 704f28486bda (bug 1656141)
Backed out changeset de8899453150 (bug 1656141)
Backed out changeset 4b133eda46aa (bug 1656141)
2020-08-07 01:48:45 +03:00
Mike Hommey afe0ac845a Bug 1656141 - Remove RESFILE. r=firefox-build-system-reviewers,rstewart
The resource file is always generated so being able to configure its name
is not useful. On the other hand, the way things are currently implemented,
the lack of RESFILE also makes RCFILE ignored, which we fix at the same
time.

And remove a spurious RESFILE in widget/windows/moz.build, where no binary
is produced, which means RESFILE had no meaning.

Differential Revision: https://phabricator.services.mozilla.com/D86154
2020-08-06 15:59:02 +00:00
Dave Townsend 2e11494093 Bug 1653384: mach run should set MOZ_FORCE_DISABLE_E10S to the current application version. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D86240
2020-08-06 18:19:19 +00:00
Andi-Bogdan Postelnicu 992408f681 Bug 1627484 - clang cannot understanding the mixing of double and single quotes. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D70300
2020-08-06 07:54:09 +00:00
Andi-Bogdan Postelnicu 1ead43f591 Bug 1657299 - First step of refactor `static-analysis` integration, making it more modular. r=marco
Add a modular approach for the integration of `static-analysis` module in order
to be able to share components of it with other modules, like the integration of
`clangd` in `vscode` where we need to have access to the configuration of `clang-tidy`
in order to have `in-ide` `static-analysis` messages.
In this initial step we make a separate module for the clang-tidy configuration.

Differential Revision: https://phabricator.services.mozilla.com/D85979
2020-08-06 06:51:16 +00:00
Andi-Bogdan Postelnicu 9e73e83509 Bug 1657301 - Reformat `static-analysis` with `black`. r=sylvestre
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D85985
2020-08-05 13:32:46 +00:00
Andi-Bogdan Postelnicu 60cc6f8d69 Bug 1656740 - Integrate `clangd` in `vscode` for C++ language support. r=froydnj
In order to have a cross platform ide for C++ language support we've added `clangd`
extenssion and artifact part of `vscode` suite.
To generate the configuration you simply run:
`./mach ide vscode `.

Differential Revision: https://phabricator.services.mozilla.com/D85416
2020-08-06 06:25:17 +00:00
Mike Hommey 7347ccb900 Bug 1657446 - Fix co_lnotab for large offsets in Lint._raise_from. r=nalexander
Contrary to python2, python3 considers the values in cl_lnotab to be signed
integers, so with python3, offsets larger than 127 would be encoded in a way
that would make them wrong, or worse, negative.

Differential Revision: https://phabricator.services.mozilla.com/D86122
2020-08-06 04:07:14 +00:00
Mike Hommey d0d43d8f9b Bug 1657446 - Fix noise when running mozbuild/test/configure/lint.py with unittest.main. r=nalexander
Namely:
  build/moz.configure/old.configure:21: DeprecationWarning: invalid escape sequence \s
  build/moz.configure/old.configure:26: DeprecationWarning: invalid escape sequence \s
  python/mozbuild/mozbuild/configure/__init__.py:433: ResourceWarning: unclosed file <_io.BufferedReader...>
  python/mozbuild/mozbuild/configure/lint.py:120: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()

Differential Revision: https://phabricator.services.mozilla.com/D86121
2020-08-06 03:19:08 +00:00
Jim Porter 8e234c7598 Bug 1537763 - [mozproxy] Add a record mode; r=tarek
Differential Revision: https://phabricator.services.mozilla.com/D84399
2020-08-05 19:43:55 +00:00
Tom Ritter 66394143e9 Bug 1601690 - Remove gcc as a supported compiler for Windows r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D56046
2020-08-05 18:55:13 +00:00
Tom Prince 4585d70c82 Bug 1657217: Remove unused test binaries; r=firefox-build-system-reviewers,glandium
elfhack is unneeded after Bug 1645842  and filedid after Bug 1619840.

Differential Revision: https://phabricator.services.mozilla.com/D85924
2020-08-05 03:59:51 +00:00
Cosmin Sabou 12db94501a Backed out changeset 3dba9cbe665b (bug 1657217) for mass failures on windows. CLOSED TREE 2020-08-05 04:59:20 +03:00
Bogdan Tara abfa3262b8 Backed out changeset 1ccda1d0c3ea (bug 1650363) for causing a serious regression in packaging time 2020-08-05 04:23:20 +03:00
Tom Prince c8dfe8b2b0 Bug 1657217: Remove unused test binaries; r=firefox-build-system-reviewers,glandium
`elfhack` is unneeded after Bug 1645842 and `fileid` after Bug 1619840.

Differential Revision: https://phabricator.services.mozilla.com/D85924
2020-08-05 01:09:27 +00:00
Ricky Stewart 5bca67c689 Bug 1657198 - Delete broken tests in `test_telemetry.py` r=dmajor
These tests depend on the `mach uuid` command which was deleted with bug 1639509, and now that `mach uuid` is gone it's broken unconditionally. We could replace the reference to `uuid` with a new no-op `mach` command, but we're in the process of replacing our telemetry code with use of the `glean` API; and the new telemetry code won't have the same semantics (namely, we are unlikely to want to continue to guarantee that sub-`mach` invocations aren't covered by telemetry), so this test might as well just be deleted now.

Differential Revision: https://phabricator.services.mozilla.com/D85911
2020-08-04 20:03:01 +00:00
Hamzah b7e6b41fc5 Bug 1594914 - Convert mach python-test to run with python 3 r=gbrown
Differential Revision: https://phabricator.services.mozilla.com/D77872
2020-08-04 17:40:58 +00:00
Yue Zhang cb36d08ccc Bug 1630611 - Remove the nested helper function in the flat() function. r=sparky
Differential Revision: https://phabricator.services.mozilla.com/D85677
2020-08-04 17:15:40 +00:00
Sylvestre Ledru d61fa8949f Bug 1656764 - Relax the version check for clang-format r=andi DONTBUILD
So that it works when CLANG_VENDOR is set

Differential Revision: https://phabricator.services.mozilla.com/D85687
2020-08-03 12:41:15 +00:00
Tarek Ziadé 03cbd4d536 Bug 1650363 - Performance testing of HTTP3 in Firefox using only xpcshell tests r=sparky
Differential Revision: https://phabricator.services.mozilla.com/D84021
2020-08-02 17:28:57 +00:00
Gregory Mierzwinski a4e1ebe204 Bug 1656540 - Allow specifying perfherder settings on a per-metric basis. r=tarek
This patch fixes an issue where the metric settings were not being used because they don't use the test name. It also handles some changes (from a bad copy-paste) that didn't make it into the last live-site patch series.

Differential Revision: https://phabricator.services.mozilla.com/D85609
2020-08-01 16:13:28 +00:00
Mike Hommey 38cc2e0609 Bug 1654994 - Switch full symbols archive to tar.zst. r=firefox-build-system-reviewers,rstewart,tomprince
Differential Revision: https://phabricator.services.mozilla.com/D85252
2020-07-31 20:27:54 +00:00
Mike Hommey 36a8aaf1b4 Bug 1654994 - Support using .tar.zst symbol archives in mach artifact. r=nalexander,firefox-build-system-reviewers,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D85249
2020-07-31 10:01:52 +00:00
Mike Hommey 557b6e2811 Bug 1654994 - Support creating .tar.zst archives instead of .zip for symbol archives. r=firefox-build-system-reviewers,rstewart,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D85248
2020-08-01 05:33:05 +00:00
Mitchell Hentges d0ec90c4d5 Bug 1654074: Make @CommandProvider validation more specific r=firefox-build-system-reviewers,rstewart
@CommandProvider does parameter validation and collects information (such
as "pass_context") that will be needed by Registrar.

However, rather than just checking parameter length, we can make it more
specific and assert that the specific expected parameter ("context") exists.

Differential Revision: https://phabricator.services.mozilla.com/D85482
2020-07-30 22:25:05 +00:00
Yue Zhang 210c0b2307 Bug 1635930 - Activate a layer when its options are used. r=sparky,tarek
Differential Revision: https://phabricator.services.mozilla.com/D83551
2020-07-31 17:23:51 +00:00
Gregory Mierzwinski ee2aa57e5c Bug 1655031 - Fix how mozperftest metrics are parsed. r=tarek
Differential Revision: https://phabricator.services.mozilla.com/D85318
2020-07-31 15:33:12 +00:00
Gregory Mierzwinski d93acb6b75 Bug 1655032 - Add splitting functionality to metrics module. r=tarek
This patch adds the `--<LAYER>-split-by` option to the metric layers. It allows users to split the data they obtain using a given data field name. For instance, if `browserScripts.pageinfo.url` is provided, then the data will be split based on the unique URLs that are found.

Differential Revision: https://phabricator.services.mozilla.com/D84822
2020-07-30 23:12:28 +00:00
Dorel Luca 0226b8feef Backed out 6 changesets (bug 1654994) for build bustage on fuzzy builds. DONTBUILD
Backed out changeset cd3e1074b785 (bug 1654994)
Backed out changeset 45ee50e76d61 (bug 1654994)
Backed out changeset 77f1b667baec (bug 1654994)
Backed out changeset 9fca8b0bf8c1 (bug 1654994)
Backed out changeset 7131943d8db9 (bug 1654994)
Backed out changeset 435b90f6ca70 (bug 1654994)
2020-07-31 12:36:14 +03:00
Mike Hommey 311e167747 Bug 1654994 - Switch full symbols archive to tar.zst. r=firefox-build-system-reviewers,rstewart,tomprince
Differential Revision: https://phabricator.services.mozilla.com/D85252
2020-07-30 22:21:28 +00:00
Mike Hommey 1bf0ac0aca Bug 1654994 - Support using .tar.zst symbol archives in mach artifact. r=nalexander,firefox-build-system-reviewers,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D85249
2020-07-30 15:53:26 +00:00
Mike Hommey ddea6bd3ce Bug 1654994 - Support creating .tar.zst archives instead of .zip for symbol archives. r=firefox-build-system-reviewers,rstewart,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D85248
2020-07-30 15:52:51 +00:00
Mitchell Hentges d3dfb78af4 Bug 1656303: Only print $A_SPECIFIC_TARGET warning if one of the targets is not in the allowlist r=firefox-build-system-reviewers,rstewart
The "what" value contains a list of build targets, the warning should be printed if any one of the targets is unexpected.

Differential Revision: https://phabricator.services.mozilla.com/D85462
2020-07-30 19:38:42 +00:00
Mike Hommey f70f000a4f Bug 1614626 - Move xpcshell selftests to before running actual xpcshell tests. r=gbrown
This allows to test them in the exact same environment as the tests are
going to run, which turns out to have revealed a few issues that would
only appear once xpcshell tests fail, impeding on debugging those
failures.

Differential Revision: https://phabricator.services.mozilla.com/D84781
2020-07-30 20:27:14 +00:00
Ricky Stewart 63f010c613 Bug 1646406 - Distinguish between user errors and actual reportable exceptions in `mach` r=mhentges,froydnj
Add a new `UserError` class which when thrown doesn't get reported to Sentry.

Differential Revision: https://phabricator.services.mozilla.com/D85026
2020-07-29 21:34:17 +00:00
Tarek Ziadé cb00bce720 Bug 1655956 - removed unused perf tuning code r=sparky
Removes unused API and add missing coverage

Differential Revision: https://phabricator.services.mozilla.com/D85285
2020-07-29 17:35:35 +00:00
Csoregi Natalia b0e102995f Backed out 2 changesets (bug 1646406, bug 1655529) for geckoview failures. CLOSED TREE
Backed out changeset 0630f4154c62 (bug 1655529)
Backed out changeset 18d42084d135 (bug 1646406)
2020-07-30 00:28:59 +03:00