Work around #865549, fixes FTBFS on ppc64el
authorXimin Luo <infinity0@debian.org>
Thu, 14 Sep 2017 11:35:21 +0000 (13:35 +0200)
committerXimin Luo <infinity0@debian.org>
Thu, 14 Sep 2017 11:35:21 +0000 (13:35 +0200)
debian/changelog
debian/rules

index d60f3bfffb4157592202e23382410b4847667414..4ad50a4bf7cd278d9d37ef8d1bd3dfc1ccbdf12f 100644 (file)
@@ -1,3 +1,9 @@
+cargo (0.20.0-2) UNRELEASED; urgency=medium
+
+  * Work around #865549, fixes FTBFS on ppc64el.
+
+ -- Ximin Luo <infinity0@debian.org>  Thu, 14 Sep 2017 13:28:00 +0200
+
 cargo (0.20.0-1) unstable; urgency=medium
 
   * New upstream release.
index 81ecff56df5cec6952507e87c0b2f4f6481b3f43..f57328efdcf3b59ed35154f7d85d8c7099cd880e 100755 (executable)
@@ -24,8 +24,15 @@ CARGOFLAGS = --release --target=$(DEB_HOST_RUST_TYPE) --verbose
 # Cargo looks for config in and writes cache to $CARGO_HOME/
 export CARGO_HOME = $(CURDIR)/debian/cargohome
 
+# Work around #865549, needed when using older cargo that is affected by it.
+# TODO: remove after cargo/unstable is a version that was compiled with rustc
+# >= 1.18 where this bug was fixed in Debian (i.e. probably after 0.20).
+ifeq (0,$(shell test $$(uname -s) = "Linux" -a $$(getconf PAGESIZE) -gt 4096; echo $$?))
+  SYSTEM_WORKAROUNDS += ulimit -s $$(expr $$(getconf PAGESIZE) / 1024 '*' 256 + 8192);
+endif
+
 %:
-       dh $@ --with bash-completion
+       $(SYSTEM_WORKAROUNDS) dh $@ --with bash-completion
 
 override_dh_auto_configure:
        cp -a $(CURDIR)/Cargo.lock $(CURDIR)/.Cargo.lock.orig