Skip to content

Commit 437fb8b

Browse files
committed
Fix: Do not install rust on mips64el
1 parent 676da62 commit 437fb8b

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=var-cache-
4141
--mount=type=tmpfs,target=/tmp \
4242
--mount=type=tmpfs,target=/sasl-xoauth2 \
4343
--mount=type=bind,from=build-scripts,source=/build-scripts,target=/build-scripts \
44-
sh /build-scripts/sasl-build.sh
44+
bash /build-scripts/sasl-build.sh
4545

4646
# ============================ Prepare main image ============================
4747
FROM sasl

build-scripts/sasl-build.sh

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env bash
22
set -e
33

4+
local arch="$(uname -m)"
5+
46
# Build the sasl2 library with the sasl-xoauth2 plugin.
57
#
68
# The sasl-xoauth2 plugin is a SASL plugin that provides support for XOAUTH2 (OAuth 2.0) authentication.
@@ -46,17 +48,19 @@ build_sasl2() {
4648
# (because they don't exist in the PIP repositories) and "pip install" will fail without rust. Specifically, when
4749
# compiling cryptographic libraries.
4850
setup_rust() {
49-
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal
50-
export PATH="$HOME/.cargo/bin:$PATH"
51-
. "$HOME/.cargo/env"
51+
if [[ "${arch}"!= "386" ]] && [[ "${arch}"!= "i386" ]] && [[ "${arch}"!= "mips64el" ]]; then
52+
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal
53+
export PATH="$HOME/.cargo/bin:$PATH"
54+
. "$HOME/.cargo/env"
55+
fi
5256
}
5357

5458
# Create a virtual environment and install the msal library for the
5559
# sasl-xoauth2-tool.
5660
setup_python_venv() {
5761
python3 -m venv /sasl
5862
. /sasl/bin/activate
59-
if [[ "$(uname -m)"!= "386" ]] && [[ "$(uname -m)"!= "i386" ]]; then
63+
if [[ "${arch}"!= "386" ]] && [[ "${arch}"!= "i386" ]] && [[ "${arch}"!= "mips64el" ]]; then
6064
pip3 install msal
6165
fi
6266
}
@@ -96,7 +100,9 @@ else
96100
# Run compilation and installation
97101
setup_rust
98102
base_install
99-
rustup self uninstall -y
103+
if [[ "${arch}"!= "386" ]] && [[ "${arch}"!= "i386" ]] && [[ "${arch}"!= "mips64el" ]]; then
104+
rustup self uninstall -y
105+
fi
100106

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

0 commit comments

Comments
 (0)