Bug 1522614 - Move check from bug 1376621 to the RUST_LIBRARY_FILE recipe. r=froydnj

This is a drive-by change, allowing to keep the
force-cargo-library-build recipe more like the others.

Depends on D18181

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Hommey 2019-02-05 21:41:31 +00:00
parent fe99ca1c78
commit 34a96a7a13

View File

@ -187,23 +187,22 @@ endif
# We need to run cargo unconditionally, because cargo is the only thing that # 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 # has full visibility into how changes in Rust sources might affect the final
# build. # build.
#
# When we are building in --enable-release mode; we add an additional check to confirm
# that we are not importing any networking-related functions in rust code. This reduces
# the chance of proxy bypasses originating from rust code.
force-cargo-library-build: force-cargo-library-build:
$(REPORT_BUILD) $(REPORT_BUILD)
$(call CARGO_BUILD,$(target_cargo_env_vars)) --lib $(cargo_target_flag) $(rust_features_flag) -- $(cargo_rustc_flags) $(call CARGO_BUILD,$(target_cargo_env_vars)) --lib $(cargo_target_flag) $(rust_features_flag) -- $(cargo_rustc_flags)
$(RUST_LIBRARY_FILE): force-cargo-library-build
# When we are building in --enable-release mode; we add an additional check to confirm
# that we are not importing any networking-related functions in rust code. This reduces
# the chance of proxy bypasses originating from rust code.
ifndef DEVELOPER_OPTIONS ifndef DEVELOPER_OPTIONS
ifndef MOZ_DEBUG_RUST ifndef MOZ_DEBUG_RUST
ifeq ($(OS_ARCH), Linux) ifeq ($(OS_ARCH), Linux)
$(call py_action,check_binary,--target --networking $(RUST_LIBRARY_FILE)) $(call py_action,check_binary,--target --networking $@)
endif endif
endif endif
endif endif
$(RUST_LIBRARY_FILE): force-cargo-library-build
force-cargo-library-check: force-cargo-library-check:
$(call CARGO_CHECK,$(target_cargo_env_vars)) --lib $(cargo_target_flag) $(rust_features_flag) $(call CARGO_CHECK,$(target_cargo_env_vars)) --lib $(cargo_target_flag) $(rust_features_flag)
else else