From 4b01922fcab368d347ba0b082a4f62abfd4d4479 Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Tue, 15 Sep 2026 14:36:43 +0200 Subject: [PATCH 1/3] Bump Mill to 1.1.9 --- .mill-version | 2 +- mill | 96 ++++++++++++++++++++++++++++++--------------------- mill.bat | 8 ++--- 3 files changed, 60 insertions(+), 46 deletions(-) diff --git a/.mill-version b/.mill-version index a5ba932..a5e4282 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -1.1.7 \ No newline at end of file +1.1.9 \ No newline at end of file diff --git a/mill b/mill index 1062824..a31dc73 100755 --- a/mill +++ b/mill @@ -2,7 +2,7 @@ set -e -if [ -z "${DEFAULT_MILL_VERSION}" ] ; then DEFAULT_MILL_VERSION="1.0.6"; fi +if [ -z "${DEFAULT_MILL_VERSION}" ] ; then DEFAULT_MILL_VERSION="1.1.9"; fi if [ -z "${GITHUB_RELEASE_CDN}" ] ; then GITHUB_RELEASE_CDN=""; fi @@ -54,49 +54,67 @@ if [ -z "${MILL_FINAL_DOWNLOAD_FOLDER}" ] ; then MILL_FINAL_DOWNLOAD_FOLDER="${M MILL_NATIVE_SUFFIX="-native" MILL_JVM_SUFFIX="-jvm" -FULL_MILL_VERSION=$MILL_VERSION ARTIFACT_SUFFIX="" -set_artifact_suffix(){ - if [ "$(expr substr $(uname -s) 1 5 2>/dev/null)" = "Linux" ]; then + +# Check if GLIBC version is at least the required version +# Returns 0 (true) if GLIBC >= required version, 1 (false) otherwise +check_glibc_version() { + required_version="2.39" + required_major=$(echo "$required_version" | cut -d. -f1) + required_minor=$(echo "$required_version" | cut -d. -f2) + # Get GLIBC version from ldd --version (first line contains version like "ldd (GNU libc) 2.31") + glibc_version=$(ldd --version 2>/dev/null | head -n 1 | grep -oE '[0-9]+\.[0-9]+$' || echo "") + if [ -z "$glibc_version" ]; then + # If we can't determine GLIBC version, assume it's too old + return 1 + fi + glibc_major=$(echo "$glibc_version" | cut -d. -f1) + glibc_minor=$(echo "$glibc_version" | cut -d. -f2) + if [ "$glibc_major" -gt "$required_major" ]; then + return 0 + elif [ "$glibc_major" -eq "$required_major" ] && [ "$glibc_minor" -ge "$required_minor" ]; then + return 0 + else + return 1 + fi +} + +set_artifact_suffix() { + if [ "$(uname -s 2>/dev/null | cut -c 1-5)" = "Linux" ]; then + # Native binaries require new enough GLIBC; fall back to JVM launcher if older + if ! check_glibc_version; then + return + fi if [ "$(uname -m)" = "aarch64" ]; then ARTIFACT_SUFFIX="-native-linux-aarch64" else ARTIFACT_SUFFIX="-native-linux-amd64"; fi elif [ "$(uname)" = "Darwin" ]; then if [ "$(uname -m)" = "arm64" ]; then ARTIFACT_SUFFIX="-native-mac-aarch64" else ARTIFACT_SUFFIX="-native-mac-amd64"; fi else - echo "This native mill launcher supports only Linux and macOS." 1>&2 - exit 1 + echo "This native mill launcher supports only Linux and macOS." 1>&2 + exit 1 fi } case "$MILL_VERSION" in - *"$MILL_NATIVE_SUFFIX") - MILL_VERSION=${MILL_VERSION%"$MILL_NATIVE_SUFFIX"} - set_artifact_suffix - ;; + *"$MILL_NATIVE_SUFFIX") + MILL_VERSION=${MILL_VERSION%"$MILL_NATIVE_SUFFIX"} + set_artifact_suffix + ;; - *"$MILL_JVM_SUFFIX") + *"$MILL_JVM_SUFFIX") MILL_VERSION=${MILL_VERSION%"$MILL_JVM_SUFFIX"} - ;; - - *) - case "$MILL_VERSION" in - 0.1.*) ;; - 0.2.*) ;; - 0.3.*) ;; - 0.4.*) ;; - 0.5.*) ;; - 0.6.*) ;; - 0.7.*) ;; - 0.8.*) ;; - 0.9.*) ;; - 0.10.*) ;; - 0.11.*) ;; - 0.12.*) ;; - *) - set_artifact_suffix - esac - ;; + ;; + + *) + case "$MILL_VERSION" in + 0.1.* | 0.2.* | 0.3.* | 0.4.* | 0.5.* | 0.6.* | 0.7.* | 0.8.* | 0.9.* | 0.10.* | 0.11.* | 0.12.*) + ;; + *) + set_artifact_suffix + ;; + esac + ;; esac MILL="${MILL_FINAL_DOWNLOAD_FOLDER}/$MILL_VERSION$ARTIFACT_SUFFIX" @@ -104,11 +122,11 @@ MILL="${MILL_FINAL_DOWNLOAD_FOLDER}/$MILL_VERSION$ARTIFACT_SUFFIX" # If not already downloaded, download it if [ ! -s "${MILL}" ] || [ "$MILL_TEST_DRY_RUN_LAUNCHER_SCRIPT" = "1" ] ; then case $MILL_VERSION in - 0.0.* | 0.1.* | 0.2.* | 0.3.* | 0.4.* ) + 0.0.* | 0.1.* | 0.2.* | 0.3.* | 0.4.*) MILL_DOWNLOAD_SUFFIX="" MILL_DOWNLOAD_FROM_MAVEN=0 ;; - 0.5.* | 0.6.* | 0.7.* | 0.8.* | 0.9.* | 0.10.* | 0.11.0-M* ) + 0.5.* | 0.6.* | 0.7.* | 0.8.* | 0.9.* | 0.10.* | 0.11.0-M*) MILL_DOWNLOAD_SUFFIX="-assembly" MILL_DOWNLOAD_FROM_MAVEN=0 ;; @@ -118,13 +136,13 @@ if [ ! -s "${MILL}" ] || [ "$MILL_TEST_DRY_RUN_LAUNCHER_SCRIPT" = "1" ] ; then ;; esac case $MILL_VERSION in - 0.12.0 | 0.12.1 | 0.12.2 | 0.12.3 | 0.12.4 | 0.12.5 | 0.12.6 | 0.12.7 | 0.12.8 | 0.12.9 | 0.12.10 | 0.12.11 ) + 0.12.0 | 0.12.1 | 0.12.2 | 0.12.3 | 0.12.4 | 0.12.5 | 0.12.6 | 0.12.7 | 0.12.8 | 0.12.9 | 0.12.10 | 0.12.11) MILL_DOWNLOAD_EXT="jar" ;; - 0.12.* ) + 0.12.*) MILL_DOWNLOAD_EXT="exe" ;; - 0.* ) + 0.*) MILL_DOWNLOAD_EXT="jar" ;; *) @@ -145,8 +163,8 @@ if [ ! -s "${MILL}" ] || [ "$MILL_TEST_DRY_RUN_LAUNCHER_SCRIPT" = "1" ] ; then if [ "$MILL_TEST_DRY_RUN_LAUNCHER_SCRIPT" = "1" ] ; then - echo $MILL_DOWNLOAD_URL - echo $MILL + echo "$MILL_DOWNLOAD_URL" + echo "$MILL" exit 0 fi @@ -163,7 +181,7 @@ if [ ! -s "${MILL}" ] || [ "$MILL_TEST_DRY_RUN_LAUNCHER_SCRIPT" = "1" ] ; then fi MILL_FIRST_ARG="" -if [ "$1" = "--bsp" ] || [ "${1#"-i"}" != "$1" ] || [ "$1" = "--interactive" ] || [ "$1" = "--no-server" ] || [ "$1" = "--no-daemon" ] || [ "$1" = "--repl" ] || [ "$1" = "--help" ] ; then +if [ "$1" = "--bsp" ] || [ "${1#"-i"}" != "$1" ] || [ "$1" = "--interactive" ] || [ "$1" = "--no-server" ] || [ "$1" = "--no-daemon" ] || [ "$1" = "--help" ] ; then # Need to preserve the first position of those listed options MILL_FIRST_ARG=$1 shift diff --git a/mill.bat b/mill.bat index f4e4b58..f4e4840 100644 --- a/mill.bat +++ b/mill.bat @@ -2,7 +2,7 @@ setlocal enabledelayedexpansion -if [!DEFAULT_MILL_VERSION!]==[] ( set "DEFAULT_MILL_VERSION=1.0.6" ) +if [!DEFAULT_MILL_VERSION!]==[] ( set "DEFAULT_MILL_VERSION=1.1.9" ) if [!MILL_GITHUB_RELEASE_CDN!]==[] ( set "MILL_GITHUB_RELEASE_CDN=" ) @@ -276,12 +276,8 @@ if [%~1%]==[--bsp] ( if [%~1%]==[--no-daemon] ( set MILL_FIRST_ARG=%1% ) else ( - if [%~1%]==[--repl] ( + if [%~1%]==[--help] ( set MILL_FIRST_ARG=%1% - ) else ( - if [%~1%]==[--help] ( - set MILL_FIRST_ARG=%1% - ) ) ) ) From 3e5d53f7eb1d4574d99e19715de339c6e1c5a15c Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Tue, 15 Sep 2026 14:37:38 +0200 Subject: [PATCH 2/3] Bump Coursier to 2.1.25-M26 --- build.mill | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.mill b/build.mill index 8cf5367..5ba8ec3 100644 --- a/build.mill +++ b/build.mill @@ -22,7 +22,7 @@ object Deps { def bouncycastle = "1.86" def caseApp = "2.1.0" def coursierPublish = "0.4.4" - def coursierVersion = "2.1.25-M25" + def coursierVersion = "2.1.25-M26" def graalVmVersion = "22.3.1" def graalVmId = s"graalvm-java17:$graalVmVersion" def expecty = "0.17.1" From 85559983a4cfa99ebcebd4a087ea7eec7b29d075 Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Wed, 16 Sep 2026 10:19:59 +0200 Subject: [PATCH 3/3] Fix static image building --- build.mill | 5 ++++- project/musl-image/setup.sh | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/build.mill b/build.mill index 5ba8ec3..13ed568 100644 --- a/build.mill +++ b/build.mill @@ -154,7 +154,10 @@ object `native-cli` extends ScalaCliSigningModule with ScalaCliSigningPublish { Some( NativeImage.linuxStaticParams( s"$helperImageName:latest", - s"https://github.com/coursier/coursier/releases/download/v${Deps.Versions.coursierVersion}/cs-x86_64-pc-linux.gz" + s"https://github.com/coursier/coursier/releases/download/v${Deps.Versions.coursierVersion}/cs-x86_64-pc-linux-static.gz" + ).copy( + prepareCommand = + """(cd /usr/local/musl/bin && ln -sf x86_64-linux-musl-gcc musl-gcc) && export PATH="/usr/local/musl/bin:$PATH"""" ) ) } diff --git a/project/musl-image/setup.sh b/project/musl-image/setup.sh index fa46ac8..10c9ba3 100755 --- a/project/musl-image/setup.sh +++ b/project/musl-image/setup.sh @@ -7,3 +7,5 @@ for i in x86_64-unknown-linux-musl-*; do dest="$(echo "$i" | sed 's/-unknown//')" ln -s "$i" "$dest" done + +ln -sf x86_64-linux-musl-gcc musl-gcc