Skip to content

Commit

Permalink
refactor(build_container): global ARCH variable
Browse files Browse the repository at this point in the history
There are several places that need current arch
of the system to install/configure the container.
This commit replaces separate calls of $(uname -m)
with one global ARCH variable.

Signed-off-by: Egor Lazarchuk <[email protected]>
  • Loading branch information
ShadowCurse authored and stefano-garzarella committed Jan 5, 2024
1 parent 46f52c1 commit 30fa4e3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions build_container.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -ex

ARCH=$(uname -m)

apt-get update

# DEBIAN_FRONTEND is set for tzdata.
Expand All @@ -18,8 +20,8 @@ DEBIAN_FRONTEND="noninteractive" apt-get install --no-install-recommends -y \
apt-get clean && rm -rf /var/lib/apt/lists/*

# help musl-gcc find linux headers
pushd /usr/include/$(uname -m)-linux-musl
ln -s ../$(uname -m)-linux-gnu/asm asm
pushd /usr/include/$ARCH-linux-musl
ln -s ../$ARCH-linux-gnu/asm asm
ln -s ../linux linux
ln -s ../asm-generic asm-generic
popd
Expand All @@ -44,7 +46,7 @@ rustup component add miri rust-src --toolchain nightly
rustup component add llvm-tools-preview # needed for coverage

# Install other rust targets.
rustup target add $(uname -m)-unknown-linux-musl $(uname -m)-unknown-none
rustup target add $ARCH-unknown-linux-musl $ARCH-unknown-none

cargo install cargo-llvm-cov

Expand Down

0 comments on commit 30fa4e3

Please sign in to comment.