From 3718c497635d3e14ce1e9406702bc44df7d03fbd Mon Sep 17 00:00:00 2001 From: Ximin Luo Date: Fri, 16 Jun 2017 13:09:45 +0200 Subject: [PATCH] Add a work-around for some Debian porterboxes --- debian/patches/d-host-duplicates.patch | 29 ++++++++++++++++++++++++++ debian/patches/series | 3 +++ debian/rules | 2 ++ 3 files changed, 34 insertions(+) create mode 100644 debian/patches/d-host-duplicates.patch diff --git a/debian/patches/d-host-duplicates.patch b/debian/patches/d-host-duplicates.patch new file mode 100644 index 0000000000..6a73aa1e6d --- /dev/null +++ b/debian/patches/d-host-duplicates.patch @@ -0,0 +1,29 @@ +Description: Work around #842634 on some machines, e.g. Debian porterboxes + This should remain commented-out in debian/patches/series, it's not needed everywhere +Author: Ximin Luo +Forwarded: not-needed +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/src/libstd/sys_common/net.rs ++++ b/src/libstd/sys_common/net.rs +@@ -616,20 +616,3 @@ + .finish() + } + } +- +-#[cfg(test)] +-mod tests { +- use super::*; +- use collections::HashMap; +- +- #[test] +- fn no_lookup_host_duplicates() { +- let mut addrs = HashMap::new(); +- let lh = match lookup_host("localhost") { +- Ok(lh) => lh, +- Err(e) => panic!("couldn't resolve `localhost': {}", e) +- }; +- let _na = lh.map(|sa| *addrs.entry(sa).or_insert(0) += 1).count(); +- assert!(addrs.values().filter(|&&v| v > 1).count() == 0); +- } +-} diff --git a/debian/patches/series b/debian/patches/series index ae13fc7e8c..ae14e44c40 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -27,3 +27,6 @@ d-dynamic-link-llvm.patch d-use-system-jquery.patch d-no-web-dependencies-in-doc.patch d-cross-compile-install.patch + +# Work around for some porterboxes, keep this commented +#d-host-duplicates.patch diff --git a/debian/rules b/debian/rules index 04f5eb490e..a02c6e70d2 100755 --- a/debian/rules +++ b/debian/rules @@ -125,6 +125,8 @@ override_dh_auto_configure: debian/config.toml ! grep --color=always -i 'll...?$(OLD_LLVM_VERSION)' --exclude=changelog -R debian $(PRECONFIGURE_CHECK) if [ -d stage0 ]; then mkdir -p build && ln -sfT ../stage0 build/cache; fi + # avoid having to do this manually all the time + if [ -n "$(shell grep "Debian .*porterbox" /etc/motd)" ]; then debian/ensure-patch -N debian/patches/d-host-duplicates.patch; fi PATH="$$PWD/debian/bin:$$PATH" \ ./configure $(DEB_CONFIGURE_FLAGS)