From 14e053e0a3c31010ddd40233167b886118d14c63 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Mon, 10 May 2021 19:10:11 -0300 Subject: [PATCH] Add BABASHKA_MUSL build variable (#834) This allows building a Babashka binary using musl C libraries instead, instead of hardcoding this accordingly to the CPU arch. --- .circleci/config.yml | 1 + .circleci/script/setup-musl | 62 ------------------------------------- Dockerfile | 2 ++ script/compile | 4 +-- script/setup-musl | 12 +++++++ src/babashka/main.clj | 4 +-- 6 files changed, 19 insertions(+), 66 deletions(-) delete mode 100755 .circleci/script/setup-musl diff --git a/.circleci/config.yml b/.circleci/config.yml index 6d772855..ad653a42 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -155,6 +155,7 @@ jobs: BABASHKA_PLATFORM: linux # used in release script BABASHKA_TEST_ENV: native BABASHKA_STATIC: "true" + BABASHKA_MUSL: "true" BABASHKA_XMX: "-J-Xmx6500m" resource_class: large steps: diff --git a/.circleci/script/setup-musl b/.circleci/script/setup-musl deleted file mode 100755 index 9a28a7f6..00000000 --- a/.circleci/script/setup-musl +++ /dev/null @@ -1,62 +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 - -if [ "$BABASHKA_STATIC" != "true" ] -then - echo "BABASHKA_STATIC wasn't set, skipping musl installation." - exit 0 -fi - -if [ "$BABASHKA_ARCH" = "aarch64" ] -then - echo "GraalVM only supports musl on x86_64" - exit 0 -fi - -cat >> /etc/apt/sources.list <> /etc/apt/preferences <