| ... |
... |
@@ -275,7 +275,7 @@ function setup() { |
|
275
|
275
|
|
|
276
|
276
|
function fetch_ghc() {
|
|
277
|
277
|
local should_fetch=false
|
|
278
|
|
-
|
|
|
278
|
+
|
|
279
|
279
|
if [ ! -e "$GHC" ]; then
|
|
280
|
280
|
if [ -z "${FETCH_GHC_VERSION:-}" ]; then
|
|
281
|
281
|
fail "GHC not found at '$GHC' and FETCH_GHC_VERSION is not set"
|
| ... |
... |
@@ -292,7 +292,7 @@ function fetch_ghc() { |
|
292
|
292
|
fi
|
|
293
|
293
|
fi
|
|
294
|
294
|
fi
|
|
295
|
|
-
|
|
|
295
|
+
|
|
296
|
296
|
if [ "$should_fetch" = true ]; then
|
|
297
|
297
|
local v="$FETCH_GHC_VERSION"
|
|
298
|
298
|
|
| ... |
... |
@@ -887,8 +887,28 @@ function save_cache () { |
|
887
|
887
|
}
|
|
888
|
888
|
|
|
889
|
889
|
function clean() {
|
|
890
|
|
- rm -R tmp
|
|
891
|
|
- run rm -Rf _build
|
|
|
890
|
+ # When CI_DISPOSABLE_ENVIRONMENT is not true (e.g. using shell
|
|
|
891
|
+ # executor on windows/macos), the project directory is not removed
|
|
|
892
|
+ # by gitlab runner automatically after each job. To mitigate the
|
|
|
893
|
+ # space leak, other than periodic cleaning on the runner host, we
|
|
|
894
|
+ # also must aggressively cleanup build products, otherwise we run
|
|
|
895
|
+ # into out of space errors too frequently.
|
|
|
896
|
+ #
|
|
|
897
|
+ # When CI_DISPOSABLE_ENVIRONMENT is true (using docker executor on
|
|
|
898
|
+ # linux), the runner will do proper cleanup, so no need to do
|
|
|
899
|
+ # anything here.
|
|
|
900
|
+ #
|
|
|
901
|
+ # The exclude list are the artifacts that we do expect to be
|
|
|
902
|
+ # uploaded. Keep in sync with `jobArtifacts` in
|
|
|
903
|
+ # `.gitlab/generate-ci/gen_ci.hs`!
|
|
|
904
|
+ if [[ "${CI_DISPOSABLE_ENVIRONMENT:-}" != true ]]; then
|
|
|
905
|
+ git submodule foreach --recursive git clean -xdf
|
|
|
906
|
+ git clean -xdf \
|
|
|
907
|
+ --exclude=ci_timings.txt \
|
|
|
908
|
+ --exclude=ghc-*.tar.xz \
|
|
|
909
|
+ --exclude=junit.xml \
|
|
|
910
|
+ --exclude=unexpected-test-output.tar.gz
|
|
|
911
|
+ fi
|
|
892
|
912
|
}
|
|
893
|
913
|
|
|
894
|
914
|
function run_hadrian() {
|