]> git.proxmox.com Git - cargo.git/commitdiff
fix i386 build / cross tests
authorFabian Grünbichler <debian@fabian.gruenbichler.email>
Sat, 19 Nov 2022 09:26:24 +0000 (10:26 +0100)
committerFabian Grünbichler <debian@fabian.gruenbichler.email>
Sat, 19 Nov 2022 09:46:36 +0000 (10:46 +0100)
cross tests are disabled, and are broken on i386 because the testsuite's
"alternate" cross target is actually i386. guard the two previously
failing tests so that they don't run with cross tests disabled, as
intended when building packages in Debian.

patch will be filed upstreamed next week.

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
debian/patches/0003-tests-add-missing-cross-disabled-checks.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/0003-tests-add-missing-cross-disabled-checks.patch b/debian/patches/0003-tests-add-missing-cross-disabled-checks.patch
new file mode 100644 (file)
index 0000000..31a804c
--- /dev/null
@@ -0,0 +1,46 @@
+From 981279ccd8f7855faaed010bff0891afff588210 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?=
+ <debian@fabian.gruenbichler.email>
+Date: Sat, 19 Nov 2022 10:24:08 +0100
+Subject: [PATCH] tests: add missing cross disabled checks
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+cross_conmpile::alternate states it should only be used in test cases
+after checking cross_compile::disabled(), which is missing here. these
+tests fail despite setting CFG_DISABLE_CROSS_TESTS on i386, since both
+the host and the alternate cross target would be i686 in that case.
+
+Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
+---
+ tests/testsuite/build_script.rs | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/tests/testsuite/build_script.rs b/tests/testsuite/build_script.rs
+index 902364dff..e458b3262 100644
+--- a/tests/testsuite/build_script.rs
++++ b/tests/testsuite/build_script.rs
+@@ -585,6 +585,9 @@ fn custom_build_linker_bad_host_with_arch() {
+ #[cargo_test]
+ fn custom_build_env_var_rustc_linker_cross_arch_host() {
+     let target = rustc_host();
++    if cross_compile::disabled() {
++        return;
++    }
+     let cross_target = cross_compile::alternate();
+     let p = project()
+         .file(
+@@ -623,6 +626,9 @@ fn custom_build_env_var_rustc_linker_cross_arch_host() {
+ #[cargo_test]
+ fn custom_build_linker_bad_cross_arch_host() {
+     let target = rustc_host();
++    if cross_compile::disabled() {
++        return;
++    }
+     let cross_target = cross_compile::alternate();
+     let p = project()
+         .file(
+-- 
+2.38.1
+
index c82f6582d018da34efaa8dcccef5aa9add721ddc..988a00bc2092f26510517138b98953d335589d54 100644 (file)
@@ -4,3 +4,4 @@
 0001-CVE-2022-36113-avoid-unpacking-.cargo-ok-from-the-cr.patch
 0001-CVE-2022-36114-limit-the-maximum-unpacked-size-of-a-.patch
 disable-fs-specific-test.patch
+0003-tests-add-missing-cross-disabled-checks.patch