Skip to content

Commit

Permalink
Better integrate jemalloc on arm.
Browse files Browse the repository at this point in the history
  • Loading branch information
csasarak committed Sep 6, 2024
1 parent 70026e0 commit 91c57a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
container: fossa/haskell-static-alpine:ghc-9.8.2
project-file: cabal.project.ci.linux
ghc: '9.8.2'
# Linux builds are run in Alpine, which builds them statically;
# using jemalloc reduces the performance impact of this
# over the default libc allocator (which performs very poorly in static builds).
# Non-Linux environments generally don't need `jemalloc`
# and in particular Windows doesn't support it
rust-features: jemalloc
Expand Down Expand Up @@ -93,9 +96,6 @@ jobs:
cabal --version || echo "no cabal"
ghcup --version || echo "no ghcup"
# Linux builds are run in Alpine, which builds them statically;
# using jemalloc reduces the performance impact of this
# over the default libc allocator (which performs very poorly in static builds).
- name: Build Rust dependencies
if: ${{ matrix.os != 'LinuxARM' }}
env:
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
if: ${{ matrix.os == 'LinuxARM' }}
uses: docker://fossa/haskell-static-alpine:ghc-9.8.2
with:
args: ./.github/workflows/scripts/build-arm.sh ${{ runner.os }} ${{ matrix.project-file }}
args: ./.github/workflows/scripts/build-arm.sh ${{ runner.os }} ${{ matrix.project-file }} ${{ matrix.rust-features }}

- name: Build and Unit Test
if: ${{ matrix.os != 'LinuxARM' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/scripts/build-arm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@ set -e
set -x

if [ $# -lt 2 ] ; then
echo "Usage: ./build-arm.sh <RUNNER OS> <PROJECT FILE>"
echo "Usage: ./build-arm.sh <RUNNER OS> <PROJECT FILE> [FEATURES]"
exit 1
fi

RUNNER_OS=$1
PROJECT_FILE=$2
FEATURES=$3

# Install rust tooling
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
. "/home/runner/.cargo/env"
. "$HOME/.cargo/env"

rustc -V
cargo -V

# Build Rust binaries
cargo build --features jemalloc --release
cargo build ${FEATURES:+--features $FEATURES} jemalloc --release

cargo test --release

Expand Down

0 comments on commit 91c57a6

Please sign in to comment.