Skip to content

Commonize uname -m results for aarch64 in docker runner #127828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ do
shift
done

# MacOS reports "arm64" while Linux reports "aarch64". Commonize this.
machine="$(uname -m | sed 's/arm64/aarch64/')"

script_dir="`dirname $script`"
docker_dir="${script_dir}/host-$(uname -m)"
docker_dir="${script_dir}/host-${machine}"
ci_dir="`dirname $script_dir`"
src_dir="`dirname $ci_dir`"
root_dir="`dirname $src_dir`"
Expand Down Expand Up @@ -68,7 +71,7 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then

# Include the architecture in the hash key, since our Linux CI does not
# only run in x86_64 machines.
uname -m >> $hash_key
echo "$machine" >> $hash_key

# Include cache version. Can be used to manually bust the Docker cache.
echo "2" >> $hash_key
Expand Down Expand Up @@ -178,7 +181,7 @@ elif [ -f "$docker_dir/disabled/$image/Dockerfile" ]; then
build \
--rm \
-t rust-ci \
-f "host-$(uname -m)/$image/Dockerfile" \
-f "host-${machine}/$image/Dockerfile" \
-
else
echo Invalid image: $image
Expand All @@ -201,7 +204,7 @@ else
else
continue
fi
echo "Note: the current host architecture is $(uname -m)"
echo "Note: the current host architecture is $machine"
done

exit 1
Expand Down
Loading