Skip to content

Commit 6fd4b11

Browse files
committed
Fix: Install rust and cargo through apk for Alpine
Otherwise, rus installer will die with "unsupported platform" on certain architectures.
1 parent 430b881 commit 6fd4b11

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

build-scripts/sasl-build.sh

+3-5
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,8 @@ setup_python_venv() {
6464
# 1. sasl2 using the sasl-xoauth2 plugin
6565
# 2. a python virtual environment with the msal library
6666
base_install() {
67-
setup_rust
68-
command -v rustc
69-
command -v cargo
7067
build_sasl2
7168
setup_python_venv
72-
rustup self uninstall -y
7369
}
7470

7571

@@ -80,7 +76,7 @@ base_install() {
8076
# Alpine Linux has a different package management system than Debian-based systems.
8177
if [ -f /etc/alpine-release ]; then
8278
# Install necessary libraries
83-
LIBS="git cmake clang make gcc g++ libc-dev pkgconfig curl-dev jsoncpp-dev cyrus-sasl-dev patch libffi-dev python3-dev"
79+
LIBS="git cmake clang make gcc g++ libc-dev pkgconfig curl-dev jsoncpp-dev cyrus-sasl-dev patch libffi-dev python3-dev rust cargo"
8480
apk add --upgrade curl
8581
apk add --upgrade --virtual .build-deps ${LIBS}
8682

@@ -96,7 +92,9 @@ else
9692
apt-get install -y --no-install-recommends ${LIBS}
9793

9894
# Run compilation and installation
95+
setup_rust
9996
base_install
97+
rustup self uninstall -y
10098

10199
# Cleanup. This is important to ensure that we don't keep unnecessary files laying around and thus increasing the size of the image.
102100
apt-get remove --purge -y ${LIBS} python3-venv

0 commit comments

Comments
 (0)