summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2018-12-23 01:19:36 -0500
committerBen Gamari <ben@smart-cactus.org>2018-12-24 22:35:13 -0500
commit3aa8c593ca8647c5a3a05a84819d515ea3a69538 (patch)
treec2e8ce32363e8e1cb5bbfe3b50f21b705c4adff1
parent6fff2d25dbfdda5e6ca6fecddd097cc10538937f (diff)
downloadhaskell-3aa8c593ca8647c5a3a05a84819d515ea3a69538.tar.gz
gitlab-ci: Use per-build temporary directory on Windows
I have seen several instances of inexplicable "Access denied" errors on Windows. Using per-build temporary directories avoids any chance of interference between builds and eliminates the possibility of temporary files leaking beyond the life of the build.
-rw-r--r--.gitlab-ci.yml15
1 files changed, 12 insertions, 3 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6b1a22f112..c906b3e1b9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -302,12 +302,23 @@ validate-x86_64-linux-deb9-unreg:
before_script:
- git clean -xdf
- git submodule foreach git clean -xdf
- - PATH=C:\msys64\usr\bin;%PATH%
+
+ # Use a local temporary directory to ensure that concurrent builds don't
+ # interfere with one another
+ - |
+ mkdir tmp
+ set TMP=%cd%\tmp
+ set TEMP=%cd%\tmp
+
+ - set PATH=C:\msys64\usr\bin;%PATH%
- python .gitlab/fix-submodules.py
- git submodule sync --recursive
- git submodule update --init --recursive
- git checkout .gitmodules
- bash .gitlab/win32-init.sh
+ after_script:
+ - rd /s /q tmp
+ - bash -c 'cp -Rf $APPDATA/cabal cabal-cache'
cache:
paths:
- cabal-cache
@@ -333,7 +344,6 @@ validate-x86_64-windows-hadrian:
- bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --flavour=Quick --no-lint"
- bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh binary-dist"
- bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
- - cp -Rf $APPDATA/cabal cabal-cache
cache:
key: x86_64-windows
tags:
@@ -352,7 +362,6 @@ validate-x86_64-windows:
bash -c './configure --with-ghc=`pwd`/toolchain/bin/ghc --enable-tarballs-autodownload HappyCmd=`pwd`/toolchain/bin/happy AlexCmd=`pwd`/toolchain/bin/alex'
- bash -c "PATH=`pwd`/toolchain/bin:$PATH make -j`mk/detect-cpu-count.sh`"
- bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
- - cp -Rf $APPDATA/cabal cabal-cache
cache:
key: x86_64-windows
tags: