Commit Graph

4551 Commits

Author SHA1 Message Date
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
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
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
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
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
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 virtualenvs 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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