Add a work-around for some Debian porterboxes

This commit is contained in:
Ximin Luo 2017-06-16 13:09:45 +02:00
parent 4e05a94e11
commit 3718c49763
3 changed files with 34 additions and 0 deletions

29
debian/patches/d-host-duplicates.patch vendored Normal file
View File

@ -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 <infinity0@debian.org>
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);
- }
-}

View File

@ -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

2
debian/rules vendored
View File

@ -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)