Commit Graph

4245 Commits

Author SHA1 Message Date
Nathan Froyd
35647659d4 Bug 1637665 - make mach run work with the JS shell on OS X; r=firefox-build-system-reviewers,rstewart
We need to skip the xulrunner/browser code (do we even support xulrunner
anymore?) for `--enable-application=js` builds.  `MOZ_WIDGET_TOOLKIT` is
used elsewhere to check for "browserness".

Differential Revision: https://phabricator.services.mozilla.com/D75140
2020-05-13 16:55:55 +00:00
Ricky Stewart
8bfe989824 Bug 1634391 - Include more specific instructions than "consult a build peer" in Mozbuild comments/error messages r=froydnj
The official decision appears to be that we want people to ask questions in the build channel on chat.mozilla.org for queries that require build peer approval, as opposed to emailing specific people directly, filing bugs, etc. Rather than the vague "consult a build peer" suggestion currently in the code, specify exactly what we expect people to do in mozbuild.

Differential Revision: https://phabricator.services.mozilla.com/D74963
2020-05-13 13:40:53 +00:00
Jon Bauman
2bec40dcfe Bug 1637144 - Syntax for different moz.build paths is undocumented. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D74799
2020-05-12 17:33:47 +00:00
Ricky Stewart
f46e54c22a Bug 1636797 - Improve error message when artifacts cannot be downloaded r=froydnj
The current error message leaves you with basically no recourse besides filing a bug if you're already at the latest HEAD. Meanwhile, `mach clobber` will fix it but in doing so you're taking a very blunt sledgehammer to the problem. Instead, I've updated this error message to tell you you can `mach clobber python`. I also removed the explicit reference to "artifact builds" because you can encounter this error outside of artifact builds as well. Finally, I added another reminder that `mach bootstrap` and `mach artifact` don't work for old revisions of central because I keep getting bugs about it and more screaming about how it's unsupported can't hurt.

Differential Revision: https://phabricator.services.mozilla.com/D74732
2020-05-11 20:44:30 +00:00
Mitchell Hentges
b8108d6064 Bug 1632429: Migrate |./mach try| to python 3; r=rstewart,ahal
|./mach try| subcommands are now compatible with both python 2 and 3.

Hand-tested with many combinations of subcommand and subcommand flags.

Updates tryselect unit tests to use Python 3.

Differential Revision: https://phabricator.services.mozilla.com/D73398
2020-05-06 22:17:14 +00:00
Jonathan Watt
e9737ef887 Bug 1636265. Fix the Eclipse CDT build backend (broken by the switch to Python 3). r=botond
Python 3 doesn't allow strings to be written to files opened in binary mode
(it requires a byte array in that case).  As it happens, we should really be
opening these Eclipse config files in text mode since it seems on Windows the
files use Windows line ending characters.  So rather than change the strings
to byte arrays, this patch simply changes the code to open the files in text
mode.

Differential Revision: https://phabricator.services.mozilla.com/D74318
2020-05-08 16:26:35 +00:00
Mitchell Hentges
2e71833471 Bug 1636209: resolves tests that were incorrectly marked as xfail r=tomprince
When handling bug 1632429, I found some tests that worked on Python 2, but not Python 3.
They were marked accordingly as "expected failures". However, my system version of Python
is 3.8, while CI (and a non-trivial number of devs, probably) use 3.6.

Some of these tests marked as xfail were actually still working on versions of Python until 3.8.

The failure of this test was due to a change in default tarfile format. Explicitly setting this
format makes the tests pass in all relevant python versions.

Differential Revision: https://phabricator.services.mozilla.com/D74337
2020-05-07 23:41:35 +00:00
Axel Hecht
509e84e17b Bug 1635481, workaround python and virtualenv, r=firefox-build-system-reviewers,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D74207
2020-05-07 15:38:14 +00:00
Ricky Stewart
933b3522b8 Bug 1633156 - Don't emit cached table files from ply r=glandium
`ply`, [by design](https://github.com/dabeaz/ply/issues/79), does not produce reproducible table files; hence bug 1633156. (Note that this was *always* true, but only became a problem once we switched to Python 3, which has more unpredictable dict iteration order than Python 2.7, at least prior to [3.7](https://docs.python.org/3/whatsnew/3.7.html#summary-release-highlights).)

In any other circumstance I would consider submitting a patch to `ply` to fix this, but as of the [in-progress version 4.0 of the library](https://github.com/dabeaz/ply/blob/master/CHANGES), it doesn't even emit this cached data any more, and indeed the [latest version of the code](1fac9fed64/ply) doesn't even call `open()` at all except to do logging or to read the text data to be parsed from `stdin`. So if we were going to pin our future on `ply` and upgrade to later versions of the library in the future, we would have to live in a world where `ply` doesn't generate cached table files for us anyway.

Emitting the cached table files so later build steps can consume them is an "optimization", but it's not clear exactly how much actual value that optimization provides overall. Quoth the `CHANGES` file from that repository:

```
PLY no longer writes cached table files.  Honestly, the use of
the cached files made more sense when I was developing PLY on
my 200Mhz PC in 2001. It's not as much as an issue now. For small
to medium sized grammars, PLY should be almost instantaneous.
```

In practice, I have found this to be true; namely, `./mach build pre-export export` takes just about as long on my machine after this patch as it did before, and in a try push I performed, there's no noticeable performance regression from applying this patch. In local testing I also found that generating the LALR tables in calls to `yacc()` takes about 0.01s on my machine generally, and we generate these tables a couple dozen times total over the course of the `export` tier now. This isn't *nothing*, but in my opinion it's also not nearly long enough where it would be a concern given how long `export` already takes.

That `CHANGES` file also stresses that if caching this data is important, we have the option of doing so via `pickle`. If and when we decide that re-enabling this optimization is valuable for us, we should take control of this process and perform the generation in such a way that we can guarantee reproducibility.

Differential Revision: https://phabricator.services.mozilla.com/D73484
2020-05-07 00:39:28 +00:00
Ricky Stewart
7fa6493c9c Bug 1635585 - Run compilation/test_warnings.py under Python 3 r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D73970
2020-05-06 19:36:57 +00:00
Andi-Bogdan Postelnicu
94b15f6444 Bug 1635795 - Activate virtualenv for mach static-analysis. r=rstewart,marco
Differential Revision: https://phabricator.services.mozilla.com/D74058
2020-05-06 16:47:15 +00:00
Nathan Froyd
68154b269c Bug 1635229 - output relative paths in XPIDL-generated source files; r=asuth,glandium,mccr8
We currently generate absolute paths in all of our XPIDL-generated
source files, which is not so great for several reasons (deterministic
generation of files across machines, Searchfox analysis logic, shared
compilation caches, etc.).  Let's generate paths that still indicate
where you should be looking, but are identical across compilations,
objdirs, etc.

Differential Revision: https://phabricator.services.mozilla.com/D73747
2020-05-06 10:56:58 +00:00
Mike Hommey
435b446654 Bug 1634204 - Bump glibc and libstdc++ runtime requirement to resp. 2.17 and 3.4.19 (4.8.1). r=froydnj
Combined with the upcoming upgrade of the build environment to Debian 8,
which is also going to upgrade the Gtk+3 requirement to 3.14, of the
major Linux distros Firefox currently supports running on, this removes
runtime support for:
- Fedora 20 and earlier (EOLed in 2015),
- OpenSUSE 13.1 and earlier (EOLed in 2016),
- Debian 7 (EOLed in 2018),
- Ubuntu 14.04 (EOLed in 2019).

Some of them might actually be supported in practice because the Gtk+3
requirement might be more relaxed than 3.14, but figuring that out is not
worth the effort.

Differential Revision: https://phabricator.services.mozilla.com/D73783
2020-05-06 02:41:20 +00:00
Mike Hommey
5cef88b2f1 Bug 1634204 - Allow newer versions of symbols if they are weakly linked. r=froydnj
We currently check that the binaries we ship are not using symbol
versions of system libraries that would not be available on some older
systems. In some cases, however, we may get dependencies on newer symbol
versions in the form of weak symbols, that are checked for at runtime.
This happens with __cxa_thread_atexit_impl when building against a glibc
newer than 2.18, and the supporting code in Rust libstd actually checks
at runtime whether the weak symbol is resolved before using it.

Differential Revision: https://phabricator.services.mozilla.com/D73782
2020-05-06 02:00:13 +00:00
Csoregi Natalia
5da0fac6d9 Backed out changeset eb1b773902c3 (bug 1635229) for bustages on xpidl/runtests.py. CLOSED TREE 2020-05-06 05:05:41 +03:00
Nathan Froyd
c2d1969d66 Bug 1635229 - output relative paths in XPIDL-generated source files; r=asuth,glandium,mccr8
We currently generate absolute paths in all of our XPIDL-generated
source files, which is not so great for several reasons (deterministic
generation of files across machines, Searchfox analysis logic, shared
compilation caches, etc.).  Let's generate paths that still indicate
where you should be looking, but are identical across compilations,
objdirs, etc.

Differential Revision: https://phabricator.services.mozilla.com/D73747
2020-05-06 01:35:30 +00:00
Ricky Stewart
0015091b18 Bug 1633039 - Don't check for Python 2 in configure r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D72895
2020-05-05 16:02:02 +00:00
Ricky Stewart
56c10c5aa2 Bug 1633037 - Remove all remaining references to $(PYTHON) across Makefiles r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D72894
2020-05-05 20:32:23 +00:00
Ricky Stewart
4d4b22b3de Bug 1599658 - Delete previous definition of py_action in Makefiles. Now py_action calls into Python 3 and py3_action doesn't exist. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D72487
2020-05-05 20:04:30 +00:00
Ricky Stewart
fd72a5d35e Bug 1633016 - Remove a bunch of references to PYTHON(2) in Makefiles r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D72479
2020-05-05 19:53:22 +00:00
Ricky Stewart
3749c34fb4 Bug 1632916 - Run JS/web-platform/ipdl build machinery in Python 3 r=jgraham,nika,glandium
Differential Revision: https://phabricator.services.mozilla.com/D72478
2020-05-05 20:32:12 +00:00
Ricky Stewart
ea0981892a Bug 1635526 - Activate virtualenv in mach static-analysis autotest r=andi
After bug 1633039, we won't be guaranteed to have the `init` virtualenv already created after running a build, so `static-analysis autotest` needs to make sure it's created all by itself. This results in failures like [this](https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedTaskRun=WDRF1EzDRA6jPqPb60X5Pw-0&revision=332ce0963b4e92d68b0de25860debb7694dc38d5).

Differential Revision: https://phabricator.services.mozilla.com/D73924
2020-05-05 18:31:34 +00:00
Ricky Stewart
9855279a32 Bug 1635519 - Delete test_graph.py r=froydnj
This isn't useful now that the Tup backend is deleted.

Differential Revision: https://phabricator.services.mozilla.com/D73919
2020-05-05 18:07:19 +00:00
Ricky Stewart
8ffbec29d9 Bug 1635491 - Delete tup backend and mach analyze r=froydnj
It's not maintained and doesn't work as-is. If we want to revive it we can grab it from source control later, but in the meantime it's just confusing and it comes up in search results even though we never look for it.

Also delete `mach analyze` which depends on the existence of a Tup backend.

Differential Revision: https://phabricator.services.mozilla.com/D73911
2020-05-05 17:28:07 +00:00
Razvan Maries
3b592b6add Backed out changeset 5cf7e2bc5640 (bug 1635491) as per Ricky's request for Lint failure. CLOSED TREE 2020-05-05 19:57:33 +03:00
Ricky Stewart
cdac3a2e15 Bug 1635491 - Delete tup backend and mach analyze r=froydnj
It's not maintained and doesn't work as-is. If we want to revive it we can grab it from source control later, but in the meantime it's just confusing and it comes up in search results even though we never look for it.

Also delete `mach analyze` which depends on the existence of a Tup backend.

Differential Revision: https://phabricator.services.mozilla.com/D73911
2020-05-05 16:32:42 +00:00
Andi-Bogdan Postelnicu
54f965e51e Bug 1634050 - [clang-format] When analyzing files outside of the tree take along the appropriate .clang-format file as well. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D73053
2020-04-30 16:46:26 +00:00
Bogdan Tara
f137fa0613 Backed out 6 changesets (bug 1632916, bug 1599658, bug 1633037, bug 1633039, bug 1633016, bug 1632920) for SA bustages CLOSED TREE
Backed out changeset 332ce0963b4e (bug 1633039)
Backed out changeset a9904cbc40d9 (bug 1633037)
Backed out changeset d06b0ec349f8 (bug 1599658)
Backed out changeset 8fd300cad80f (bug 1633016)
Backed out changeset f8820941c703 (bug 1632916)
Backed out changeset ac9c2c8746ed (bug 1632920)
2020-05-02 01:49:29 +03:00
Ricky Stewart
035981e445 Bug 1633039 - Don't check for Python 2 in configure r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D72895
2020-04-30 15:23:51 +00:00
Ricky Stewart
69685d8ab5 Bug 1633037 - Remove all remaining references to $(PYTHON) across Makefiles r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D72894
2020-05-01 16:19:21 +00:00
Ricky Stewart
0daacc12c3 Bug 1599658 - Delete previous definition of py_action in Makefiles. Now py_action calls into Python 3 and py3_action doesn't exist. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D72487
2020-04-30 15:27:13 +00:00
Ricky Stewart
bb4e86d85a Bug 1633016 - Remove a bunch of references to PYTHON(2) in Makefiles r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D72479
2020-04-30 15:25:22 +00:00
Ricky Stewart
d990224458 Bug 1632916 - Run JS/web-platform/ipdl build machinery in Python 3 r=jgraham,nika,glandium
Differential Revision: https://phabricator.services.mozilla.com/D72478
2020-05-01 16:31:21 +00:00
Ricky Stewart
7b699ef488 Bug 1632461 - Delete "hacking environment to allow binary Python" message and corresponding hack. r=dmajor
This warning dates from bug 910487, which was 7 years ago. Since joining Mozilla I have *always* gotten this warning, and as far as I can tell since I never had a pre-2019 version of Visual Studio on my dev machine, the VS90COMNTOOLS variable was *never* set. Moreover, the "hack" is written in such a way that it does nothing *unless* you have `VS{100,110,120}COMNTOOLS` set, which I never have on my machine either, as you might expect since I only have the one version of Visual Studio installed.

The [latest public build documentation](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites) recommends that you install the Community edition of Visual Studio 2019, and as of 2019 the variable that's being used is `VS160COMNTOOLS`, so the only way someone would get value out of this hack is if they're using a substantially older version of Visual Studio than we recommend anyway.

Since 1) I *suspect* the hack is not doing anything for the large majority, if not all, of the people currently running builds on Windows on a day-to-day basis and 2) even if the hack continues to do something useful under some hypothetical scenarios, the content of the hack as well as the corresponding warning is so outdated that it should be updated anyway, I propose deleting it entirely.

Differential Revision: https://phabricator.services.mozilla.com/D72925
2020-04-28 19:24:45 +00:00
Jeff Muizelaar
ee1ffa4dfc Bug 1631063. Use utf-8 when reading TOML files. r=glandium
Without this we get encoding errors on 'Álvarez' on Windows because
the default encoding there is not 'utf-8'.

Differential Revision: https://phabricator.services.mozilla.com/D71382
2020-04-23 08:08:51 +00:00
Mike Hommey
9c03a7015d Bug 1632348 - Convert mach artifact to python 3. r=rstewart
Differential Revision: https://phabricator.services.mozilla.com/D72114
2020-04-26 21:53:57 +00:00
Noemi Erli
7f6a7f8cf2 Backed out changeset 90bd5342c58f (bug 1632348) for causing toolchains bustage 2020-04-26 02:37:07 +03:00
Mike Hommey
568944c117 Bug 1632348 - Convert mach artifact to python 3. r=rstewart
Differential Revision: https://phabricator.services.mozilla.com/D72114
2020-04-24 20:51:24 +00:00
Mitchell Hentges
b6eb2ea22e Bug 1627072 - Runs pip-compile in same directory as temporary requirements file r=rstewart
pip-compile can annotate each requirement with a reason why it is included (e.g.: transitive dependency, or depended-on directly).

When annotating direct dependencies, it notes it as "via -r <direct path to requirements.in file>".
Since we were using a temporary directory, the path of the directory was being included, making the output non-deterministic.

This change ensures that we run pip-compile in the same working directory as the temporary requirements file, enabling
the annotations to be deterministic: "via -r requirements-mach-vendor-python.in".

Differential Revision: https://phabricator.services.mozilla.com/D72181
2020-04-24 20:54:06 +00:00
Kagami Sascha Rosylight
2f8b998e96 Bug 1628726 - Use os.path.realpath consistently r=rstewart
`os.path.realpath` in Python 3.8 now always uppercases Windows drive letter, while it was just an alias of `os.path.abspath` in Windows. This patch uses `.realpath()` consistently to get `topobjdir` to fix the incompatibility from the behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D72188
2020-04-24 20:59:03 +00:00
Chris AtLee
b246a1493c Bug 1632601: Create test archives for jsreftest and jittest r=ahal
Split out jsreftest and jittest files into their own packages, removing them
from the common package.

This speeds up extracting files from the common test archive for
non-jsreftest/jittest suites.

Also, remove some files from the web-platform test archive that are already
present in the common archive.

Differential Revision: https://phabricator.services.mozilla.com/D72192
2020-04-24 20:18:58 +00:00
Joel Maher
f8875234b3 Bug 1621095 - add reftest-qr to run focused webrender reftests on android phones. r=bc
add reftest-qr to run focused webrender reftests on android phones.

Differential Revision: https://phabricator.services.mozilla.com/D72312
2020-04-24 18:54:51 +00:00
Ricky Stewart
725728fc20 Bug 1621451 - Remove remaining in-build references to Python 2 GENERATED_FILES as well as underlying build system support r=dmajor
We still need to resolve bug 1621448, at which point we can delete the `py_action` macro entirely.

Differential Revision: https://phabricator.services.mozilla.com/D71795
2020-04-22 17:34:23 +00:00
Mitchell Hentges
38e0a4b340 Bug 1550832 - synchronize makefile blacklist with mozbuild variables r=rstewart
As we migrate from makefiles to moz.build, we want to warn developers if
variables only used by moz.build are accidentally defined in a makefile.

This was the purpose of `MOZBUILD_VARIABLES` in recursivemake.py, though it became out-of-date.

This patch defines `MOZBUILD_VARIABLES` off the official list from `mozbuild.frontend.context.VARIABLES`, and
removes unused (?) code from makefiles accordingly

Note that the following variables use to be in `MOZBUILD_VARIABLES`, but aren't there any more because
they aren't in `mozbuild.frontend.context.VARIABLES`:
* CMSRCS
* CMMSRCS
* EXTRA_JS_MODULES
* EXTRA_PP_COMPONENTS
* EXTRA_PP_JS_MODULES
* HOST_CSRCS
* HOST_CMMSRCS
* HOST_EXTRA_LIBS
* JAVA_JAR_TARGETS
* LIBS
* MAKE_FRAMEWORK
* MODULE
* NO_DIST_INSTALL
* NO_INTERFACES_MANIFEST
* PARALLEL_DIRS
* PREF_JS_EXPORTS
* RESOURCE_FILES
* SHARED_LIBRARY_LIBS
* TEST_DIRS
* TOOL_DIRS
* XPCSHELL_TESTS

Differential Revision: https://phabricator.services.mozilla.com/D72076
2020-04-24 14:47:04 +00:00
Cosmin Sabou
f56aee4c5c Backed out changeset 022f4f67d388 (bug 1550832) for causing SM bustages. CLOSED TREE 2020-04-24 19:22:27 +03:00
Mitchell Hentges
373ffb5d65 Bug 1550832 - synchronize makefile blacklist with mozbuild variables r=rstewart
As we migrate from makefiles to moz.build, we want to warn developers if
variables only used by moz.build are accidentally defined in a makefile.

This was the purpose of `MOZBUILD_VARIABLES` in recursivemake.py, though it became out-of-date.

This patch defines `MOZBUILD_VARIABLES` off the official list from `mozbuild.frontend.context.VARIABLES`, and
removes unused (?) code from makefiles accordingly

Note that the following variables use to be in `MOZBUILD_VARIABLES`, but aren't there any more because
they aren't in `mozbuild.frontend.context.VARIABLES`:
* CMSRCS
* CMMSRCS
* EXTRA_JS_MODULES
* EXTRA_PP_COMPONENTS
* EXTRA_PP_JS_MODULES
* HOST_CSRCS
* HOST_CMMSRCS
* HOST_EXTRA_LIBS
* JAVA_JAR_TARGETS
* LIBS
* MAKE_FRAMEWORK
* MODULE
* NO_DIST_INSTALL
* NO_INTERFACES_MANIFEST
* PARALLEL_DIRS
* PREF_JS_EXPORTS
* RESOURCE_FILES
* SHARED_LIBRARY_LIBS
* TEST_DIRS
* TOOL_DIRS
* XPCSHELL_TESTS

Differential Revision: https://phabricator.services.mozilla.com/D72076
2020-04-24 14:47:04 +00:00
Bogdan Tara
a5112d03db Backed out changeset 97280448a042 (bug 1621095) for test_ext_test.html failures CLOSED TREE 2020-04-24 17:09:37 +03:00
Joel Maher
b9a6e9d31c Bug 1621095 - add reftest-qr to run focused webrender reftests on android phones. r=bc
add reftest-qr to run focused webrender reftests on android phones.

Differential Revision: https://phabricator.services.mozilla.com/D72312
2020-04-24 12:35:12 +00:00
Mike Hommey
5e8b3e9559 Bug 1632353 - Convert mach resource-usage to python3. r=rstewart
Differential Revision: https://phabricator.services.mozilla.com/D72117
2020-04-23 22:56:37 +00:00
Mike Hommey
56ca1ef0e7 Bug 1631211 - In configure, pass extra compiler flags after source path. r=dmajor,rstewart
When running e.g. check_symbols with extra flags like when checking
for vpx_codec_dec_init_ver when building against system libvpx, in some
configurations, the test can fail when the library flags (-l) appear
before the source file path.

The reason is that in some configurations, the compiler passes
--as-needed to the linker before both the flags and the object file
path, and the object file path is in the same position as the source
file path was. With --as-needed, -l flags are dropped if the library
wasn't needed for any of the linked code that appears *before* the flag.
So linking with `--as-needed -lfoo foo.o`, is equivalent to linking with
`foo.o` only in practice, while `--as-needed foo.o -lfoo` is equivalent
to `foo.o -lfoo`.

Differential Revision: https://phabricator.services.mozilla.com/D71456
2020-04-23 21:46:01 +00:00