summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2024-09-08 12:00:12 +0200
committerThomas Weißschuh <linux@weissschuh.net>2025-01-08 22:02:54 +0100
commit4b92b79c5645b21e529caa65100e4797d3d4c87c (patch)
treefb0f09373d091982d1620b120e8c828e55ce0044
parent40384c840ea1944d7c5a392e8975ed088ecf0b37 (diff)
selftests/nolibc: run-tests.sh: detect missing toolchain
The script tries to resolve the path to the current toolchain using realpath, which fails in case it's not installed, and since it's run under -e, it doesn't have the opportunity to display a help message. Let's detect the absence of the required toolchain before running that command and provide a friendlier message when this happens. Link: https://lore.kernel.org/all/ZtlQbpgpn9OQOPyI@1wt.eu/ Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
-rwxr-xr-xtools/testing/selftests/nolibc/run-tests.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/testing/selftests/nolibc/run-tests.sh b/tools/testing/selftests/nolibc/run-tests.sh
index e7ecda4ae796..0f67e80051dc 100755
--- a/tools/testing/selftests/nolibc/run-tests.sh
+++ b/tools/testing/selftests/nolibc/run-tests.sh
@@ -143,6 +143,13 @@ test_arch() {
arch=$1
ct_arch=$(crosstool_arch "$arch")
ct_abi=$(crosstool_abi "$1")
+
+ if [ ! -d "${download_location}gcc-${crosstool_version}-nolibc/${ct_arch}-${ct_abi}/bin/." ]; then
+ echo "No toolchain found in ${download_location}gcc-${crosstool_version}-nolibc/${ct_arch}-${ct_abi}."
+ echo "Did you install the toolchains or set the correct arch ? Rerun with -h for help."
+ return 1
+ fi
+
cross_compile=$(realpath "${download_location}gcc-${crosstool_version}-nolibc/${ct_arch}-${ct_abi}/bin/${ct_arch}-${ct_abi}-")
build_dir="${build_location}/${arch}"
if [ "$werror" -ne 0 ]; then