Move setup-musl to .circleci scripts (#833)
This commit is contained in:
parent
7106c1554f
commit
34bbea0204
4 changed files with 60 additions and 55 deletions
|
|
@ -192,6 +192,7 @@ jobs:
|
||||||
command: |
|
command: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get -y install gcc g++ zlib1g-dev
|
sudo apt-get -y install gcc g++ zlib1g-dev
|
||||||
|
sudo .circleci/script/setup-musl
|
||||||
- run:
|
- run:
|
||||||
name: Download GraalVM
|
name: Download GraalVM
|
||||||
command: |
|
command: |
|
||||||
|
|
@ -341,14 +342,14 @@ jobs:
|
||||||
command: |
|
command: |
|
||||||
git submodule init
|
git submodule init
|
||||||
git submodule update
|
git submodule update
|
||||||
- run:
|
# - run:
|
||||||
name: "Short circuit on SNAPSHOT"
|
# name: "Short circuit on SNAPSHOT"
|
||||||
command: |
|
# command: |
|
||||||
VERSION=$(cat resources/BABASHKA_VERSION)
|
# VERSION=$(cat resources/BABASHKA_VERSION)
|
||||||
if [[ "$VERSION" == *-SNAPSHOT ]]
|
# if [[ "$VERSION" == *-SNAPSHOT ]]
|
||||||
then
|
# then
|
||||||
circleci task halt
|
# circleci task halt
|
||||||
fi
|
# fi
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- linux-aarch64-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
- linux-aarch64-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||||
|
|
@ -371,6 +372,7 @@ jobs:
|
||||||
command: |
|
command: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get -y install gcc g++ zlib1g-dev
|
sudo apt-get -y install gcc g++ zlib1g-dev
|
||||||
|
sudo -E .circleci/script/setup-musl
|
||||||
- run:
|
- run:
|
||||||
name: Download GraalVM
|
name: Download GraalVM
|
||||||
command: |
|
command: |
|
||||||
|
|
|
||||||
50
.circleci/script/setup-musl
Executable file
50
.circleci/script/setup-musl
Executable file
|
|
@ -0,0 +1,50 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# This script sets up the latest available musl-tools using apt pinning from debian unstable.
|
||||||
|
# The one available in stable and testing are quite outdated and this ensures we get the latest improvements
|
||||||
|
# This explictly installs musl from unstable and keeps the others at a higher priority
|
||||||
|
|
||||||
|
cat >> /etc/apt/sources.list <<eof
|
||||||
|
deb http://ftp.us.debian.org/debian unstable main non-free contrib
|
||||||
|
deb http://non-us.debian.org/debian-non-us unstable/non-us main contrib non-free
|
||||||
|
eof
|
||||||
|
|
||||||
|
cat >> /etc/apt/preferences <<eof
|
||||||
|
Package: *
|
||||||
|
Pin: release a=stable
|
||||||
|
Pin-Priority: 700
|
||||||
|
Package: *
|
||||||
|
Pin: release a=testing
|
||||||
|
Pin-Priority: 650
|
||||||
|
Package: *
|
||||||
|
pin: release a=unstable
|
||||||
|
pin-priority: 600
|
||||||
|
eof
|
||||||
|
|
||||||
|
apt-get update -y && apt-get install musl-tools/unstable -y
|
||||||
|
|
||||||
|
ZLIB_VERSION="1.2.11"
|
||||||
|
|
||||||
|
curl -O -sL "https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz"
|
||||||
|
|
||||||
|
echo "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 zlib-${ZLIB_VERSION}.tar.gz" |
|
||||||
|
sha256sum --check
|
||||||
|
tar xf "zlib-${ZLIB_VERSION}.tar.gz"
|
||||||
|
|
||||||
|
arch=${BABASHKA_ARCH:-"x86_64"}
|
||||||
|
echo "ARCH: $arch"
|
||||||
|
|
||||||
|
cd "zlib-${ZLIB_VERSION}"
|
||||||
|
CC=musl-gcc ./configure --static --prefix=/usr/lib/$arch-linux-musl/
|
||||||
|
make CC=musl-gcc
|
||||||
|
sudo make install
|
||||||
|
export CC=gcc
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# depending on GCC version, we will have different directories here.
|
||||||
|
# for example, for GCC 6.3.0 we will have:
|
||||||
|
# - /usr/lib/gcc/x86_64-linux-gnu/6
|
||||||
|
# - /usr/lib/gcc/x86_64-linux-gnu/6.3.0
|
||||||
|
for dest_dir in /usr/lib/gcc/$arch-linux-gnu/*; do
|
||||||
|
sudo cp -f /usr/lib/$arch-linux-musl/lib/libz.a "$dest_dir"
|
||||||
|
done
|
||||||
|
|
@ -79,29 +79,6 @@ if [ "$BABASHKA_STATIC" = "true" ]; then
|
||||||
args+=("--static" "--libc=musl"
|
args+=("--static" "--libc=musl"
|
||||||
# see https://github.com/oracle/graal/issues/3398
|
# see https://github.com/oracle/graal/issues/3398
|
||||||
"-H:CCompilerOption=-Wl,-z,stack-size=2097152")
|
"-H:CCompilerOption=-Wl,-z,stack-size=2097152")
|
||||||
|
|
||||||
# needs to be in a separate script as we need sudo and >> redirects in it wont work.
|
|
||||||
sudo bash script/setup-musl
|
|
||||||
|
|
||||||
ZLIB_VERSION="1.2.11"
|
|
||||||
|
|
||||||
curl -O -sL "https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz"
|
|
||||||
echo "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 zlib-${ZLIB_VERSION}.tar.gz" | sha256sum --check
|
|
||||||
tar xf "zlib-${ZLIB_VERSION}.tar.gz"
|
|
||||||
cd "zlib-${ZLIB_VERSION}"
|
|
||||||
CC=musl-gcc ./configure --static --prefix=/usr/lib/x86_64-linux-musl/
|
|
||||||
make CC=musl-gcc
|
|
||||||
sudo make install
|
|
||||||
export CC=gcc
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# depending on GCC version, we will have different directories here.
|
|
||||||
# for example, for GCC 6.3.0 we will have:
|
|
||||||
# - /usr/lib/gcc/x86_64-linux-gnu/6
|
|
||||||
# - /usr/lib/gcc/x86_64-linux-gnu/6.3.0
|
|
||||||
for dest_dir in /usr/lib/gcc/x86_64-linux-gnu/*; do
|
|
||||||
sudo cp -f /usr/lib/x86_64-linux-musl/lib/libz.a "$dest_dir"
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BABASHKA_FEATURE_HSQLDB=${BABASHKA_FEATURE_HSQLDB:-}
|
BABASHKA_FEATURE_HSQLDB=${BABASHKA_FEATURE_HSQLDB:-}
|
||||||
|
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# This script sets up the latest available musl-tools using apt pinning from debian unstable.
|
|
||||||
# The one available in stable and testing are quite outdated and this ensures we get the latest improvements
|
|
||||||
# This explictly installs musl from unstable and keeps the others at a higher priority
|
|
||||||
|
|
||||||
cat >> /etc/apt/sources.list <<eof
|
|
||||||
deb http://ftp.us.debian.org/debian unstable main non-free contrib
|
|
||||||
deb http://non-us.debian.org/debian-non-us unstable/non-us main contrib non-free
|
|
||||||
eof
|
|
||||||
|
|
||||||
cat >> /etc/apt/preferences <<eof
|
|
||||||
Package: *
|
|
||||||
Pin: release a=stable
|
|
||||||
Pin-Priority: 700
|
|
||||||
Package: *
|
|
||||||
Pin: release a=testing
|
|
||||||
Pin-Priority: 650
|
|
||||||
Package: *
|
|
||||||
pin: release a=unstable
|
|
||||||
pin-priority: 600
|
|
||||||
eof
|
|
||||||
|
|
||||||
apt-get update -y && apt-get install musl-tools/unstable -y
|
|
||||||
Loading…
Reference in a new issue