瀏覽代碼

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 <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
James Hilliard 3 年之前
父節點
當前提交
98c7ea3ddf
共有 1 個文件被更改,包括 12 次插入1 次删除
  1. 12 1
      package/pkg-cargo.mk

+ 12 - 1
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)