summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-09-28 10:59:19 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-09-30 00:56:30 -0400
commit594ee2f48f5b8affc85462543c54612ad45802bf (patch)
treeaeef204ff0ae0ccbc5f8d272e2851deab0b735ad
parentf66eaefd5d4a3e0c0822dd3678e5e55a7d972a0d (diff)
downloadhaskell-594ee2f48f5b8affc85462543c54612ad45802bf.tar.gz
testsuite: Make cabal01 more robust to large environments
Sebastian unfortunately wrote a very long commit message in !5667 which caused `xargs` to fail on windows because the environment was too big. Fortunately `xargs` and `rm` don't need anything from the environment so just run those commands in an empty environment (which is what env -i achieves).
-rw-r--r--testsuite/tests/cabal/cabal01/Makefile10
1 files changed, 8 insertions, 2 deletions
diff --git a/testsuite/tests/cabal/cabal01/Makefile b/testsuite/tests/cabal/cabal01/Makefile
index fb73eae7fd..004e4c754e 100644
--- a/testsuite/tests/cabal/cabal01/Makefile
+++ b/testsuite/tests/cabal/cabal01/Makefile
@@ -2,11 +2,17 @@ TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
+# Find all the env variables starting with CI_ to unset them.
+# Otherwise, we might run into environment length limitations on Windows.
+# (See `xargs --show-limits`.)
+VARS_TO_UNSET := $(shell env | grep ^CI_ | egrep -o '^[^=]+')
+unexport $(VARS_TO_UNSET)
+
clean:
rm -rf setup a.out dist/build/testA
rm -rf ,tmp dist ,tmp2
- find . -name "*.o" |xargs rm -f
- find . -name "*.hi" |xargs rm -f
+ find . -name "*.o" -exec rm -f {} \;
+ find . -name "*.hi" -exec rm -f {} \;
rm -fr install-tmp
rm -fr install
rm -f .setup-config .installed-pkg-config