diff options
| author | Pietro Albini <pietro@pietroalbini.org> | 2020-06-23 12:08:16 +0200 |
|---|---|---|
| committer | Pietro Albini <pietro@pietroalbini.org> | 2020-07-03 09:34:28 +0200 |
| commit | 1149cf04de68f45a596c5a9479a525a2efb88214 (patch) | |
| tree | da4b7a962159b5051372f6128e2da91c86ec0241 | |
| parent | 5c876f336a8682d2d78827e169045e9a592803f7 (diff) | |
| download | rust-1149cf04de68f45a596c5a9479a525a2efb88214.tar.gz rust-1149cf04de68f45a596c5a9479a525a2efb88214.zip | |
ci: provide feedback when running an image on the wrong host arch
| -rwxr-xr-x | src/ci/docker/run.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index 56fe57d32de..44504f6a938 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -123,6 +123,28 @@ elif [ -f "$docker_dir/disabled/$image/Dockerfile" ]; then - else echo Invalid image: $image + + # Check whether the image exists for other architectures + for arch_dir in "${script_dir}"/host-*; do + # Avoid checking non-directories and the current host architecture directory + if ! [[ -d "${arch_dir}" ]]; then + continue + fi + if [[ "${arch_dir}" = "${docker_dir}" ]]; then + continue + fi + + arch_name="$(basename "${arch_dir}" | sed 's/^host-//')" + if [[ -f "${arch_dir}/${image}/Dockerfile" ]]; then + echo "Note: the image exists for the ${arch_name} host architecture" + elif [[ -f "${arch_dir}/disabled/${image}/Dockerfile" ]]; then + echo "Note: the disabled image exists for the ${arch_name} host architecture" + else + continue + fi + echo "Note: the current host architecture is $(uname -m)" + done + exit 1 fi |
