Bug 1373878 - part 1 - add --enable-rust-tests configure option; r=rillian
authorNathan Froyd <froydnj@mozilla.com>
Mon, 02 Oct 2017 09:21:22 -0400
changeset 383999 5e3876cd293defaca3a4a8c9ba71b134fd0f5740
parent 383998 3495506655854985a4ca3665ce90997b0872b458
child 384000 2dbb140bb423400ceb523377d2f74bee6a47edea
push id32618
push userkwierso@gmail.com
push dateMon, 02 Oct 2017 23:22:53 +0000
treeherdermozilla-central@65dac33a5682 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian
bugs1373878
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1373878 - part 1 - add --enable-rust-tests configure option; r=rillian Because Rust tests require panic=unwind crates and therefore recompiling all crates we normally use (since most of our crates use panic=abort), we've elected to enable Rust tests only if the user asks for it. Hence, this configure option. The configure option also enables build-time execution of the crates, since it's not straightforward to determine at configure time the name of the test binary Cargo will produce (Cargo produces test binaries of the form ${NAME}-${HEX_FINGERPRINT}, but there's no way to determine what ${HEX_FINGERPRINT} is without actually compiling the test binary).
build/moz.configure/rust.configure
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -235,8 +235,15 @@ def rust_target_env_name(triple):
 set_config('RUST_TARGET_ENV_NAME', rust_target_env_name)
 
 # This is used for putting source info into symbol files.
 set_config('RUSTC_COMMIT', depends(rustc_info)(lambda i: i.commit))
 
 # Until we remove all the other Rust checks in old-configure.
 add_old_configure_assignment('RUSTC', rustc)
 add_old_configure_assignment('RUST_TARGET', rust_target_triple)
+
+# This option is separate from --enable-tests because Rust tests are particularly
+# expensive in terms of compile time (especially for code in libxul).
+option('--enable-rust-tests',
+       help='Enable building of Rust tests, and build-time execution of them')
+
+set_config('MOZ_RUST_TESTS', depends('--enable-rust-tests')(lambda v: bool(v)))