Skip to content

Commit 449d8fe

Browse files
committed
guix: Expand on INT trap message
1 parent 3f1f03c commit 449d8fe

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

contrib/guix/guix-build.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,29 @@ time-machine() {
2121
-- "$@"
2222
}
2323

24+
# Function to be called when building for host ${1} and the user interrupts the
25+
# build
26+
int_trap() {
27+
cat << EOF
28+
** INT received while building ${1}, you may want to clean up the relevant
29+
output, deploy, and distsrc-* directories before rebuilding
30+
31+
Hint: To blow everything away, you may want to use:
32+
33+
$ git clean -xdff --exclude='/depends/SDKs/*'
34+
35+
Specifically, this will remove all files without an entry in the index,
36+
excluding the SDK directory. Practically speaking, this means that all ignored
37+
and untracked files and directories will be wiped, allowing you to start anew.
38+
EOF
39+
}
40+
2441
# Deterministically build Bitcoin Core for HOSTs (overridable by environment)
2542
# shellcheck disable=SC2153
2643
for host in ${HOSTS=x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu x86_64-w64-mingw32}; do
2744

2845
# Display proper warning when the user interrupts the build
29-
trap 'echo "** INT received while building ${host}, you may want to clean up the relevant output and distsrc-* directories before rebuilding"' INT
46+
trap 'int_trap ${host}' INT
3047

3148
(
3249
# Required for 'contrib/guix/manifest.scm' to output the right manifest

0 commit comments

Comments
 (0)