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

10116 Коммитов

Автор SHA1 Сообщение Дата
Chris Peterson 0d93eda754 Bug 1738401 - Remove -Wshadow-uncaptured-local warning flag. r=firefox-build-system-reviewers,andi
I enabled -Wshadow-uncaptured-local warnings in bug 1718408 because the flag didn't report any -Wshadow-uncaptured-local warnings. Unfortunately, clang didn't report any warnings due to clang bug https://bugs.llvm.org/show_bug.cgi?id=52325: clang -Wshadow-uncaptured-local (and some other -Wshadow*) flags doesn't actually enable these warnings; they're only enabled by the meta flags -Wshadow and -Wshadow-all.

I see now that there are over 500 -Wshadow-uncaptured-local warnings, too many to realistically fix them all, so we should remove -Wshadow-uncaptured-local.

The -Wshadow-field-in-constructor-modified flag is also affected by the clang bug, but I'd like to keep setting the -Wshadow-field-in-constructor-modified flag in case the clang bug is ever fixed. There are no -Wshadow-field-in-constructor-modified warnings in mozilla-central; I fixed the last one in bug 1738400.

Differential Revision: https://phabricator.services.mozilla.com/D132290
2021-12-01 06:40:05 +00:00
Mike Hommey a90ac64587 Bug 1743708 - Fix clang-plugin tests to pass with clang-trunk. r=andi
This upstream change[1] changed the error messages when arrays are
involved, so we adjust the expected-errors/expected-notes to account for
that.

1. aee4925507

Differential Revision: https://phabricator.services.mozilla.com/D132533
2021-12-01 06:28:02 +00:00
Mike Hommey a3f67c9a7c Bug 1743536 - Don't set GCC_USE_GNU_LD when using lld on mac. r=firefox-build-system-reviewers,mhentges
In that case, lld's interface is ld64's not GNU's.

Differential Revision: https://phabricator.services.mozilla.com/D132454
2021-11-30 21:55:49 +00:00
Agi Sferro 79940ac0dd Bug 1740358 - Download Java from adoptium. r=mhentges,glandium
We already use the adoptopenjdk on some platforms, this allows us to have a
more predictable Java binary on all platforms.

Differential Revision: https://phabricator.services.mozilla.com/D130878
2021-11-30 16:10:59 +00:00
Mitchell Hentges 6571032077 Bug 1739067: Scope Mach virtualenv to be checkout-specific r=perftest-reviewers,ahal,sparky
Build and run the Mach virtualenv from a `state_dir` that is
"specific-to-topsrcdir".

As part of this, move `get_state_dir()` to `mach` so that it's usable
before `sys.path` entries are fully set up.

Differential Revision: https://phabricator.services.mozilla.com/D130383
2021-11-29 22:33:54 +00:00
Rob Lemley 3b62e0f6b3 Bug 1731158 - Allow initializing mach from a Thunderbird source repo. r=firefox-build-system-reviewers,mhentges
mach will initialize from comm/build/mach_initialize.py if it's present.
See bug 1731160. The initialization function wraps the one in build/mach_initialize.py,
then extends sys.path and loads more mach_commands.py files

Differential Revision: https://phabricator.services.mozilla.com/D131869
2021-11-29 18:34:58 +00:00
Christian Holler 6110156f18 Bug 1738278 - Add fuzzing snapshot API. r=truber,firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D129823
2021-11-25 11:20:43 +00:00
Mike Hommey 21c8cb7ed7 Bug 1696504 - Bump macOS builds to SDK 11.0. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D131588
2021-11-24 22:47:43 +00:00
Mitchell Hentges abeedf3bbd Bug 1717051: Automatically create and activate Mach virtualenv r=ahal
Consolidate Mach virtualenv management to the front of the
Mach process. This obsoletes `./mach create-mach-environment`
and simplifies the `sh` portion of the top-level `./mach` script.

This helps ensure that the Mach virtualenv doesn't become
out-of-sync and simplifies the mental model of the Mach
virtualenv situation.

Differential Revision: https://phabricator.services.mozilla.com/D120401
2021-11-24 20:06:33 +00:00
Mitchell Hentges 144daeecaf Bug 1731836: Simplify `./mach python` arguments r=ahal
`--no-virtualenv` was needed for one use case: the
`get_and_diffoscope` task, despite not needing `psutil`, would
run into failures during virtualenv-creation because we used to
unconditionally build the `psutil` package, and `get_and_diffoscope`
didn't have the environment needed for such a build.

Since we no longer build and install `psutil` into every virtualenv,
it's no longer needed for its one usage, which means that it can be
removed.

`--requirements` is replaced by `--virtualenv`, which removes an
ad-hoc pip package installation and embraces the centralized dep
system.

`--no-activate` is now implied by default: a virtualenv is only
created and activated if `--virtualenv` is provided.`

`ipython==7.16.1` was the chosen version because it is the last
one compatible with Python 3.6.

Differential Revision: https://phabricator.services.mozilla.com/D131529
2021-11-24 20:06:33 +00:00
Mitchell Hentges cea54423c4 Bug 1738848: Handle virtualenv case where metadata file is missing r=ahal
At Mach initialization time, it needs to know if it's not running from
the Mach virtualenv so it can decide to insulate itself from the
external sys.path.

However, the current mechanism of detecting the Mach virtualenv
struggles if the venv is old, and therefore missing its metadata file.
In such a case, it's recognized as "not the Mach venv" rather than "an
out-of-date Mach venv".

As part of this, I'm realizing that simply using the metadata file as a
"virtualenv has finished building" marker is insufficient, because it
will cause similar confusion here. This is solved with a "finalization"
key in in the metadata.

Differential Revision: https://phabricator.services.mozilla.com/D130794
2021-11-24 20:06:31 +00:00
Shravan Narayan a5aa14d7ac Bug 1742851 - Temporarily increase timeout for automation valgrind run r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D132067
2021-11-24 19:19:31 +00:00
Mitchell Hentges b61d7dd71f Bug 1732946: Update vendored libraries for `black` compatibility r=ahal
This is needed because `black==21.11b1` requires `click>=7.1.2`
`pathspec<1,>=0.9.0`, and `typing-extensions>=3.10.0.0`.

Differential Revision: https://phabricator.services.mozilla.com/D127163
2021-11-24 15:23:49 +00:00
Mike Hommey ef3f58e380 Bug 1736970 - Apply 2 clang upstream fixes for reproducibility and revert one. r=andi
The revert doesn't have a lot of impact, as it's only for debug info
about enums with a 128-bits integer representation.

Differential Revision: https://phabricator.services.mozilla.com/D132001
2021-11-24 07:07:48 +00:00
Butkovits Atila 8625ba46e5 Backed out changeset 6a2e62e9cc99 (bug 1732946) for causing failures at test_vendor.py. CLOSED TREE 2021-11-24 05:03:12 +02:00
Mike Hommey 1263f84c42 Bug 1741454 - Revert clang's D100879. r=andi
It assumes 16-bytes alignment for small allocations on 64-bits, which is
not true for mozjemalloc allocations.
This only addresses the problem with mozilla.org-produced builds. We may
have to figure out something for downstreams.

Differential Revision: https://phabricator.services.mozilla.com/D131883
2021-11-24 02:38:06 +00:00
Mitchell Hentges 9e5e6e2e0f Bug 1732946: Update vendored libraries for `black` compatibility r=ahal
This is needed because `black==21.11b1` requires `click>=7.1.2`
`pathspec<1,>=0.9.0`, and `typing-extensions>=3.10.0.0`.

Differential Revision: https://phabricator.services.mozilla.com/D127163
2021-11-23 23:46:33 +00:00
Marian-Vasile Laza 376fd53683 Backed out changeset a899281204c7 (bug 1696504) for causing GTest failures. 2021-11-23 11:51:05 +02:00
Mike Hommey 9caeaefc7d Bug 1696504 - Bump macOS builds to SDK 11.0. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D131588
2021-11-23 02:29:31 +00:00
Mike Hommey a154421f99 Bug 1740042 - Use llvm-readelf instead of readelf when available. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D130949
2021-11-23 02:28:18 +00:00
Alexandre Lissy 60d10601bb Bug 1726804 - Refactor definition and usage of GECKO_PROCESS_TYPE() r=nika,firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D121388
2021-11-19 14:02:55 +00:00
Alexandru Michis 2cb5b32d02 Backed out 2 changesets (bug 1726804) for causing sm bustages in geckoprocesstypes.
CLOSED TREE

Backed out changeset bf7f73fd1921 (bug 1726804)
Backed out changeset c9936f7534cb (bug 1726804)
2021-11-19 11:40:59 +02:00
Alexandre Lissy b71c7b7255 Bug 1726804 - Refactor definition and usage of GECKO_PROCESS_TYPE() r=nika,firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D121388
2021-11-19 08:33:42 +00:00
Benjamin Beurdouche 9d4b719a04 Bug 1738222 - land NSS 4b8ce9641338 UPGRADE_NSS_RELEASE, r=jschanck
Differential Revision: https://phabricator.services.mozilla.com/D131519
2021-11-18 18:55:20 +00:00
Mike Hommey 434ed28445 Bug 1736502 - Work around clang trunk changes that break our clang-trunk build. r=andi
Short of solving this by fully embracing the monorepo build and removing
the projects/ workarounds (which will also require a compat more with
older clang versions we still build with the same script), we can solve
the bustage with a small hack.

Differential Revision: https://phabricator.services.mozilla.com/D131458
2021-11-18 06:43:03 +00:00
Mitchell Hentges 84e16b0d9c Bug 1730712: Split site manager into command and mach managers r=ahal
The command site manager needs to be able to do ad-hoc pip
installations, while the Mach site manager needs to manage
the system `sys.path` and conditionally create an on-disk
virtualenv.

By splitting the class into two, we can now give each use case the
attention it deserves.

Differential Revision: https://phabricator.services.mozilla.com/D129529
2021-11-17 20:54:27 +00:00
Mitchell Hentges 876c31175a Bug 1730712: Remove pip package check in site.up_to_date() r=ahal
Sorry for the flip-flop on technique here :S

`validate_environment_packages()` was originally run when checking if a
site is up-to-date to ensure that ad-hoc pip installs didn't replace
needed packages with those of different versions.

However, since it was added, a few notes have come up:
1. The case where requirements change isn't caught by this - that is
  caught earlier by the cheap "a requirements file has changed on-disk"
  check.
2. This is really slow, and doing it for most Mach commands is not worth
  it (as evident by how the `skip_pip_package_check` was already added
  for the Mach site's use case).
3. Since the tree as-is doesn't have (common) cases where ad-hoc
  installations break an environment, then this check, though helpful,
  isn't adding a significant amount of value considering its performance
  cost.

However, these aren't to say that this won't be valuable in the future:
I'd like to reach a point where sites are considered "sealed" by
default: no ad-hoc pip installations are allowed.
However, add the ability to mark sites as unsealed/"allowing
ad-hoc pip installations". Then, re-add the pip package check, but only
for such flexible, unsealed virtualenvs.

Differential Revision: https://phabricator.services.mozilla.com/D129692
2021-11-17 20:54:26 +00:00
Mitchell Hentges eebabfffe5 Bug 1730712: Split on-disk venv logic from `MozSiteManager` r=ahal
The current inheritance-based separation between "general venv
details" (`VirtualenvHelper`) and moz site details
(`MozSiteManager`) has caused `MozSiteManager` to care
about too many details.

This patch splits things apart a little more:
* The term `VirtualenvHelper` isn't _super_ useful, rename it to
  `PythonVenv` to show that it represents a Python virtualenv.
* Move on-disk virtualenv logic (`activate_path` location,
  `site-packages` location, `pip install` behaviour) into a
  contained `MozVirtualenv` class.
* Port the inheritance to a "composition" model instead.

Differential Revision: https://phabricator.services.mozilla.com/D129685
2021-11-17 20:54:23 +00:00
Mitchell Hentges 725792bd05 Bug 1730712: Update "Moz site" terminology r=ahal
The existing terminology had two issues:
* `VirtualenvManager` wasn't always associated with an on-disk
  `virtualenv`: for example, when running in automation, Mach
  "activates" a `VirtualenvManager`, updating its import scope,
  but without ever creating an on-disk `virtualenv`.
* An upcoming patch splits the `VirtualenvManager` class, pulling
  "on-disk virtualenv-handling functions" from the project-wide
  interface for managing Python's import scope.

After some good discussion with Ahal, I think we've struck
the terminology that handles this distinction well: we'll call
the "import scope"-handling part the "site", and we'll continue
to call on-disk virtualenvs (and their representative classes)
as, well, virtualenvs.

Differential Revision: https://phabricator.services.mozilla.com/D130391
2021-11-17 20:54:23 +00:00
Sylvestre Ledru 1df999712f Bug 1714788 - doc: do not provide the language if the code isn't valid r=firefox-source-docs-reviewers,championshuttler DONTBUILD
Otherwise, the warning is displayed:
```
WARNING: Could not lex literal_block as "json". Highlighting skipped.
```

Depends on D131092

Differential Revision: https://phabricator.services.mozilla.com/D131093
2021-11-16 07:59:48 +00:00
Marian-Vasile Laza 25a09c0d08 Backed out changeset 561c776bea20 (bug 1740042) for causing build bustages on llvm-readelf. 2021-11-16 02:51:16 +02:00
Mike Hommey 5459f879e5 Bug 1740042 - Use llvm-readelf instead of readelf when available. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D130949
2021-11-15 22:48:34 +00:00
Marian-Vasile Laza 51e3255d7c Backed out changeset bf55cb5e6b45 (bug 1740042) for causing build bustages. CLOSED TREE 2021-11-15 22:54:31 +02:00
Mike Hommey 2c9074abb8 Bug 1740042 - Use llvm-readelf instead of readelf when available. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D130949
2021-11-15 20:41:41 +00:00
Mike Hommey 3b96b9af59 Bug 1738300 - Apply clang upstream patch fixing miscompilation. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D130428
2021-11-09 04:17:57 +00:00
Mike Hommey 92de67f82d Bug 1739543 - Remove unused clang toolchain configs. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D130424
2021-11-08 21:25:53 +00:00
Kershaw Chang 1b01ccfacd Bug 1392272 - P1: [windows] Monitor system proxy changes, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D127724
2021-11-08 09:00:26 +00:00
Chris Peterson 6ff807852e Bug 1737217 - Enable -Wunused-but-set-parameter warnings on clang. r=firefox-build-system-reviewers,glandium
But don't enable on gcc because it reports false positives, such as:

js/src/jsapi-tests/testJitABIcalls.cpp:445:61: warning: parameter 'lineno' set but not used [-Wunused-but-set-parameter]
js/src/jsapi-tests/testJitABIcalls.cpp:461:56: warning: parameter 'base' set but not used [-Wunused-but-set-parameter]

Even though those parameters are used here:

https://searchfox.org/mozilla-central/source/js/src/jsapi-tests/testJitABIcalls.cpp#445,450,461,464

Differential Revision: https://phabricator.services.mozilla.com/D129351
2021-11-06 16:58:51 +00:00
Mitchell Hentges 4d5f166b49 Bug 1730712: Use consistent Python version throughout configure r=andi
It's possible for the `PYTHON3` config to point to a different Python
than that that is executing the configure scripts themselves.

This flexibility was needed for the Python 2->3 migration, but now that
it's complete, we can remove the extra configuration and just lean on
the Python interpreter used to run configure.

Differential Revision: https://phabricator.services.mozilla.com/D129863
2021-11-04 21:41:33 +00:00
Mitchell Hentges 67be954a8c Bug 1739177: Add `requirements.pths_as_absolute()` r=ahal
There were a bunch of locations where we were doing path shenanigans
with `requirements.pth/.vendored` items.

There was a bit of complexity because we were specifically making each
`pthfile` line be a relative path to support moving the Firefox
topsrcdir without causing issues.

However, now that we're more intelligent about checking if `pthfile`
lines are up-to-date (and since moving your topsrcdir will still require
re-generating the Mach virtualenv), this behaviour became less useful.

So, generalize `MachEnvRequirements` -> "sys.path lines" logic and
reuse it everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D129693
2021-11-04 14:35:08 +00:00
Niklas Goegge 5ef444d868 Bug 1732069: Consider loopback origin for Sec-Fetch-Site: same-site r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D129152
2021-11-04 08:56:29 +00:00
Alex Hochheiden d7aba7ba43 Bug 1686137 - Vendor 'colorama' library r=mhentges, g?firefox-build-system-reviewers
Colorama enables colored text on terminal windows.

'tqdm' depends on Colorama on Windows.

Project Link: https://pypi.org/project/colorama/

Depends on D129094

Differential Revision: https://phabricator.services.mozilla.com/D130121
2021-11-03 15:41:14 +00:00
Alex Hochheiden 5eab6210dd Bug 1686137 - Vendor 'tqdm' progress bar library r=mhentges
`tqdm` allows rendering and updating a single-line progress bar, which
is useful for all sorts of different work.

Our first use case for this will be replacing `wget` with a pure-python
downloader.

Source here: https://github.com/tqdm/tqdm

Differential Revision: https://phabricator.services.mozilla.com/D129094
2021-11-03 15:41:13 +00:00
Sebastian Hengst 22d3b81141 Merge mozilla-central to autoland. CLOSED TREE 2021-11-01 23:06:15 +01:00
Mitchell Hentges 973f0aa262 Bug 1730712: Remove customizeable log handle from VirtualenvManager r=ahal
The optional `log_handle` argument was only used by:

* Configure, but the output was always dumped to stdout and *not*
  `config.log`. The manual logging _was_ used to handle encoding issues,
  but those are likely invalidated by the Python 3 migration.
* `./mach doc`, where we were putting virtualenv setup into stderr,
  which seems incorrect. The commit adding it doesn't explain why it's
  the case, but I'm guessing it shouldn't be too risky to remove.

Additionally, `log_handle` was used very inconsistently: for example,
running `install_pip_package()` would _not_ use `log_handle`.
So, removing `log_handle` removes a bit of abstraction leakage.

Differential Revision: https://phabricator.services.mozilla.com/D129298
2021-11-01 21:34:05 +00:00
Mitchell Hentges 8d7a1cbad4 Bug 1730712: Remove redundant Python version check in configure r=glandium
Mach already verifies the Python version during initialization.

Maintaining a second version check can be tough to keep up-to-date, as
we're already seeing due to the obsolete Python 2 check.

Differential Revision: https://phabricator.services.mozilla.com/D129297
2021-11-01 21:34:05 +00:00
Mitchell Hentges 162c7ab422 Bug 1732946: Vendor pip/setuptools/wheel instead of installing into venv r=ahal
Now that are prioritizing system over virtualenv site-packages, the
system `pip` is sometimes being used instead.
This is causing issues when the system pip is set up in a
distro-specific way, such as when "debundled":
https://github.com/pypa/pip/blob/9.0.1/pip/_vendor/__init__.py#L53-L61

However, if we vendor `pip`, `setuptools` and `wheel`, and ensure that
they're prioritized in the `sys.path` before anything is imported from
the system, then we can ensure that we're using a modern `pip` _and_
sidestep system-specific pip weirdness.

Note that `pip-compile`'s `--allow-unsafe` flag is not as dangerous as
it sounds.
There's confusion among maintainers about its origin:
https://github.com/jazzband/pip-tools/issues/522
Additionally, it's going to be enabled by default in a future
`pip-tools` release. So, it's not scary for us to embrace here.

Also, heads up that the "pip outdated warning" no longer needs
to be manually silenced, since pip avoids that code path when
not running from an "installed" context.

Differential Revision: https://phabricator.services.mozilla.com/D127182
2021-11-01 21:34:03 +00:00
Mitchell Hentges a9f396324f Bug 1717051: Always populate Mach pths r=firefox-build-system-reviewers,glandium
The previous behaviour was to:
* Never add a `pthfile` to the Mach virtualenv, and
* Always add Mach's paths to the `sys.path` when Mach initializes

However, this meant that `pip` would needlessly install packages
that already exist in the vendored environment.

Tweak `pth` behaviour so that `pip` behaves more efficiently.

Differential Revision: https://phabricator.services.mozilla.com/D120402
2021-11-01 21:34:03 +00:00
Mitchell Hentges 537d201bcc Bug 1732948: Assert that the Mach venv isn't out-of-date during init r=ahal
As we leverage the Mach environment more, it becomes increasingly
important that it isn't out-of-date on developer machines.

Add an `up_to_date()` check during Mach initialization.
To minimize the cost to startup, I'm skipping the "pip list" check.

This change required moving `virtualenv` from `mozbuild` to `mach` to
make it available during the early stage of Mach init.

Differential Revision: https://phabricator.services.mozilla.com/D127144
2021-11-01 21:34:02 +00:00
Mike Hommey afa259dd74 Bug 1738163 - Normalize mozbuild state path to a shortpath on Windows. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D129774
2021-10-28 09:33:27 +00:00