From c992ab23fa14a38c5565889d52ba3a3fb6e1e831 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Mon, 17 Feb 2020 19:39:38 -0500 Subject: [PATCH] Clean out some default-installed directories This helps us have enough disk space for our builders to be able to complete successfully. For now, the choices are ad-hoc and 'definitely not needed'. This should never fail the build, as everything our build needs should be inside Docker. --- src/ci/azure-pipelines/steps/run.yml | 3 +++ src/ci/scripts/clean-disk.sh | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100755 src/ci/scripts/clean-disk.sh diff --git a/src/ci/azure-pipelines/steps/run.yml b/src/ci/azure-pipelines/steps/run.yml index f536388b25b96..c39f75aba89d8 100644 --- a/src/ci/azure-pipelines/steps/run.yml +++ b/src/ci/azure-pipelines/steps/run.yml @@ -31,6 +31,9 @@ steps: - bash: src/ci/scripts/setup-environment.sh displayName: Setup environment +- bash: src/ci/scripts/clean-disk.sh + displayName: Clean disk + - bash: src/ci/scripts/should-skip-this.sh displayName: Decide whether to run this job diff --git a/src/ci/scripts/clean-disk.sh b/src/ci/scripts/clean-disk.sh new file mode 100755 index 0000000000000..c50de37c492b4 --- /dev/null +++ b/src/ci/scripts/clean-disk.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# This script deletes some of the Azure-provided artifacts. We don't use these, +# and disk space is at a premium on our builders. + +set -euo pipefail +IFS=$'\n\t' + +source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" + +# All the Linux builds happen inside Docker. +if isLinux; then + # 6.7GB + sudo rm -rf /opt/ghc + # 16GB + sudo rm -rf /usr/share/dotnet +fi