summaryrefslogtreecommitdiff
path: root/hadrian/build-stack
diff options
context:
space:
mode:
Diffstat (limited to 'hadrian/build-stack')
-rwxr-xr-xhadrian/build-stack13
1 files changed, 13 insertions, 0 deletions
diff --git a/hadrian/build-stack b/hadrian/build-stack
new file mode 100755
index 0000000000..7a45042ebd
--- /dev/null
+++ b/hadrian/build-stack
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+# Make sure that the script exits if Hadrian fails to build
+set -euo pipefail
+
+# Make sure Hadrian is up-to-date
+cd hadrian
+stack build --no-library-profiling ${HADRIAN_NIX:+--nix}
+
+# Run Hadrian in the top-level GHC directory
+stack exec hadrian -- \
+ --directory ".." \
+ "$@"