]> git.proxmox.com Git - rustc.git/commitdiff
Try to do cross-compiling properly
authorXimin Luo <infinity0@debian.org>
Tue, 26 Nov 2019 13:58:44 +0000 (13:58 +0000)
committerXimin Luo <infinity0@debian.org>
Tue, 26 Nov 2019 13:58:44 +0000 (13:58 +0000)
debian/patches/series
debian/patches/u-fix-cross-compile-install-again.patch [new file with mode: 0644]
debian/rules

index 08a7cb02c0a7b44590a5b45f50fe7f569a938ec5..a0575ddfd6d918118854044a50cffd1fa996bfd5 100644 (file)
@@ -7,6 +7,7 @@ u-prefer-local-css.patch
 u-make-tests-work-without-rpath.patch
 u-mips-fixes.diff
 #u-allow-system-compiler-rt.patch
+u-fix-cross-compile-install-again.patch
 
 # not forwarded, or forwarded but unlikely to be merged
 u-reproducible-dl-stage0.patch
diff --git a/debian/patches/u-fix-cross-compile-install-again.patch b/debian/patches/u-fix-cross-compile-install-again.patch
new file mode 100644 (file)
index 0000000..992428d
--- /dev/null
@@ -0,0 +1,19 @@
+--- a/src/bootstrap/install.rs 2019-08-28 15:06:01.604129028 +0100
++++ b/src/bootstrap/install.rs 2019-11-26 11:58:58.621443257 +0000
+@@ -260,10 +260,12 @@
+         install_analysis(builder, self.compiler.stage, self.target);
+     };
+     Rustc, "src/librustc", true, only_hosts: true, {
+-        builder.ensure(dist::Rustc {
+-            compiler: self.compiler,
+-        });
+-        install_rustc(builder, self.compiler.stage, self.target);
++        for host in &builder.hosts {
++            builder.ensure(dist::Rustc {
++                compiler: builder.compiler(builder.top_stage, *host),
++            });
++            install_rustc(builder, self.compiler.stage, *host);
++        }
+     };
+ );
index 6f7701c5a6b4c83dddb0f79f11e446dd726d17f6..75ec916da3d6be8cb3137a8cb4cf11cfeb1de233 100755 (executable)
@@ -196,7 +196,6 @@ override_dh_auto_configure-indep: debian/dh_auto_configure.stamp
 ifeq (true,$(BUILD_DOCS))
 # Change config.toml now and not later, since that might trigger a rebuild
        sed -i -e 's/^docs = false/docs = true/' debian/config.toml
-       sed -i -e 's/^target = \["\(.*\)"\]/target = ["\1", "wasm32-unknown-unknown"]/' debian/config.toml
 endif
 
 override_dh_auto_clean:
@@ -209,6 +208,7 @@ debian/dh_auto_build.stamp:
 
 override_dh_auto_build-arch: debian/dh_auto_build.stamp
 override_dh_auto_build-indep: debian/dh_auto_build.stamp
+       $(RUSTBUILD) build $(RUSTBUILD_FLAGS) --host $(DEB_BUILD_RUST_TYPE) --target wasm32-unknown-unknown src/libstd
 ifeq (true,$(BUILD_DOCS))
        $(RUSTBUILD) doc $(RUSTBUILD_FLAGS)
 endif
@@ -237,9 +237,7 @@ override_dh_auto_test-arch:
        done
 ifeq (, $(filter nocheck,$(DEB_BUILD_PROFILES)))
 ifeq (, $(filter nocheck,$(DEB_BUILD_OPTIONS)))
-       # TODO: eventually, drop --target $(DEB_HOST_RUST_TYPE) and run tests for
-       # all targets including e.g. wasm32-unknown-unknown
-       { $(RUSTBUILD_TEST) --no-fail-fast --target $(DEB_HOST_RUST_TYPE) $(RUSTBUILD_FLAGS) $(RUSTBUILD_TEST_FLAGS); echo $$?; } | tee -a $(TEST_LOG)
+       { $(RUSTBUILD_TEST) --no-fail-fast $(RUSTBUILD_FLAGS) $(RUSTBUILD_TEST_FLAGS); echo $$?; } | tee -a $(TEST_LOG)
        # test that the log has at least 1 pass, to prevent e.g. #57709
        grep -l "^test .* \.\.\. ok$$" $(TEST_LOG)
        echo "==== Debian rustc test report ===="; \
@@ -266,12 +264,14 @@ endif
 endif
 
 override_dh_auto_test-indep:
-ifeq (true,$(BUILD_DOCS))
 ifeq (, $(filter nocheck,$(DEB_BUILD_PROFILES)))
 ifeq (, $(filter nocheck,$(DEB_BUILD_OPTIONS)))
+       # TODO: test wasm32-unknown-unknown but it doesn't yet work
+ifeq (true,$(BUILD_DOCS))
        # Run all rules that test the docs, i.e. in step.rs that depend on default:doc
        $(RUSTBUILD_TEST) --no-fail-fast src/tools/linkchecker $(RUSTBUILD_FLAGS)
 endif
+       test -z "$(RUSTBUILD_TEST_FLAGS)"
 endif
 endif
 
@@ -298,6 +298,7 @@ debian/dh_auto_install.stamp:
 
 override_dh_auto_install-arch: debian/dh_auto_install.stamp
 override_dh_auto_install-indep: debian/dh_auto_install.stamp
+       DESTDIR=$(DEB_DESTDIR) $(RUSTBUILD) install $(RUSTBUILD_FLAGS) --host $(DEB_BUILD_RUST_TYPE) --target wasm32-unknown-unknown src/libstd
 ifeq (true,$(BUILD_DOCS))
        # Brute force to remove privacy-breach-logo lintian warning.
        # We could have updated the upstream sources but it would complexify