about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2020-02-17 19:39:38 -0500
committerPietro Albini <pietro@pietroalbini.org>2020-02-18 11:34:59 +0100
commitc992ab23fa14a38c5565889d52ba3a3fb6e1e831 (patch)
tree7bece365542c38dbc626febfb8a3d6f4be1e3f95
parent0176a9eef845e7421b7e2f7ef015333a41a7c027 (diff)
downloadrust-c992ab23fa14a38c5565889d52ba3a3fb6e1e831.tar.gz
rust-c992ab23fa14a38c5565889d52ba3a3fb6e1e831.zip
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.
-rw-r--r--src/ci/azure-pipelines/steps/run.yml3
-rwxr-xr-xsrc/ci/scripts/clean-disk.sh16
2 files changed, 19 insertions, 0 deletions
diff --git a/src/ci/azure-pipelines/steps/run.yml b/src/ci/azure-pipelines/steps/run.yml
index f536388b25b..c39f75aba89 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 00000000000..c50de37c492
--- /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