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

293 Коммитов

Автор SHA1 Сообщение Дата
Jesse Schwartzentruber 0026d74b59 Bug 1695285 - Pass ASan/UBSan flags to cargo for native builds. r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D106652
2021-03-18 20:46:55 +00:00
Christian Holler 4cf2f28556 Bug 1689597 - Add Fuzzilli support to the build system. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D103467
2021-03-11 12:13:21 +00:00
Alexandru Michis e18957315d Backed out changeset 9bada5ab20d7 (bug 1695285) for causing Linux asan bustages.
CLOSED TREE
2021-03-10 07:55:32 +02:00
Jesse Schwartzentruber 32d19f30ad Bug 1695285 - Pass ASan/UBSan flags to cargo for native builds. r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D106652
2021-03-10 00:05:28 +00:00
Mike Hommey 7eb38cd807 Bug 1670538 - Use an allow-list in RUSTC_BOOTSTRAP for rustc >= 1.50.0. r=firefox-build-system-reviewers,andi,sheehan,mhentges
While we could change qcms, encoding_rs and packed_simd to not emit
RUSTC_BOOTSTRAP on newer versions of rust, like we do for gkrust-shared,
it's not worth the effort (especially for those that are vendored).

Differential Revision: https://phabricator.services.mozilla.com/D105423
2021-02-17 21:47:28 +00:00
Mike Hommey 5f86b697af Bug 1692137 - Allow local linux builds to use a bootstrapped sysroot. r=firefox-build-system-reviewers,andi,mhentges
Bug 1690930 added sysroots that can be bootstrapped. With this change,
we allow --enable-bootstrap=install to pull the right sysroot for the
configured target, and --enable-bootstrap to update it if it was already
there.

Differential Revision: https://phabricator.services.mozilla.com/D104797
2021-02-12 20:31:49 +00:00
Mike Hommey f40865b13e Bug 1632776 - Work around autocfg tests failing on Windows PGO builds. r=firefox-build-system-reviewers,sheehan,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D103276
2021-01-28 16:47:38 +00:00
Masatoshi Kimura 03d7defdfa Bug 1684110 - Define UNICODE on some directories. r=glandium
so that people do not accidentally use 'A'-functions.

Differential Revision: https://phabricator.services.mozilla.com/D100420
2021-01-13 22:49:59 +00:00
Emilio Cobos Álvarez 04229a0075 Bug 1680080 - Optimize proc macros / build dependencies. r=glandium,firefox-build-system-reviewers,mhentges
On a very parallel debug build, I see a long time just waiting for
bindgen / style compilation / geckoservo.

Turns out that a bunch of this is just proc macros / build scripts.

Optimizing it saves between 10 and 17 seconds of my debug build. We
might want to consider running bindgen much like cbindgen rather than
rebuilding it all the time, which should help a lot more, but my guess
is that this should still help with the pretty hot custom derives that
the style crate runs.

This needs rust 1.41, so the requirement for tools/crashreporter needs
to be bumped as a consequence. To make things simpler, it was bumped
to 1.47 while we're at it.

Differential Revision: https://phabricator.services.mozilla.com/D98366
2020-12-04 01:35:51 +00:00
Alexis Beingessner 9a0f581986 Bug 1671691 - Enable Rust stdlib instrumentation. r=decoder
* Bumps the tsan toolchain to rust-nightly-2020-11-14 that has my patches to make -Zbuild-std work in vendored environments:
  * https://github.com/rust-lang/cargo/pull/8834
  * https://github.com/rust-lang/rust/pull/78790

* Passes -Zbuild-std to cargo when MOZ_TSAN is defined (mk_add_options --enable-thread-sanitizer)

* Removes generic Rust supressions and adds much more specific ones
    * One presumed upstream false positive from tsan not understanding the code
    * One actual upstream bug tsan found (yay!)
    * One new real issue uncovered
    * One issue that probably already existed intermittently but I happened to hit

Differential Revision: https://phabricator.services.mozilla.com/D97165
2020-11-16 18:36:41 +00:00
Alexis Beingessner d1d354bb8f Bug 1674773 - make tsan builds use consistent flags. r=rstewart
This makes --enable-thread-sanitizer turn on Rust tsan (-Zsanitizer=thread).
This requires changing SpiderMonkey tsan to use the tsan rust nightly.

In future changes, more Rust tsan integration will key off of MOZ_TSAN.

Differential Revision: https://phabricator.services.mozilla.com/D96453
2020-11-10 21:11:37 +00:00
Cosmin Sabou f2556d47da Backed out 2 changesets (bug 1674773) for turning Bug 1646925 into almost permafail.
Backed out changeset acd441508a66 (bug 1674773)
Backed out changeset 89babec1b885 (bug 1674773)
2020-11-10 11:27:50 +02:00
Alexis Beingessner 2e16b14340 Bug 1674773 - make tsan builds use consistent flags. r=rstewart
This makes --enable-thread-sanitizer turn on Rust tsan (-Zsanitizer=thread).
This requires changing SpiderMonkey tsan to use the tsan rust nightly.

In future changes, more Rust tsan integration will key off of MOZ_TSAN.

Differential Revision: https://phabricator.services.mozilla.com/D96453
2020-11-09 20:12:42 +00:00
Mike Hommey 0848a4e73a Bug 1644624 - Pass LLVM flags from PROFILE_GEN_CFLAGS to the rust compiler. r=firefox-build-system-reviewers,dmajor
Differential Revision: https://phabricator.services.mozilla.com/D93729
2020-10-20 19:29:58 +00:00
Mike Hommey 6504260166 Bug 1672306 - Don't enable rust "global" LTO when cross LTO is enabled. r=firefox-build-system-reviewers,dmajor
This avoids a sort of duplication of work between both, because the
linker will eventually LTO-compile everything, so we technically don't
really need the extra step of the rust compiler doing an intermediate
LTO on the static libraries it produces.

Differential Revision: https://phabricator.services.mozilla.com/D94224
2020-10-21 01:20:48 +00:00
Cosmin Sabou b8fd79f461 Backed out 5 changesets (bug 1644624, bug 1671555) for windows shippable bustage.
Backed out changeset fee83fc16940 (bug 1644624)
Backed out changeset afb2a7ff532c (bug 1671555)
Backed out changeset 609ac687f7e3 (bug 1644624)
Backed out changeset d91db0801099 (bug 1644624)
Backed out changeset ce09ad625b53 (bug 1644624)
2020-10-20 06:52:09 +03:00
Mike Hommey 7e240e7af2 Bug 1644624 - Pass LLVM flags from PROFILE_GEN_CFLAGS to the rust compiler. r=firefox-build-system-reviewers,dmajor
Differential Revision: https://phabricator.services.mozilla.com/D93729
2020-10-16 15:45:54 +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
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
Mike Hommey cd3a2d5a79 Bug 1669633 - Remove MOZ_BUILD_ROOT. r=firefox-build-system-reviewers,andi,rstewart
It is only really used in js/src/devtools/rootAnalysis/Makefile.in,
and even there, the way it is used seems wrong, so fix that at the
same time (binaries have been linked into $DIST/bin directly for a
while).

Differential Revision: https://phabricator.services.mozilla.com/D92721
2020-10-07 17:57:38 +00:00
Christian Holler 0215dcbfc4 Bug 1659392 - Only enable rust fuzzing code with libFuzzer. r=truber
Differential Revision: https://phabricator.services.mozilla.com/D87228
2020-08-18 13:32:15 +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
Mike Hommey ff764980c5 Bug 1659066 - Move base C/C++ compiler flags for cc-rs to CFLAGS_*/CXXFLAGS_. r=firefox-build-system-reviewers,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D87051
2020-08-22 22:46:12 +00:00
Razvan Maries 60aa2d1349 Backed out 3 changesets (bug 1659066) for build bustages. CLOSED TREE
Backed out changeset e8fdf9f3a551 (bug 1659066)
Backed out changeset 0d9c38d87d51 (bug 1659066)
Backed out changeset bdecbe65a90e (bug 1659066)
2020-08-23 01:39:26 +03:00
Mike Hommey c47d050d59 Bug 1659066 - Move base C/C++ compiler flags for cc-rs to CFLAGS_*/CXXFLAGS_. r=firefox-build-system-reviewers,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D87051
2020-08-21 20:18:22 +00:00
Mike Hommey 5919ab86af Bug 1656141 - Create res and rc files based on the name of the binary they are linked into. r=firefox-build-system-reviewers,rstewart
This will allow creating separate res files for e.g. SIMPLE_PROGRAMS.

Differential Revision: https://phabricator.services.mozilla.com/D86155
2020-08-07 00:50:50 +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 63984026bb Bug 1656141 - Create res and rc files based on the name of the binary they are linked into. r=firefox-build-system-reviewers,rstewart
This will allow creating separate res files for e.g. SIMPLE_PROGRAMS.

Differential Revision: https://phabricator.services.mozilla.com/D86155
2020-08-06 15:57:42 +00:00
Mike Hommey 2a4eb30ed4 Bug 1654465 - Set -Cembed-bitcode=yes instead of CARGO_PROFILE_RELEASE_LTO. r=firefox-build-system-reviewers,rstewart
It turns out setting CARGO_PROFILE_RELEASE_LTO has unwanted side
effects.

First it's not actually strictly equivalent to using `cargo rustc --
-Clto`. For instance, it apparently also enables cross-language LTO in
newer versions of cargo.

Second, it changes the rust computed hash for all the dependencies of
the crate being built with the variable set, which makes them diverge
from when the same dependencies are built through another crate in the
tree that is not LTOed. This effectively makes us build a _lot_ of
crates twice, many of which are not cacheable.

Since the original problem is that cargo >= 1.45 passes extra flags (`-C
embed-bitcode=no`) to rustc that are incompatible with `-Clto`, and while
it knows to adjust based on the `lto` setting in the build profile
(which CARGO_PROFILE_RELEASE_LTO overrides the default of), cargo
ignores flags passed via `cargo rustc -- ...` when making those
adjustments.

So, we need to override with `-C embed-bitcode=yes` on our own at the
same time we pass `-Clto`. But doing that through `cargo rustc -- ...`
is not enough because all the dependencies of the crate built with
`-Clto` need to be built with `-C embed-bitcode=yes`. So we need to
override with `RUSTFLAGS`, which will affect all the dependencies.
But we also need to do this consistently across all crates, not only the
dependencies of crates built with `-Clto`, otherwise we'd still end up
building crates twice (once with and once without the override).

Unfortunately, the `-C embed-bitcode=*` flag is also not supported in
versions older than 1.45, so we have to avoid adding it on older
versions.

We unfortunately support a large range of versions of rustc (albeit only
for tools/crashreporter), but we actually need to upgrade the smaller
supported version because rustc < 1.38 doesn't support our top-level
Cargo.lock. This makes the version check slightly less awful.

Differential Revision: https://phabricator.services.mozilla.com/D84652
2020-07-27 21:23:57 +00:00
Mike Hommey 268a226874 Bug 1654182 - Only look at the dynamic symbols table for the version checks. r=froydnj
The main reason we look at the complete symbols table is that before bug
1541792, we needed to look at that table for _NSModule symbols.

In bug 1516228, we also made everything llvm-objdump to limit the
differences cross-platform, but that's not necessary anymore per the
previous change.

llvm-objdump doesn't support getting only the dynamic symbols table, so
we go back to what we were using before bug 1516228, namely readelf,
while preserving a code path to use the complete symbols table for the
networking test on libgkrust.a, which doesn't have a dynamic symbols
table.

With this change, check_binary goes from 45s to 0.2s on my machine.

Differential Revision: https://phabricator.services.mozilla.com/D84305
2020-07-22 04:09:39 +00:00
Mike Hommey cb5b458548 Bug 1640982 - Set CARGO_PROFILE_RELEASE_LTO=true when enabling rust LTO. r=firefox-build-system-reviewers,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D84098
2020-07-20 16:05:36 +00:00
Mike Hommey 0ebe2bbd8f Bug 1652448 - Use the same codegen-units numbers on host and target rust builds. r=firefox-build-system-reviewers,rstewart
Otherwise, crates that are shared between host and target are always
rebuilt because of the difference in rust flags.

Differential Revision: https://phabricator.services.mozilla.com/D83412
2020-07-13 22:24:59 +00:00
Nathan Froyd bddb48ea03 Bug 1625281 - force make to update timestamp caches when building rust programs; r=firefox-build-system-reviewers,rstewart
Doing this means that make will correctly understand that the underlying
program has changed and therefore it needs to trigger install rules.

Differential Revision: https://phabricator.services.mozilla.com/D83326
2020-07-13 19:01:40 +00:00
Ricky Stewart 51a23a4ba2 Bug 1651641 - `servo/components/style/build.rs` reads `PYTHON3` configuration value in addition to environment variable r=glandium
The previous logic would check the value of the `PYTHON3` environment variable, which is not set by the Firefox build system, so this build script tends to just use the `python3` at the tip of the `PATH`, regardless of which value you've configured for it. Instead, it should prefer to read from the `OBJDIR` if one is present.

Differential Revision: https://phabricator.services.mozilla.com/D82981
2020-07-09 22:03:23 +00:00
Kris Maglione b18c12677e Bug 1464542: Part 1 - Generate symbolic names for XPT interfaces and add lookup function. r=nika,froydnj
This makes it much simpler for the for the static JS services cache to store
and lookup interface IDs for components.

Differential Revision: https://phabricator.services.mozilla.com/D81416
2020-07-09 20:42:49 +00:00
Csoregi Natalia b355fcc4bf Backed out 6 changesets (bug 1464542) for xpcshell failures on test_Services.js. CLOSED TREE
Backed out changeset b50af9005851 (bug 1464542)
Backed out changeset 9d3a0ea2cf65 (bug 1464542)
Backed out changeset 71c3475fcbc2 (bug 1464542)
Backed out changeset 51ff93220a95 (bug 1464542)
Backed out changeset e84de1547c09 (bug 1464542)
Backed out changeset bbecc16d08eb (bug 1464542)
2020-07-09 23:19:26 +03:00
Kris Maglione 55b68bde08 Bug 1464542: Part 1 - Generate symbolic names for XPT interfaces and add lookup function. r=nika,froydnj
This makes it much simpler for the for the static JS services cache to store
and lookup interface IDs for components.

Differential Revision: https://phabricator.services.mozilla.com/D81416
2020-07-09 17:59:09 +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 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
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 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
Jamie Nicol d384e8fa67 Bug 1604615 - Use cargo linker wrapper for native sanitizer builds, but don't set problematic flags. r=glandium
For native sanitizer builds, we currently do not pass the linker flags
to cargo, as they were causing crashes in some build scripts. Without
this, however, the linker is unable to find libstdc++. Instead, do
tell cargo to use the linker wrapper, but omit the problematic flags
from MOZ_CARGO_WRAP_LDFLAGS.

Differential Revision: https://phabricator.services.mozilla.com/D70354
2020-04-21 10:31:53 +00:00
David Major e8a38f48d0 Bug 1627768 - Expand check_networking exemption to ASan and UBSan builds r=rstewart
They all fail for the same reason: the sanitizer runtime in compiler-rt installs an interceptor for `getsockname` which then contains a call to the real implementation.

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

--HG--
extra : moz-landing-system : lando
2020-04-15 15:56:34 +00:00
Michael Woerister 5327bb2166 Bug 1623085 - Only explicitly set number of Rust codegen-units for target artifacts. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D67162

--HG--
extra : moz-landing-system : lando
2020-03-17 16:47:52 +00:00
Mike Shal b5ef4a8d81 Bug 1620744 - Convert check_binary.py to py3; r=firefox-build-system-reviewers,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D65855

--HG--
extra : moz-landing-system : lando
2020-03-10 20:19:42 +00:00
Daniel Varga 09acd57d19 Backed out 13 changesets (bug 1620744) for causing diffoscope failures firefox/browser/chrome/browser/content/browser/built_in_addons.json
CLOSED TREE

Backed out changeset 6beda54bcb9b (bug 1620744)
Backed out changeset a1e97f0b91ef (bug 1620744)
Backed out changeset b8faa0184d4f (bug 1620744)
Backed out changeset 3bc8fda68107 (bug 1620744)
Backed out changeset 8e95b21b2ae3 (bug 1620744)
Backed out changeset 1de09de1a802 (bug 1620744)
Backed out changeset 622a2f7414fa (bug 1620744)
Backed out changeset 3372c9ab721c (bug 1620744)
Backed out changeset 0997313a9f99 (bug 1620744)
Backed out changeset 2fa34749bbfa (bug 1620744)
Backed out changeset 6d597d2eb792 (bug 1620744)
Backed out changeset 78e78f7c7b26 (bug 1620744)
Backed out changeset 6e4d85b19f88 (bug 1620744)
2020-03-10 21:13:18 +02:00
Mike Shal 7e2ee7cfd9 Bug 1620744 - Convert check_binary.py to py3; r=firefox-build-system-reviewers,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D65855

--HG--
extra : moz-landing-system : lando
2020-03-09 22:02:43 +00:00
Mike Hommey 83f784d880 Bug 1617794 - Properly set the target flag for bindgen when cross compiling for Windows. r=chmanchester
Differential Revision: https://phabricator.services.mozilla.com/D64292

--HG--
extra : moz-landing-system : lando
2020-02-26 20:52:09 +00:00
Nick Alexander 7f5f33cf2f Bug 1616426 - Make cargo use --color=never on Windows. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D63279

--HG--
extra : moz-landing-system : lando
2020-02-19 01:26:38 +00:00
Michael Woerister 785600d4d3 Bug 1613649 - Explicitly opt-out of Rust's local ThinLTO for DEVELOPER_OPTIONS builds. r=firefox-build-system-reviewers,chmanchester
By default the Rust compiler will perform a limited kind of ThinLTO on each
crate. For local builds this additional optimization is not worth the
increase in compile time.

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

--HG--
extra : moz-landing-system : lando
2020-02-07 08:55:04 +00:00