Skip to content

Commit

Permalink
Fix #127: linux aarch64 (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Apr 9, 2023
1 parent 5598c6a commit 4ab5b1c
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 3 deletions.
74 changes: 71 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,72 @@ jobs:
- store_artifacts:
path: /tmp/release
destination: release
buildlinux-aarch64:
machine:
enabled: true
image: ubuntu-2004:current
resource_class: arm.medium
working_directory: ~/repo
environment:
LEIN_ROOT: "true"
GRAALVM_HOME: /home/circleci/graalvm-ce-java11-22.3.0
JET_PLATFORM: linux # used in release script
JET_ARCH: aarch64
JET_TEST_ENV: native
BABASHKA_STATIC: "true"

steps:
- checkout
- run:
name: Check max glibc version
command: script/check_glibc.sh
- restore_cache:
keys:
- buildlinux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
- run:
name: Install Clojure
command: |
wget https://download.clojure.org/install/linux-install-1.10.1.447.sh
chmod +x linux-install-1.10.1.447.sh
sudo ./linux-install-1.10.1.447.sh
- run:
name: Install native dev tools
command: |
sudo apt-get update
sudo apt-get -y install build-essential zlib1g-dev
- run:
name: Download GraalVM
command: |
cd ~
if ! [ -d graalvm-ce-java11-22.3.0 ]; then
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.0/graalvm-ce-java11-linux-aarch64-22.3.0.tar.gz
tar xzf graalvm-ce-java11-linux-aarch64-22.3.0.tar.gz
fi
- run:
name: Build binary
command: |
script/compile
no_output_timeout: 30m
- run:
name: Run tests
command: |
script/test
# - run:
# name: Performance report
# command: |
# .circleci/script/performance
- run:
name: Release
command: |
.circleci/script/release
- save_cache:
paths:
- ~/.m2
- ~/graalvm-ce-java11-22.3.0
key: buildlinux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
- store_artifacts:
path: /tmp/release
destination: release
deploy:
docker:
- image: circleci/clojure:lein-2.9.1
Expand All @@ -169,9 +235,9 @@ jobs:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "project.clj" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- v1-dependencies-{{ checksum "project.clj" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: .circleci/script/deploy
- save_cache:
paths:
Expand All @@ -194,6 +260,7 @@ workflows:
jobs:
- testjvm
- buildlinux
- buildlinux-aarch64
- buildmac
- deploy:
filters:
Expand All @@ -202,6 +269,7 @@ workflows:
requires:
- testjvm
- buildlinux
- buildlinux-aarch64
- buildmac
# - docker:
# filters:
Expand Down
15 changes: 15 additions & 0 deletions script/check_glibc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

function ver_lte() {
printf '%s\n%s' "$1" "$2" | sort -C -V
}

max_glibc_version="2.31"
current_glibc_version=$(ldd --version | head -1 | awk '{print $4}' | cut -d "-" -f 1)

function bail() {
echo "glibc greater than max version ${max_glibc_version}: ${current_glibc_version}"
exit 1
}

ver_lte "${current_glibc_version}" "${max_glibc_version}" || bail

0 comments on commit 4ab5b1c

Please sign in to comment.