From 98c7ea3ddf11d08acd11e30be36b4b56c682d239 Mon Sep 17 00:00:00 2001 From: James Hilliard Date: Sun, 9 Jan 2022 01:47:32 -0700 Subject: [PATCH] package/pkg-cargo.mk: enable -Z target-applies-to-host via env This should be more reliable and fix the host == target bug when doing indirect invocations using the cargo env. Signed-off-by: James Hilliard Signed-off-by: Thomas Petazzoni --- package/pkg-cargo.mk | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/package/pkg-cargo.mk b/package/pkg-cargo.mk index 5f09f39a3f..c8dfc62db2 100644 --- a/package/pkg-cargo.mk +++ b/package/pkg-cargo.mk @@ -27,9 +27,21 @@ PKG_COMMON_CARGO_ENV = \ # passing the -Z target-applies-to-host, which is needed together with # CARGO_TARGET_APPLIES_TO_HOST to fix build problems when target # architecture == host architecture. + +# __CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS="nightly" is to allow +# using nighly features on stable releases, i.e features that are not +# yet considered stable. +# +# CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" "enables the nightly +# configuration option target-applies-to-host value to be set +# +# CARGO_TARGET_APPLIES_TO_HOST="false" is actually setting the value +# for this feature, which we disable, to make sure builds where target +# arch == host arch work correctly PKG_CARGO_ENV = \ $(PKG_COMMON_CARGO_ENV) \ __CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS="nightly" \ + CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" \ CARGO_TARGET_APPLIES_TO_HOST="false" HOST_PKG_CARGO_ENV = \ @@ -94,7 +106,6 @@ define $(2)_BUILD_CMDS $$(if $$(BR2_ENABLE_DEBUG),--debug,--release) \ --manifest-path Cargo.toml \ --locked \ - -Z target-applies-to-host \ $$($(2)_CARGO_BUILD_OPTS) endef else # ifeq ($(4),target)