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

1621 Коммитов

Автор SHA1 Сообщение Дата
David Major 56fdf285db Bug 1681582 - Disable Rust CFG on aarch64-windows r=firefox-build-system-reviewers,mhentges
This is bug 1639318 all over again except from Rust rather than C++. It's the same symptom, nsXPTCStub vtables aren't marked as valid targets.

In the earlier bug we disabled CFG for C++ on ARM64. Let's do the same for Rust. According to that bug, "It's not clear why this doesn't happen on x86 builds. Given priorities, I can't really justify investigating this, although I suspect that fixing the underlying issue would be pretty much bug 1483885."

Differential Revision: https://phabricator.services.mozilla.com/D99278
2020-12-10 01:27:38 +00:00
Mike Hommey 2dd02bb64b Bug 1681406 - Require 10.12 SDK for the build. r=firefox-build-system-reviewers,dmajor
Bug 1680152 updated automation to use the 10.12 SDK, and shortly after,
bug 1678174 introduced a change that broke the build with the 10.11 SDK.
Considering we haven't actually supported running on macos 10.11 and
earlier since Firefox 79, and that still supporting building with the
10.11 SDK would mean adding and maintaining code that, in practice,
would never be used by users, I think it is fair at this point that we
just drop support for the 10.11 SDK entirely.

Differential Revision: https://phabricator.services.mozilla.com/D99181
2020-12-09 13:26:36 +00:00
David Major 6cacd7d64b Bug 1632866 - Enable Control Flow Guard for Rust r=nalexander
This flag has been stabilized as of rust 1.47.0.

Differential Revision: https://phabricator.services.mozilla.com/D94128
2020-12-04 17:38:28 +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
Bogdan Tara 5669c53aa8 Merge mozilla-central to autoland a=merge 2020-12-03 06:57:18 +02:00
Cosmin Sabou 642f3833de Backed out changeset abafe6c923eb (bug 1588710) for frequently causing tests to fail on Try (bug 1679994. a=backout 2020-12-03 01:16:03 +02:00
Mike Hommey f1d7e7f48c Bug 1680152 - Bump macos deployment target to 10.12. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D98404
2020-12-02 12:45:54 +00:00
David Major 87237b867f Bug 1680057 - New PM LTO: Don't take the elif block on Windows r=firefox-build-system-reviewers,mhentges
Windows being Windows, with its own spellings for everything, let's stay within the WINNT block regardless of whether we meet the compiler requirement.

Differential Revision: https://phabricator.services.mozilla.com/D98355
2020-12-02 17:02:01 +00:00
Mike Hommey 72cc842ad5 Bug 1671545 - Require at least rustc 1.47.0 to build. r=firefox-build-system-reviewers,dmajor
And remove the rust 1.43 toolchain, now it's not used anymore.

Differential Revision: https://phabricator.services.mozilla.com/D93733
2020-12-02 00:01:56 +00:00
Sylvestre Ledru 0d6e8b2156 Bug 1588710 - Linux/Android: enable -fstack-clash-protection r=tjr,firefox-build-system-reviewers,glandium
This is a new feature in clang (already existing in gcc) provided from version 11.

Not usefull on Mac & Windows and is supported on intel cpu + ppc64 + s390x
https://releases.llvm.org/11.0.0/tools/clang/docs/ReleaseNotes.html#new-compiler-flags

Fedora/Redhat would like to have this option to move from gcc to clang in these
distros.

More on this:
https://blog.qualys.com/vulnerabilities-research/2017/06/19/the-stack-clash
https://pagure.io/fesco/issue/2020
https://reviews.llvm.org/D68720
https://www.phoronix.com/scan.php?page=news_item&px=LLVM-Stack-Clash-Protection-20

It seems that the performance impact is neglible:
https://treeherder.mozilla.org/perfherder/compare?originalProject=try&originalRevision=a47c98b909b61035dae2e1e00883f2ade0fef129&newProject=try&newRevision=62108fa48bd15fe01f1a0f1ffab133af9b4207cc&framework=13

Differential Revision: https://phabricator.services.mozilla.com/D95999
2020-12-01 08:01:41 +00:00
David Major 80a968491f Bug 1679845 - Check linker instead of OS target for LTO new pass manager check r=glandium
Per request in D97372

Differential Revision: https://phabricator.services.mozilla.com/D98215
2020-12-01 04:33:19 +00:00
David Major 8f8ea43ab6 Bug 1677742 - Followups for new pass manager LTO r=glandium
Code review followups for 1675600: Restrict the use of new pass manager during LTO to builds where we're using the new pass manager in general, and (on Windows) where lld-link is new enough to understand the flag.

Differential Revision: https://phabricator.services.mozilla.com/D97372
2020-11-21 02:13:04 +00:00
Mike Hommey be6372ad52 Bug 1678154 - Only set --target=arm64-apple-darwin when building with Xcode clang. r=firefox-build-system-reviewers,dmajor
Upstream clang supports --target=aarch64-apple-darwin, and that matches
what config.sub canonicalizes to, and thus what the default toolchain
prefix ends up being, so it's better to use aarch64-apple-darwin when
not compiling with Xcode clang.

Differential Revision: https://phabricator.services.mozilla.com/D97698
2020-11-20 02:12:51 +00:00
Mike Hommey c90e00940b Bug 1678291 - Default to 11.0 as the macos target for aarch64. r=firefox-build-system-reviewers,mhentges
There is no earlier SDK that supports it. It seems Xcode clang doesn't
care (maybe it defaults to 11.0 is MACOSX_DEPLOYMENT_TARGET is too low?),
but upstream clang does.

Differential Revision: https://phabricator.services.mozilla.com/D97565
2020-11-19 19:21:02 +00:00
Mike Hommey 18704e0274 Bug 1678291 - Default to use private frameworks from the SDK. r=firefox-build-system-reviewers,mhentges
And don't set it via mozconfig. The default to /System/Library/PrivateFrameworks
may also not have matched the used SDK previously, so the new default is
better.

Differential Revision: https://phabricator.services.mozilla.com/D97564
2020-11-19 20:25:20 +00:00
Kevin Jacobs 54a13dccf2 Bug 1677548 - land NSS 3eacb92e9adf UPGRADE_NSS_RELEASE, r=jcj
2020-11-18  Kevin Jacobs  <kjacobs@mozilla.com>

	* lib/ssl/ssl3con.c, lib/ssl/tls13con.c, lib/ssl/tls13ech.c:
	Bug 1654332 - Fixup a10493dcfcc9: copy ECHConfig.config_id with
	socket r=jcj

	A late review change for ECH was for the server to compute each
	ECHConfig `config_id` when set to the socket, rather than on each
	connection. This works, but now we also need to copy that config_id
	when copying a socket, else the server won't find a matching
	ECHConfig to use for decryption.

	[3eacb92e9adf] [tip]

2020-11-17  Kevin Jacobs  <kjacobs@mozilla.com>

	* automation/abi-check/expected-report-libssl3.so.txt,
	cmd/tstclnt/tstclnt.c, cpputil/tls_parser.h,
	gtests/ssl_gtest/libssl_internals.c,
	gtests/ssl_gtest/libssl_internals.h, gtests/ssl_gtest/manifest.mn,
	gtests/ssl_gtest/ssl_auth_unittest.cc,
	gtests/ssl_gtest/ssl_custext_unittest.cc,
	gtests/ssl_gtest/ssl_extension_unittest.cc,
	gtests/ssl_gtest/ssl_gtest.gyp,
	gtests/ssl_gtest/ssl_tls13compat_unittest.cc,
	gtests/ssl_gtest/tls_agent.cc, gtests/ssl_gtest/tls_agent.h,
	gtests/ssl_gtest/tls_connect.cc, gtests/ssl_gtest/tls_connect.h,
	gtests/ssl_gtest/tls_ech_unittest.cc,
	gtests/ssl_gtest/tls_esni_unittest.cc,
	gtests/ssl_gtest/tls_filter.cc, gtests/ssl_gtest/tls_filter.h,
	lib/ssl/SSLerrs.h, lib/ssl/manifest.mn, lib/ssl/ssl.gyp,
	lib/ssl/ssl3con.c, lib/ssl/ssl3ext.c, lib/ssl/ssl3ext.h,
	lib/ssl/ssl3exthandle.c, lib/ssl/ssl3exthandle.h,
	lib/ssl/ssl3prot.h, lib/ssl/sslencode.c, lib/ssl/sslencode.h,
	lib/ssl/sslerr.h, lib/ssl/sslexp.h, lib/ssl/sslimpl.h,
	lib/ssl/sslinfo.c, lib/ssl/sslsecur.c, lib/ssl/sslsock.c,
	lib/ssl/sslt.h, lib/ssl/tls13con.c, lib/ssl/tls13con.h,
	lib/ssl/tls13ech.c, lib/ssl/tls13ech.h, lib/ssl/tls13esni.c,
	lib/ssl/tls13esni.h, lib/ssl/tls13exthandle.c,
	lib/ssl/tls13exthandle.h, lib/ssl/tls13hashstate.c,
	lib/ssl/tls13hashstate.h:
	Bug 1654332 - Update ESNI to draft-08 (ECH). r=mt

	This patch adds support for Encrypted Client Hello (draft-ietf-tls-
	esni-08), replacing the existing ESNI (draft -02) support.

	There are five new experimental functions to enable this:

	 - SSL_EncodeEchConfig: Generates an encoded (not BASE64) ECHConfig
	given a set of parameters.
	  - SSL_SetClientEchConfigs: Configures the provided ECHConfig to the
	given socket. When configured, an ephemeral HPKE keypair will be
	generated for the CH encryption.
	  - SSL_SetServerEchConfigs: Configures the provided ECHConfig and
	keypair to the socket. The keypair specified will be used for HPKE
	operations in order to decrypt encrypted Client Hellos as they are
	received.
	  - SSL_GetEchRetryConfigs: If ECH is rejected by the server and
	compatible retry_configs are provided, this API allows the
	application to extract those retry_configs for use in a new
	connection.
	  - SSL_EnableTls13GreaseEch: When enabled, non-ECH Client Hellos will
	have a "GREASE ECH" (i.e. fake) extension appended. GREASE ECH is
	disabled by default, as there are known compatibility issues that
	will be addressed in a subsequent draft.

	The following ESNI experimental functions are deprecated by this
	update:

	 - SSL_EncodeESNIKeys
	  - SSL_EnableESNI
	  - SSL_SetESNIKeyPair

	 In order to be used, NSS must be compiled with
	`NSS_ENABLE_DRAFT_HPKE` defined.

	[a10493dcfcc9]

	* lib/ssl/ssl3con.c, lib/ssl/sslencode.c, lib/ssl/sslencode.h,
	lib/ssl/tls13con.c, lib/ssl/tls13con.h:
	Bug 1654332 - Buffered ClientHello construction. r=mt

	This patch refactors construction of Client Hello messages. Instead
	of each component of the message being written separately into
	`ss->sec.ci.sendBuf`, we now construct the message in its own
	sslBuffer. Once complete, the entire message is added to the sendBuf
	via `ssl3_AppendHandshake`.

	`ssl3_SendServerHello` already uses this approach and it becomes
	necessary for ECH, where we use the constructed ClientHello to
	create an inner ClientHello.

	[d40121ba59ba]

2020-11-13  J.C. Jones  <jjones@mozilla.com>

	* automation/abi-check/expected-report-libnss3.so.txt, automation/abi-
	check/expected-report-libnssutil3.so.txt, automation/abi-check
	/previous-nss-release, lib/nss/nss.h, lib/softoken/softkver.h,
	lib/util/nssutil.h:
	Set version numbers to 3.60 Beta
	[5e7b37609f22]

Differential Revision: https://phabricator.services.mozilla.com/D97492
2020-11-19 18:28:18 +00:00
David Major c1d61912d3 Bug 1677839 - Re-allow new pass manager on aarch64-windows builds r=firefox-build-system-reviewers,mhentges
The SEH unwind info problem no longer happens because nowadays bug 1631929 prevents the code pattern that led to it. I've confirmed that bug 1626951's bustage doesn't come back, both in regular and beta-simulation builds.

This cleanup will allow me to reverse the dependency in bug 1677742 and have `lto` depend on `new_pass_manager_flags`.

Differential Revision: https://phabricator.services.mozilla.com/D97362
2020-11-17 22:25:32 +00:00
Mike Hommey abd6c007c3 Bug 1677651 - Report exact version of clang for last known Xcode. r=firefox-build-system-reviewers,mhentges
Currently, we report "10.0.0.or.more" for the latest release of Xcode,
but we know it's 10.0.0 for sure, which is when the clang version
reported by Xcode is exactly 12.0.0. We know that in the past a bump of
LLVM has always been accompanied with a bump of the minor version, so we
expect no LLVM version bump until at least 12.0.1.

Differential Revision: https://phabricator.services.mozilla.com/D97241
2020-11-17 15:56:31 +00:00
David Major c7dcbe9387 Bug 1675600 - Use the new pass manager during LTO r=firefox-build-system-reviewers,glandium
Currently, in LTO builds, we use the new pass manager during the initial translation to bitcode but not for the final optimization during linking.

On Linux, we can enable the new pass manager during LTO with a plugin option. I've landed a patch upstream to allow it on Windows as well, which is included here.

Switching the pass manager brings speed improvements on its own, but it also reduces code size by ~6%, which we can use a portion of as budget to increase the import limit (via the hot multiplier) for even more speed improvements.

Differential Revision: https://phabricator.services.mozilla.com/D96108
2020-11-17 04:07:54 +00:00
Sylvestre Ledru c7deb74f61 Bug 1670807 - Look for gm4 in addition to m4 r=firefox-build-system-reviewers,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D94305
2020-11-10 19:19:31 +00:00
Butkovits Atila 5e745619d9 Backed out changeset f38410c45877 (bug 1670807) for linting failures. CLOSED TREE 2020-11-10 20:37:44 +02:00
Sylvestre Ledru 8340ccd1e1 Bug 1670807 - Look for gm4 in addition to m4 r=firefox-build-system-reviewers,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D94305
2020-11-10 18:05:58 +00:00
Emilio Cobos Álvarez 440671e906 Bug 1676307 - Search for sccache in the toolchain search path. r=firefox-build-system-reviewers,mhentges
So that ac_add_options --with-ccache=sccache just works.

Differential Revision: https://phabricator.services.mozilla.com/D96501
2020-11-10 13:11:49 +00:00
Emilio Cobos Álvarez 1fe5a936f7 Bug 1676307 - Move compiler wrapper config after toolchain search path definition. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D96500
2020-11-10 12:54:10 +00:00
Bogdan Tara 1bda053029 Backed out 2 changesets (bug 1676307) for stackwalk related bustage CLOSED TREE
Backed out changeset 3b7922a9af19 (bug 1676307)
Backed out changeset 74e377213d81 (bug 1676307)
2020-11-10 14:42:43 +02:00
Emilio Cobos Álvarez c2b9d3eb7f Bug 1676307 - Search for sccache in the toolchain search path. r=firefox-build-system-reviewers,mhentges
So that ac_add_options --with-ccache=sccache just works.

Differential Revision: https://phabricator.services.mozilla.com/D96501
2020-11-10 12:10:47 +00:00
Emilio Cobos Álvarez 73c892ab3f Bug 1676307 - Move compiler wrapper config after toolchain search path definition. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D96500
2020-11-10 12:09:05 +00:00
Mike Hommey cc86146345 Bug 1676290 - Don't use a toolchain prefix when cross-compiling from mac to mac. r=firefox-build-system-reviewers,nalexander
Differential Revision: https://phabricator.services.mozilla.com/D96477
2020-11-09 23:43:56 +00:00
Mitchell Hentges 0bf01c3c96 Bug 1670264: Validate detected Java directory to ensure it's a JDK r=nalexander
Also consolidates bootstrap and configure Java-detection logic so
there's less surprises.

Differential Revision: https://phabricator.services.mozilla.com/D94664
2020-11-03 23:32:43 +00:00
Steve Fink cb4e64b5f5 Bug 1666108 - Eliminate -Wimplicit-function-declaration warnings r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D95092
2020-11-04 00:54:57 +00:00
Ricky Stewart 119ff36277 Bug 1674498 - Remove references to `jarsigner` from `configure` and delete the `debug_sign_tool` r=geckoview-reviewers,nalexander,snorp
This is no longer used by Android devs.

Differential Revision: https://phabricator.services.mozilla.com/D95417
2020-11-02 16:50:56 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
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-26 18:34:53 +00:00
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 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
Emilio Cobos Álvarez c6950091db Bug 1672940 - Remove biplist. r=firefox-build-system-reviewers,glandium
biplist broke with python 3.9, but we don't need this anymore because
Python3's plistlib allows reading binary plists since python 3.4.

I've tested this with all sdks that I have and we support (10.11-10.15).

Differential Revision: https://phabricator.services.mozilla.com/D94577
2020-10-23 11:37:16 +00:00
Jed Davis cc6e7ab133 Bug 1440203 - Support memfd_create in IPC shared memory. r=glandium
This commit also allows `memfd_create` in the seccomp-bpf policy for all
process types.

`memfd_create` is an API added in Linux 3.17 (and adopted by FreeBSD
for the upcoming version 13) for creating anonymous shared memory
not connected to any filesystem.  Supporting it means that sandboxed
child processes on Linux can create shared memory directly instead of
messaging a broker, which is unavoidably slower, and it should avoid
the problems we'd been seeing with overly small `/dev/shm` in container
environments (which were causing serious problems for using Firefox for
automated testing of frontend projects).

`memfd_create` also introduces the related operation of file seals:
irrevocably preventing types of modifications to a file.  Unfortunately,
the most useful one, `F_SEAL_WRITE`, can't be relied on; see the large
comment in `SharedMemory:ReadOnlyCopy` for details.  So we still use
the applicable seals as defense in depth, but read-only copies are
implemented on Linux by using procfs (and see the comments on the
`ReadOnlyCopy` function in `shared_memory_posix.cc` for the subtleties
there).

There's also a FreeBSD implementation, using `cap_rights_limit` for
read-only copies, if the build host is new enough to have the
`memfd_create` function.

The support code for Android, which doesn't support shm_open and can't
use the memfd backend because of issues with its SELinux policy (see bug
1670277), has been reorganized to reflect that we'll always use its own
API, ashmem, in that case.

Differential Revision: https://phabricator.services.mozilla.com/D90605
2020-10-22 21:23:32 +00:00
Mike Hommey 91d99a2d66 Bug 1671376 - Disable -Wmissing-braces on clang < 6. r=firefox-build-system-reviewers,dmajor
The warning is broken in older versions of clang. It also turns out we
were disabling it locally for some directories because of this very
problem.

A few local disable rules stay under accessible/ because they do hide
actual warnings from code generated by MIDL.

Differential Revision: https://phabricator.services.mozilla.com/D94262
2020-10-22 01:31:19 +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 5d3bd01bca Backed out 2 changesets (bug 1440203) for Backout conflicts with Bug 1654103. CLOSED TREE
Backed out changeset 6e44c037b2dc (bug 1440203)
Backed out changeset ab11665d8607 (bug 1440203)
2020-10-22 03:47:17 +03:00
Jed Davis 61a83c3467 Bug 1440203 - Support memfd_create in IPC shared memory. r=glandium
This commit also allows `memfd_create` in the seccomp-bpf policy for all
process types.

`memfd_create` is an API added in Linux 3.17 (and adopted by FreeBSD
for the upcoming version 13) for creating anonymous shared memory
not connected to any filesystem.  Supporting it means that sandboxed
child processes on Linux can create shared memory directly instead of
messaging a broker, which is unavoidably slower, and it should avoid
the problems we'd been seeing with overly small `/dev/shm` in container
environments (which were causing serious problems for using Firefox for
automated testing of frontend projects).

`memfd_create` also introduces the related operation of file seals:
irrevocably preventing types of modifications to a file.  Unfortunately,
the most useful one, `F_SEAL_WRITE`, can't be relied on; see the large
comment in `SharedMemory:ReadOnlyCopy` for details.  So we still use
the applicable seals as defense in depth, but read-only copies are
implemented on Linux by using procfs (and see the comments on the
`ReadOnlyCopy` function in `shared_memory_posix.cc` for the subtleties
there).

There's also a FreeBSD implementation, using `cap_rights_limit` for
read-only copies, if the build host is new enough to have the
`memfd_create` function.

The support code for Android, which doesn't support shm_open and can't
use the memfd backend because of issues with its SELinux policy (see bug
1670277), has been reorganized to reflect that we'll always use its own
API, ashmem, in that case.

Differential Revision: https://phabricator.services.mozilla.com/D90605
2020-10-21 23:34:46 +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
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
J.C. Jones f3f86339c2 Bug 1671713 - land NSS 58dc3216d518 UPGRADE_NSS_RELEASE, r=kjacobs
2020-10-13  Mike Hommey  <mh@glandium.org>

	* lib/freebl/freebl.gyp:
	Bug 1670839 - Use ARM crypto extension for AES, SHA1 and SHA2 on
	mac. r=kjacobs

	AFAICT, the Makefile equivalent already does.

	[58dc3216d518] [tip]

	* lib/freebl/sha1-armv8.c:
	Bug 1670839 - Only build sha1-armv8.c code when USE_HW_SHA1 is
	defined. r=kjacobs

	This matches what is done in sha256-armv8.c, and avoids
	inconsistency with sha1-fast.c, which will define the same functions
	in the case USE_HW_SHA1 is not defined.

	[54be084e3ba8]

2020-10-16  J.C. Jones  <jjones@mozilla.com>

	* automation/abi-check/expected-report-libnss3.so.txt, automation/abi-
	check/previous-nss-release, lib/nss/nss.h, lib/softoken/softkver.h,
	lib/util/nssutil.h:
	Set version numbers to 3.59 Beta
	[d4b21706e432]

Differential Revision: https://phabricator.services.mozilla.com/D94070
2020-10-20 14:39:49 +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
Mike Hommey 19c21c31d2 Bug 1669934 - Unset __PYVENV_LAUNCHER__ before reexecuting python configure in the virtualenv. r=firefox-build-system-reviewers,andi,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D93627
2020-10-15 21:30:23 +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 5fa72e54df Backed out 2 changesets (bug 1440203) for causing bug 1670277. CLOSED TREE
Backed out changeset 0b10bf76fe35 (bug 1440203)
Backed out changeset 468878422866 (bug 1440203)
2020-10-10 03:39:33 +03:00
Mike Hommey 0eb4a07d1d Bug 1670167 - Unset PYTHONEXECUTABLE once python configure has been reexecuted in the virtualenv. r=firefox-build-system-reviewers,andi,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D93061
2020-10-09 14:27:03 +00:00
Jed Davis 3680ce4b19 Bug 1440203 - Support memfd_create in IPC shared memory. r=glandium
This commit also allows `memfd_create` in the seccomp-bpf policy for all
process types.

`memfd_create` is an API added in Linux 3.17 (and adopted by FreeBSD
for the upcoming version 13) for creating anonymous shared memory
not connected to any filesystem.  Supporting it means that sandboxed
child processes on Linux can create shared memory directly instead of
messaging a broker, which is unavoidably slower, and it should avoid
the problems we'd been seeing with overly small `/dev/shm` in container
environments (which were causing serious problems for using Firefox for
automated testing of frontend projects).

`memfd_create` also introduces the related operation of file seals:
irrevocably preventing types of modifications to a file.  Unfortunately,
the most useful one, `F_SEAL_WRITE`, can't be relied on; see the large
comment in `SharedMemory:ReadOnlyCopy` for details.  So we still use
the applicable seals as defense in depth, but read-only copies are
implemented on Linux by using procfs (and see the comments on the
`ReadOnlyCopy` function in `shared_memory_posix.cc` for the subtleties
there).

There's also a FreeBSD implementation, using `cap_rights_limit` for
read-only copies, if the build host is new enough to have the
`memfd_create` function.

Differential Revision: https://phabricator.services.mozilla.com/D90605
2020-10-08 02:25:20 +00:00
Kartikaya Gupta cfcbbaae93 Bug 1668921 - Update cbindgen version and generate ostream serializers for WR structs. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D92842
2020-10-08 09:24:36 +00:00
Mike Hommey d3519998ac Bug 1520395 - Remove the python configure distinction between option and js_option. r=firefox-build-system-reviewers,andi,rstewart
Now that we don't recurse into the js python configure, we don't need to
have a special treatment for the options that need to be passed down to
that subconfigure, which is what js_option was for.

Differential Revision: https://phabricator.services.mozilla.com/D92727
2020-10-08 04:07:46 +00:00
Mike Hommey a12805866c Bug 1669633 - Remove the JS_STANDALONE option. r=firefox-build-system-reviewers,rstewart
It was only meant to be used internally, when the top-level python
configure invoked the js python subconfigure. Now that this doesn't
happen, we can remove the option, and consolidate js_standalone and
building_js, which are now roughly synonyms.

Differential Revision: https://phabricator.services.mozilla.com/D92726
2020-10-07 17:48:06 +00:00
Mike Hommey 9ebbe2c5bc Bug 1669633 - Don't recurse into js/src for the python-part of configure. r=firefox-build-system-reviewers,rstewart
Instead, we now run js/src/old-configure from the top-level configure
after having run old-configure and extracted a few variables to inherit
from it.

Because we're now running from the top-level, $_objdir is always the
top-level objdir, which simplifies some things. The topobjdir in
js/src/config.status, however, needs to stay in js/src because of the
build frontend expecting it there.

When running js/src/old-configure, we used to need some special
treatment for a large number of variables for historic reasons, where
we'd take values from the assigned values before running old-configure
for some, or from AC_SUBSTs after running old-configure.

Now that both old-configure and js/src/old-configure get the same
assignments from old-configure.vars, we don't need anything special for
the former. And only a few remaining variables still need manual work
for the latter.

One notable difference, though, is that the new code doesn't try to
avoid running js subconfigure, which added complexity, and was actually
error-prone.

Differential Revision: https://phabricator.services.mozilla.com/D92725
2020-10-07 21:13:19 +00:00
Mike Hommey 796301bdaa Bug 1669633 - Turn old_configure into a template. r=firefox-build-system-reviewers,rstewart
This helps reduce the diff size for subsequent patches.

Differential Revision: https://phabricator.services.mozilla.com/D92723
2020-10-07 17:56:27 +00:00
Mike Hommey 485eeaf755 Bug 1669633 - Split prepare_configure and move autoconf to old_configure. r=firefox-build-system-reviewers,rstewart
Preparing to run both old-configure and js/src/old-configure from the
same python configure run, we refactor things such that shared parts are
separate.

Differential Revision: https://phabricator.services.mozilla.com/D92722
2020-10-07 21:34:13 +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
Mike Hommey 1b0b2b298e Bug 1669633 - Don't set AC_SUBSTs and AC_DEFINEs from old-configure directly. r=firefox-build-system-reviewers,rstewart
In order to be able to run both old-configure and js/src/old-configure
from the same python configure run, we need to stop setting the items
set by old-configure into the global sandbox config, and instead store
them to be later handled by configure.py.

Differential Revision: https://phabricator.services.mozilla.com/D92718
2020-10-07 17:59:51 +00:00
Mike Hommey 3a86574eae Bug 1669642 - Rename LLVMCONFIG to LLVM_CONFIG and derive it like we do for LLVM_OBJDUMP. r=firefox-build-system-reviewers,andi,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D92737
2020-10-07 22:36:49 +00:00
Razvan Maries 75a5750a87 Backed out 5 changesets (bug 1662564, bug 1664922, bug 1440203) for Valgrind bustages. CLOSED TREE
Backed out changeset 9366b15ee97c (bug 1440203)
Backed out changeset bb512f5fdeda (bug 1440203)
Backed out changeset be90d6aec690 (bug 1664922)
Backed out changeset f6527a1d0f14 (bug 1662564)
Backed out changeset 3a2941fa7d4b (bug 1662564)
2020-10-07 08:38:13 +03:00
Jed Davis c4968e6653 Bug 1440203 - Support memfd_create in IPC shared memory. r=glandium
This commit also allows `memfd_create` in the seccomp-bpf policy for all
process types.

`memfd_create` is an API added in Linux 3.17 (and adopted by FreeBSD
for the upcoming version 13) for creating anonymous shared memory
not connected to any filesystem.  Supporting it means that sandboxed
child processes on Linux can create shared memory directly instead of
messaging a broker, which is unavoidably slower, and it should avoid
the problems we'd been seeing with overly small `/dev/shm` in container
environments (which were causing serious problems for using Firefox for
automated testing of frontend projects).

`memfd_create` also introduces the related operation of file seals:
irrevocably preventing types of modifications to a file.  Unfortunately,
the most useful one, `F_SEAL_WRITE`, can't be relied on; see the large
comment in `SharedMemory:ReadOnlyCopy` for details.  So we still use
the applicable seals as defense in depth, but read-only copies are
implemented on Linux by using procfs (and see the comments on the
`ReadOnlyCopy` function in `shared_memory_posix.cc` for the subtleties
there).

There's also a FreeBSD implementation, using `cap_rights_limit` for
read-only copies, if the build host is new enough to have the
`memfd_create` function.

Differential Revision: https://phabricator.services.mozilla.com/D90605
2020-10-06 19:20:29 +00:00
Razvan Maries 3b3e92d8ee Backed out changeset a86359ce9e75 (bug 1667892) for L10n bustages. CLOSED TREE 2020-09-30 05:16:28 +03:00
Ricky Stewart 2bb808e369 Bug 1667896 - Remove `MOZ_ANDROID_DISTRIBUTION_DIRECTORY` r=nalexander
This config value is evidently a Fennec thing that isn't used anywhere any more.

Differential Revision: https://phabricator.services.mozilla.com/D91647
2020-09-29 01:51:13 +00:00
Ricky Stewart d9aa989230 Bug 1667892 - Move search for `wget` binary from `old-configure` to Python `configure` r=dmajor
Differential Revision: https://phabricator.services.mozilla.com/D91645
2020-09-28 22:33:33 +00:00
J.C. Jones f2b2199636 Bug 1666567 - land NSS c28e20f61e5d UPGRADE_NSS_RELEASE, r=kjacobs
2020-09-18  Kevin Jacobs  <kjacobs@mozilla.com>

        * automation/abi-check/previous-nss-release, lib/nss/nss.h,
        lib/softoken/softkver.h, lib/util/nssutil.h:
        Set version numbers to 3.58 Beta
        [c28e20f61e5d] [tip]

        * .hgtags:
        Added tag NSS_3_57_RTM for changeset cf7e3e8abd77
        [a963849538ca] <NSS_3_57_BRANCH>

        * lib/nss/nss.h, lib/softoken/softkver.h, lib/util/nssutil.h:
        Set version numbers to 3.57 final
        [cf7e3e8abd77] [NSS_3_57_RTM] <NSS_3_57_BRANCH>

Differential Revision: https://phabricator.services.mozilla.com/D91070
2020-09-22 22:31:15 +00:00
Mike Hommey 76570df2df Bug 1665558 - Remove -Wno-noexcept-type. r=dmajor
It was added in bug 1320656 because back then we were building as C++14
with warnings about future incompatibilities with C++17. Since then,
we've switched to C++17, which means we had to fix those
incompatibilities, and thus they don't exist anymore. A local build with
-Werror=noexcept-type finishes just fine.

This removes the only difference between top-level and js warning flags.

Differential Revision: https://phabricator.services.mozilla.com/D90521
2020-09-17 12:33:48 +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
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
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
Mike Hommey a133ef0e15 Bug 1663863 - Vendor autoconf 2.13. r=firefox-build-system-reviewers,rstewart
The files are copied verbatim from upstream autoconf 2.13 (but only the
files we need) and old.configure is adapted to use the vendored version.

Differential Revision: https://phabricator.services.mozilla.com/D89554
2020-09-09 23:50:38 +00:00
Mike Hommey d5f182fdf4 Bug 1663771 - Allow builds with the 11.0 macOS SDK. r=firefox-build-system-reviewers,rstewart DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D89495
2020-09-08 21:08:48 +00:00
Marco Trevisan fe22cb7f86 Bug 1661094: Always define PKGCONF_REQUIRES_PRIVATE r=froydnj
When configuring without system NSPR the configuration variable
PKGCONF_REQUIRES_PRIVATE isn't ever set, leading to a .pc file that still
contains the @PKGCONF_REQUIRES_PRIVATE@ stub.

Ensure that we always define PKGCONF_REQUIRES_PRIVATE, by setting it to an
empty string in case no system-nsrp is enabled.
In this way, the pkg-config file stub will be always replaced.

Differential Revision: https://phabricator.services.mozilla.com/D88179
2020-09-02 12:24:27 +00:00
David Major 1b886dfdf3 Bug 1641674 - Don't use --gc-sections during profile generation r=froydnj
For not-well-understood reasons, ld's `--gc-sections` discards a large number of the PGO bookkeeping structures that enable us to keep track of function counters, and the effect gets worse in object files generated by clang-10.

As much as I'd like to understand this better, the investigations take way too much time. As a path of least resistance, we can disable `--gc-sections` for the instrumentation phase of PGO builds. It won't harm anything since users never see those builds, and it will improve the performance of the optimized phase greatly.

Differential Revision: https://phabricator.services.mozilla.com/D78112
2020-08-28 20:38:45 +00:00
Ricky Stewart 7813b5eb6d Bug 1661790 - Allow configuring the name of the `virtualenv` used for builds r=nalexander
We don't anticipate end users will actually care to do this, but it's useful especially for unit tests. For example, after bug 1659539, Python `configure` tests will run in a new, non-`init_py3` `virtualenv`, and we'll want to target that `virtualenv` for `configure` rather than having it create a new `virtualenv` for no reason.

Differential Revision: https://phabricator.services.mozilla.com/D88661
2020-08-31 17:13:47 +00:00
Kevin Jacobs ddc8978d1f Bug 1660509 - land NSS c100e11991f6 UPGRADE_NSS_RELEASE, r=jcj
2020-08-21  Kevin Jacobs  <kjacobs@mozilla.com>

	* automation/abi-check/previous-nss-release, lib/nss/nss.h,
	lib/softoken/softkver.h, lib/util/nssutil.h:
	Set version numbers to 3.57 Beta
	[783f49ae6126]

2020-08-24  Kevin Jacobs  <kjacobs@mozilla.com>

	* gtests/ssl_gtest/ssl_auth_unittest.cc, lib/ssl/dtls13con.c,
	lib/ssl/dtlscon.c, lib/ssl/ssl3con.c, lib/ssl/sslimpl.h,
	lib/ssl/sslnonce.c:
	Bug 1653641 - Cleanup inaccurate DTLS comments, code review fixes.
	r=mt

	[0e1b5c711cb9]

2020-08-24  Robert Relyea  <rrelyea@redhat.com>

	* lib/freebl/fipsfreebl.c, lib/softoken/fipstest.c,
	lib/softoken/kbkdf.c, lib/softoken/lowpbe.c, lib/softoken/lowpbe.h,
	lib/softoken/pkcs11c.c, lib/softoken/pkcs11i.h,
	lib/softoken/sftkhmac.c, lib/softoken/sftkike.c:
	Bug 1660304 New FIPS IG requires self-tests for approved kdfs.
	r=ueno comments=kjacobs

	FIPS guidance now requires self-tests for our kdfs. It also requires
	self-tests for cmac which we didn't have in the cmac patch.

	Currently only one test per kdf is necessary. Specifially for
	SP-800-108, only one of the three flavors are needed (counter,
	feedback, or pipeline). This patch includes more complete testing
	but it has been turned off the currently extraneous tests under the
	assumption that NIST guidance may require them in the future. HKDF
	is currently not included in FIPS, but is on track to be included,
	so hkdf have been included in this patch.

	Because the test vectors are const strings, the patch pushes some
	const definitions that were missing in existing private interfaces.

	There are three flavors of self-tests: Function implemented in
	freebl are added to the freebl/fipsfreebl.c Functions implemented in
	pkcs11c.c have selftests completely implemented in
	softoken/fipstest.c Functions implemented in their own .c file have
	their selftest function implemented in that .c file and called by
	fipstests.c These are consistant with the previous choices for
	selftests.

	Some private interfaces that took in keys from pkcs #11 structures
	or outputted keys to pkcs #11 structures were modified to optionally
	take keys in by bytes and output keys as bytes so the self-tests can
	work in just bytes.

	[5dca54fe61c2]

2020-08-25  Daiki Ueno  <dueno@redhat.com>

	* lib/softoken/manifest.mn:
	Bug 1659252, disable building libnssdbm3.so if NSS_DISABLE_DBM=1,
	r=rrelyea

	Reviewers: rrelyea

	Reviewed By: rrelyea

	Bug #: 1659252

	[4d55d36ca6ef]

2020-08-24  Kevin Jacobs  <kjacobs@mozilla.com>

	* lib/pk11wrap/pk11cxt.c, lib/softoken/pkcs11c.c, lib/softoken/sdb.c,
	lib/softoken/sftkpwd.c:
	Bug 1651834 - Fix various static analyzer warnings. r=rrelyea

	[ab04fd73fd6d]

2020-08-28  Mike Hommey  <mh@glandium.org>

	* lib/freebl/blapii.h:
	Bug 1661810 - Define pre_align/post_align based on the compiler.
	r=jcj

	Things worked fine before we upgraded to clang 11 presumably because
	the stack was always 16-bytes aligned in the first place, or
	something akin to that, and the lack of pre_align/post_align doing
	anything didn't matter. The runtime misalignment of the stack may
	well be a clang > 9 bug, but keeping pre_align/post_align tied to
	the x86/x64 is a footgun anyways.

	[c100e11991f6] [tip]

Differential Revision: https://phabricator.services.mozilla.com/D88876
2020-08-31 15:56:19 +00:00
Narcis Beleuzu f81ec36d9c Backed out 3 changesets (bug 1660340, bug 1641674, bug 1660896) for causing Btime failures on Android 7.0 . CLOSED TREE
Backed out changeset d445d03a6ca0 (bug 1660340)
Backed out changeset 94c19736f73e (bug 1660896)
Backed out changeset 0ba092f930cc (bug 1641674)
2020-08-28 23:31:52 +03:00
Mitchell Hentges 6263013db0 Bug 1658976: Configure more-accurately detects host triplet r=froydnj
config.guess infers information about the compiler using environment
variables, such as CC. However, we use such environment variables to
configure the tooling for the target.

Differential Revision: https://phabricator.services.mozilla.com/D88085
2020-08-28 15:49:03 +00:00
Mitchell Hentges 915e40ef2c Bug 1658976: If usable Rust toolchain can't be found, print useful error r=froydnj
Previously, we would optimistically attempt to use a Rust toolchain that
matches the current C toolchain, and would throw an error if an
attempted compile with that Rust toolchain failed.

Instead, if we fail to detect a usable Rust toolchain, we now helpfully
inform users of their two options: change C toolchain, or install
matching Rust toolchain.

Differential Revision: https://phabricator.services.mozilla.com/D88084
2020-08-28 15:49:00 +00:00
Razvan Maries 61299e2191 Backed out 2 changesets (bug 1658976) for Gecko Decision Task bustages. CLOSED TREE
Backed out changeset 80fa7f7eea54 (bug 1658976)
Backed out changeset bcfab5a318fb (bug 1658976)
2020-08-28 18:44:31 +03:00
Mitchell Hentges adffdc8c0d Bug 1658976: Configure more-accurately detects host triplet r=froydnj
config.guess infers information about the compiler using environment
variables, such as CC. However, we use such environment variables to
configure the tooling for the target.

Differential Revision: https://phabricator.services.mozilla.com/D88085
2020-08-28 09:27:01 +00:00
Mitchell Hentges 4b518c4edb Bug 1658976: If usable Rust toolchain can't be found, print useful error r=froydnj
Previously, we would optimistically attempt to use a Rust toolchain that
matches the current C toolchain, and would throw an error if an
attempted compile with that Rust toolchain failed.

Instead, if we fail to detect a usable Rust toolchain, we now helpfully
inform users of their two options: change C toolchain, or install
matching Rust toolchain.

Differential Revision: https://phabricator.services.mozilla.com/D88084
2020-08-28 14:22:43 +00:00
David Major 8549a06e42 Bug 1641674 - Don't use --gc-sections during profile generation r=froydnj
For not-well-understood reasons, ld's `--gc-sections` discards a large number of the PGO bookkeeping structures that enable us to keep track of function counters, and the effect gets worse in object files generated by clang-10.

As much as I'd like to understand this better, the investigations take way too much time. As a path of least resistance, we can disable `--gc-sections` for the instrumentation phase of PGO builds. It won't harm anything since users never see those builds, and it will improve the performance of the optimized phase greatly.

Differential Revision: https://phabricator.services.mozilla.com/D78112
2020-08-27 16:26:23 +00:00
Razvan Maries cd42d16e28 Backed out 3 changesets (bug 1660340, bug 1641674, bug 1660896) for browser time time outs. CLOSED TREE
Backed out changeset edb1d37f48f4 (bug 1660340)
Backed out changeset 9c8388c30032 (bug 1660896)
Backed out changeset 9bf1c5e44a13 (bug 1641674)
2020-08-28 11:44:25 +03:00
David Major 6db6979442 Bug 1641674 - Don't use --gc-sections during profile generation r=froydnj
For not-well-understood reasons, ld's `--gc-sections` discards a large number of the PGO bookkeeping structures that enable us to keep track of function counters, and the effect gets worse in object files generated by clang-10.

As much as I'd like to understand this better, the investigations take way too much time. As a path of least resistance, we can disable `--gc-sections` for the instrumentation phase of PGO builds. It won't harm anything since users never see those builds, and it will improve the performance of the optimized phase greatly.

Differential Revision: https://phabricator.services.mozilla.com/D78112
2020-08-27 16:26:23 +00:00
Hector Zhao 406493d10b Bug 1660725 - Consider `CARGO_HOME` when checking for `rustc` & `cargo` in configure. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D87993
2020-08-24 14:08:17 +00:00
Mike Hommey 140b690554 Bug 1659066 - Always pass --target=arm64-apple-darwin to the compiler on arm64 macOS builds. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D87052
2020-08-22 22:46:08 +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 c876c69397 Bug 1659066 - Always pass --target=arm64-apple-darwin to the compiler on arm64 macOS builds. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D87052
2020-08-21 07:38:35 +00:00
Mitchell Hentges 07133c01bc Bug 1656403: Configure should reject potentially-out-of-date nightlies r=firefox-build-system-reviewers,froydnj
We have a minimum rust version required for compilations. For both stable and beta rust compilers, we can trust that they will have all the stabilized features we're expecting.
However, for nightlies, they may "match" our minimum version, but may have been released in the version window before a certain feature we need has been stabilized.
So, when validating rustc version in configure, ensure that the nightly is at least one version newer than our expected version.

Differential Revision: https://phabricator.services.mozilla.com/D86889
2020-08-21 19:19:36 +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 995ebcae1d Bug 1658483 - Remove references to the github repo that contains MacOSX-SDKs r=mhentges,dmajor
Differential Revision: https://phabricator.services.mozilla.com/D86727
2020-08-11 17:24:34 +00:00
Ricky Stewart cd9a620ede Bug 1657954 - Move various branding options from `old-configure` r=geckoview-reviewers,mhentges,nalexander,snorp
Differential Revision: https://phabricator.services.mozilla.com/D86391
2020-08-11 15:58:52 +00:00
Mike Hommey 2fc8fca5d8 Bug 1658221 - Look for llvm-rc in the toolchain search path. r=dmajor
Differential Revision: https://phabricator.services.mozilla.com/D86493
2020-08-10 16:23:45 +00:00
Mike Hommey 527e667296 Bug 1537703 - Use llvm-rc instead of rc.exe. r=mhentges,froydnj
This makes us use one less tool from MSVC, and removes one more use of wine
in cross builds.

We replace the call to either rc/llvm-rc or windres with a wrapper script.
While the script is not strictly needed for the latter, we use a wrapper
in that case anyway because it's one step towards fixing bug 1498414.
For llvm-rc, however, we need a wrapper because llvm-rc doesn't preprocess
on its own, so the wrapper does that too.

The wrapper script also allows to deal with the default flags passed to
llvm-rc or windres, rather than inherit them from old-configure.

We also need to explicitly pass the codepage to llvm-rc, which was not
necessary with rc (presumably, llvm-rc has a different default).

While here, remove the unused WINDRES subst from js/src/old-configure.in.
Also, while here, we remove --use-temp-file, because as described in the
linked bug and in the windres manual page, it was used to work around bugs
on Windows 98 and earlier.

Differential Revision: https://phabricator.services.mozilla.com/D86312
2020-08-08 21:02:04 +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
Mike Hommey cb9be65521 Bug 1656141 - Stop using MT to insert manifests in binaries. r=firefox-build-system-reviewers,rstewart
We are currently relying on two different ways to insert side-by-side
manifests in binaries on Windows: through resource files, or through
the use of MT. The latter is not supported on mingw builds, which is
not great.

Link.exe has options to add a manifest at link time without relying on
either method above, but that's not supported on mingw either.

So the best we can do is to move everything to using resource files.
This also avoids using MT, which, on cross builds, requires using wine.

Ideally, the manifests would be declared in moz.build, but that
complicates things for cases like TestDllInterceptor, where there are
multiple binaries in the same directory, but only one of them needs the
manifest. This keeps the status quo of getting the manifest
automatically from the source directory.

Differential Revision: https://phabricator.services.mozilla.com/D85382
2020-08-07 00:55:16 +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