Package: release.debian.org Severity: normal User: release.debian....@packages.debian.org Usertags: unblock
Please unblock package cargo It fixes a FTBFS on i386. unblock cargo/0.33.0-3 -- System Information: Debian Release: buster/sid APT prefers testing APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'stable'), (300, 'unstable'), (100, 'experimental'), (1, 'experimental-debug') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.19.0-2-amd64 (SMP w/4 CPU cores) Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8), LANGUAGE=en_GB:en (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled
diff -Nru cargo-0.33.0/debian/bin/cargo cargo-0.33.0/debian/bin/cargo --- cargo-0.33.0/debian/bin/cargo 2019-01-23 20:34:05.000000000 -0800 +++ cargo-0.33.0/debian/bin/cargo 2019-05-18 19:10:07.000000000 -0700 @@ -54,9 +54,6 @@ include /usr/share/rustc/architecture.mk export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE - -Due to https://github.com/rust-lang/cargo/issues/6338 you may want to *unset* -RUSTFLAGS; if it's set (even to empty) it will break this script. """ import os @@ -79,7 +76,7 @@ def sourcepath(p=None): return os.path.join(os.getcwd(), p) if p else os.getcwd() -def prepare_debian(cargo_home, registry, cratespec, host_gnu_type, ldflags, link_from_system): +def prepare_debian(cargo_home, registry, cratespec, host_gnu_type, ldflags, link_from_system, extra_rustflags): registry_path = sourcepath(registry) if link_from_system: log("linking %s/* into %s/" % (SYSTEM_REGISTRY, registry_path)) @@ -96,8 +93,10 @@ rustflags.extend(["-C", "linker=%s-gcc" % host_gnu_type]) for f in ldflags: rustflags.extend(["-C", "link-arg=%s" % f]) - rustflags.extend(["--remap-path-prefix", - "%s=%s/%s" % (sourcepath(), SYSTEM_REGISTRY, cratespec.replace("_", "-"))]) + if link_from_system: + rustflags.extend(["--remap-path-prefix", "%s=%s/%s" % + (sourcepath(), SYSTEM_REGISTRY, cratespec.replace("_", "-"))]) + rustflags.extend(extra_rustflags.split()) # TODO: we cannot enable this until dh_shlibdeps works correctly; atm we get: # dpkg-shlibdeps: warning: can't extract name and version from library name 'libstd-XXXXXXXX.so' @@ -170,8 +169,12 @@ log("rust_type, gnu_type:", ", ".join([host_rust_type, host_gnu_type])) if "RUSTFLAGS" in os.environ: - log("\033[33;1mWARNING: RUSTFLAGS is set; this will probably override all Debian rust settings.\033[0m") - log("\033[33;1mWARNING: It is highly recommended to unset it; please see https://github.com/rust-lang/cargo/issues/6338 for details.\033[0m") + # see https://github.com/rust-lang/cargo/issues/6338 for explanation on why we must do this + log("unsetting RUSTFLAGS and assuming it will be (or already was) added to $CARGO_HOME/config") + extra_rustflags = os.environ["RUSTFLAGS"] + del os.environ["RUSTFLAGS"] + else: + extra_rustflags = "" if args[0] == "prepare-debian": registry = args[1] @@ -180,7 +183,7 @@ link_from_system = True return prepare_debian(cargo_home, registry, os.environ["DEB_CARGO_CRATE"], host_gnu_type, - os.getenv("LDFLAGS", "").split(), link_from_system) + os.getenv("LDFLAGS", "").split(), link_from_system, extra_rustflags) newargs = [] subcmd = None diff -Nru cargo-0.33.0/debian/changelog cargo-0.33.0/debian/changelog --- cargo-0.33.0/debian/changelog 2019-02-05 20:52:47.000000000 -0800 +++ cargo-0.33.0/debian/changelog 2019-05-18 20:22:22.000000000 -0700 @@ -1,3 +1,16 @@ +cargo (0.33.0-3) unstable; urgency=medium + + * Drop patch to capture rustc error output, it is unnecessary. + * Add upstream patch to fix typenum bug. + + -- Ximin Luo <infini...@debian.org> Sat, 18 May 2019 20:22:22 -0700 + +cargo (0.33.0-2) unstable; urgency=medium + + * Add patch to capture rustc error output if extra-verbose. + + -- Ximin Luo <infini...@debian.org> Sat, 18 May 2019 12:14:38 -0700 + cargo (0.33.0-1) unstable; urgency=medium * New upstream release. diff -Nru cargo-0.33.0/debian/control cargo-0.33.0/debian/control --- cargo-0.33.0/debian/control 2018-11-04 11:16:22.000000000 -0800 +++ cargo-0.33.0/debian/control 2019-05-18 18:57:04.000000000 -0700 @@ -70,3 +70,5 @@ project. . This package contains the documentation. + +# TODO: add a cargo-src package diff -Nru cargo-0.33.0/debian/patches/1001_typenum_pr_115.patch cargo-0.33.0/debian/patches/1001_typenum_pr_115.patch --- cargo-0.33.0/debian/patches/1001_typenum_pr_115.patch 1969-12-31 16:00:00.000000000 -0800 +++ cargo-0.33.0/debian/patches/1001_typenum_pr_115.patch 2019-05-18 18:38:19.000000000 -0700 @@ -0,0 +1,23 @@ +From 0d5196feadafa77c727f517d747ffcf3fd0e8ba9 Mon Sep 17 00:00:00 2001 +From: Michael Hudson-Doyle <michael.hud...@canonical.com> +Date: Wed, 13 Mar 2019 15:55:30 +1300 +Subject: [PATCH] round result of (highest as f64).log(2.0) + +Even though (1024f64).log(2.0) has an exact, representable, value, with rustc 1.32 on i386 it comes out as +9.999999999999999985 with optimization enabled. And the rustc doesn't like having two defintions for U1024 etc. +--- + build/main.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/build/main.rs b/build/main.rs +index 16b0ffe2f..b7939f993 100644 +--- a/vendor/typenum/build/main.rs ++++ b/vendor/typenum/build/main.rs +@@ -81,7 +81,7 @@ pub fn no_std() {} + fn main() { + let highest: u64 = 1024; + +- let first2: u32 = (highest as f64).log(2.0) as u32 + 1; ++ let first2: u32 = (highest as f64).log(2.0).round() as u32 + 1; + let first10: u32 = (highest as f64).log(10.0) as u32 + 1; + let uints = (0..(highest + 1)) + .chain((first2..64).map(|i| 2u64.pow(i))) diff -Nru cargo-0.33.0/debian/patches/series cargo-0.33.0/debian/patches/series --- cargo-0.33.0/debian/patches/series 2019-02-05 20:13:45.000000000 -0800 +++ cargo-0.33.0/debian/patches/series 2019-05-18 18:39:11.000000000 -0700 @@ -1,3 +1,4 @@ +1001_typenum_pr_115.patch 1003_increase_timeout_for_slow_arches_like_mips.patch 2002_disable-net-tests.patch 2005_disable_fetch_cross_tests.patch diff -Nru cargo-0.33.0/debian/rules cargo-0.33.0/debian/rules --- cargo-0.33.0/debian/rules 2019-02-05 20:11:09.000000000 -0800 +++ cargo-0.33.0/debian/rules 2019-05-18 19:07:23.000000000 -0700 @@ -13,6 +13,7 @@ export CARGO_HOME = $(CURDIR)/debian/cargo_home export DEB_CARGO_CRATE=cargo_$(DEB_VERSION_UPSTREAM) export DEB_CARGO_PACKAGE=cargo +export RUSTFLAGS += --remap-path-prefix=$(CURDIR)=/usr/src/cargo-$(DEB_VERSION_UPSTREAM) # don't shrink, this can take ages # see https://github.com/rust-lang/cargo/issues/6490 for details