Bug 1318981 - part 2 - pass MOZ_DIST as an environment variable to `cargo build`; r=chmanchester
authorNathan Froyd <froydnj@mozilla.com>
Fri, 02 Dec 2016 11:38:45 -0500
changeset 325171 d9d80b5b44fc7b11a935e853844caa8b51cf16d7
parent 325170 f49a4f2953f35a1161d79902ba71e26592371c3d
child 325172 8276296cd50509ba109d115d7b1d3b28b761e97c
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewerschmanchester
bugs1318981
milestone53.0a1
Bug 1318981 - part 2 - pass MOZ_DIST as an environment variable to `cargo build`; r=chmanchester rust-bindgen, at least, will need to know where Gecko's headers are to parse them.
config/rules.mk
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -937,17 +937,17 @@ endif
 # choices, and Cargo only supports two, we choose to enable various
 # optimization levels in our Cargo.toml files all the time, and override the
 # optimization level here, if necessary.  (The Cargo.toml files already
 # specify debug-assertions appropriately for --{disable,enable}-debug.)
 ifndef MOZ_OPTIMIZE
 rustflags_override = RUSTFLAGS='-C opt-level=0'
 endif
 
-CARGO_BUILD = env $(rustflags_override) CARGO_TARGET_DIR=. RUSTC=$(RUSTC) $(CARGO) build $(cargo_build_flags)
+CARGO_BUILD = env $(rustflags_override) CARGO_TARGET_DIR=. RUSTC=$(RUSTC) MOZ_DIST=$(DIST) $(CARGO) build $(cargo_build_flags)
 
 ifdef RUST_LIBRARY_FILE
 
 # Assume any system libraries rustc links against are already in the target's LIBS.
 #
 # We need to run cargo unconditionally, because cargo is the only thing that
 # has full visibility into how changes in Rust sources might affect the final
 # build.