From 3b62bcc08f58603cfe35f1d574fe2b1f4b03dab1 Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Tue, 2 Dec 2025 13:43:51 +0100 Subject: [PATCH 01/11] Bump `scalafmt` to 3.10.2 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index ab867de..7fbf7d3 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.9.9" +version = "3.10.2" align.preset = more maxColumn = 100 From 7a12fb2ed18fb9cf6ee6c6670c68315a1c93667b Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Tue, 2 Dec 2025 13:44:41 +0100 Subject: [PATCH 02/11] Bump Mill to 1.0.6 --- .mill-version | 2 +- mill | 262 +++++++++++--------------------------------------- mill.bat | 129 +++++++++++++------------ 3 files changed, 121 insertions(+), 272 deletions(-) diff --git a/.mill-version b/.mill-version index ee90284..af0b7dd 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -1.0.4 +1.0.6 diff --git a/mill b/mill index 8dc441b..1062824 100755 --- a/mill +++ b/mill @@ -1,64 +1,15 @@ #!/usr/bin/env sh -# This is a wrapper script, that automatically selects or downloads Mill from Maven Central or GitHub release pages. -# -# This script determines the Mill version to use by trying these sources -# - env-variable `MILL_VERSION` -# - local file `.mill-version` -# - local file `.config/mill-version` -# - `mill-version` from YAML fronmatter of current buildfile -# - if accessible, find the latest stable version available on Maven Central (https://repo1.maven.org/maven2) -# - env-variable `DEFAULT_MILL_VERSION` -# -# If a version has the suffix '-native' a native binary will be used. -# If a version has the suffix '-jvm' an executable jar file will be used, requiring an already installed Java runtime. -# If no such suffix is found, the script will pick a default based on version and platform. -# -# Once a version was determined, it tries to use either -# - a system-installed mill, if found and it's version matches -# - an already downloaded version under ~/.cache/mill/download -# -# If no working mill version was found on the system, -# this script downloads a binary file from Maven Central or Github Pages (this is version dependent) -# into a cache location (~/.cache/mill/download). -# -# Mill Project URL: https://github.com/com-lihaoyi/mill -# Script Version: 1.0.0-M1-21-7b6fae-DIRTY892b63e8 -# -# If you want to improve this script, please also contribute your changes back! -# This script was generated from: dist/scripts/src/mill.sh -# -# Licensed under the Apache License, Version 2.0 - set -e -if [ "$1" = "--setup-completions" ] ; then - # Need to preserve the first position of those listed options - MILL_FIRST_ARG=$1 - shift -fi - -if [ -z "${DEFAULT_MILL_VERSION}" ] ; then - DEFAULT_MILL_VERSION=1.0.4 -fi - +if [ -z "${DEFAULT_MILL_VERSION}" ] ; then DEFAULT_MILL_VERSION="1.0.6"; fi -if [ -z "${GITHUB_RELEASE_CDN}" ] ; then - GITHUB_RELEASE_CDN="" -fi +if [ -z "${GITHUB_RELEASE_CDN}" ] ; then GITHUB_RELEASE_CDN=""; fi +if [ -z "$MILL_MAIN_CLI" ] ; then MILL_MAIN_CLI="${0}"; fi MILL_REPO_URL="https://github.com/com-lihaoyi/mill" -if [ -z "${CURL_CMD}" ] ; then - CURL_CMD=curl -fi - -# Explicit commandline argument takes precedence over all other methods -if [ "$1" = "--mill-version" ] ; then - echo "The --mill-version option is no longer supported." 1>&2 -fi - MILL_BUILD_SCRIPT="" if [ -f "build.mill" ] ; then @@ -69,65 +20,37 @@ elif [ -f "build.sc" ] ; then MILL_BUILD_SCRIPT="build.sc" fi -# Please note, that if a MILL_VERSION is already set in the environment, -# We reuse it's value and skip searching for a value. +# `s/.*://`: +# This is a greedy match that removes everything from the beginning of the line up to (and including) the last +# colon (:). This effectively isolates the value part of the declaration. +# +# `s/#.*//`: +# This removes any comments at the end of the line. +# +# `s/['\"]//g`: +# This removes all single and double quotes from the string, wherever they appear (g is for "global"). +# +# `s/^[[:space:]]*//; s/[[:space:]]*$//`: +# These two expressions trim any leading or trailing whitespace ([[:space:]] matches spaces and tabs). +TRIM_VALUE_SED="s/.*://; s/#.*//; s/['\"]//g; s/^[[:space:]]*//; s/[[:space:]]*$//" -# If not already set, read .mill-version file if [ -z "${MILL_VERSION}" ] ; then if [ -f ".mill-version" ] ; then MILL_VERSION="$(tr '\r' '\n' < .mill-version | head -n 1 2> /dev/null)" elif [ -f ".config/mill-version" ] ; then MILL_VERSION="$(tr '\r' '\n' < .config/mill-version | head -n 1 2> /dev/null)" + elif [ -f "build.mill.yaml" ] ; then + MILL_VERSION="$(grep -E "mill-version:" "build.mill.yaml" | sed -E "$TRIM_VALUE_SED")" elif [ -n "${MILL_BUILD_SCRIPT}" ] ; then - MILL_VERSION="$(cat ${MILL_BUILD_SCRIPT} | grep '//[|] *mill-version: *' | sed 's;//| *mill-version: *;;')" + MILL_VERSION="$(grep -E "//\|.*mill-version" "${MILL_BUILD_SCRIPT}" | sed -E "$TRIM_VALUE_SED")" fi fi -MILL_USER_CACHE_DIR="${XDG_CACHE_HOME:-${HOME}/.cache}/mill" - -if [ -z "${MILL_DOWNLOAD_PATH}" ] ; then - MILL_DOWNLOAD_PATH="${MILL_USER_CACHE_DIR}/download" -fi - -# If not already set, try to fetch newest from Github -if [ -z "${MILL_VERSION}" ] ; then - # TODO: try to load latest version from release page - echo "No mill version specified." 1>&2 - echo "You should provide a version via a '//| mill-version: ' comment or a '.mill-version' file." 1>&2 - - mkdir -p "${MILL_DOWNLOAD_PATH}" - LANG=C touch -d '1 hour ago' "${MILL_DOWNLOAD_PATH}/.expire_latest" 2>/dev/null || ( - # we might be on OSX or BSD which don't have -d option for touch - # but probably a -A [-][[hh]mm]SS - touch "${MILL_DOWNLOAD_PATH}/.expire_latest"; touch -A -010000 "${MILL_DOWNLOAD_PATH}/.expire_latest" - ) || ( - # in case we still failed, we retry the first touch command with the intention - # to show the (previously suppressed) error message - LANG=C touch -d '1 hour ago' "${MILL_DOWNLOAD_PATH}/.expire_latest" - ) - - # POSIX shell variant of bash's -nt operator, see https://unix.stackexchange.com/a/449744/6993 - # if [ "${MILL_DOWNLOAD_PATH}/.latest" -nt "${MILL_DOWNLOAD_PATH}/.expire_latest" ] ; then - if [ -n "$(find -L "${MILL_DOWNLOAD_PATH}/.latest" -prune -newer "${MILL_DOWNLOAD_PATH}/.expire_latest")" ]; then - # we know a current latest version - MILL_VERSION=$(head -n 1 "${MILL_DOWNLOAD_PATH}"/.latest 2> /dev/null) - fi +if [ -z "${MILL_VERSION}" ] ; then MILL_VERSION="${DEFAULT_MILL_VERSION}"; fi - if [ -z "${MILL_VERSION}" ] ; then - # we don't know a current latest version - echo "Retrieving latest mill version ..." 1>&2 - LANG=C ${CURL_CMD} -s -i -f -I ${MILL_REPO_URL}/releases/latest 2> /dev/null | grep --ignore-case Location: | sed s'/^.*tag\///' | tr -d '\r\n' > "${MILL_DOWNLOAD_PATH}/.latest" - MILL_VERSION=$(head -n 1 "${MILL_DOWNLOAD_PATH}"/.latest 2> /dev/null) - fi +MILL_USER_CACHE_DIR="${XDG_CACHE_HOME:-${HOME}/.cache}/mill" - if [ -z "${MILL_VERSION}" ] ; then - # Last resort - MILL_VERSION="${DEFAULT_MILL_VERSION}" - echo "Falling back to hardcoded mill version ${MILL_VERSION}" 1>&2 - else - echo "Using mill version ${MILL_VERSION}" 1>&2 - fi -fi +if [ -z "${MILL_FINAL_DOWNLOAD_FOLDER}" ] ; then MILL_FINAL_DOWNLOAD_FOLDER="${MILL_USER_CACHE_DIR}/download"; fi MILL_NATIVE_SUFFIX="-native" MILL_JVM_SUFFIX="-jvm" @@ -135,17 +58,11 @@ FULL_MILL_VERSION=$MILL_VERSION ARTIFACT_SUFFIX="" set_artifact_suffix(){ if [ "$(expr substr $(uname -s) 1 5 2>/dev/null)" = "Linux" ]; then - if [ "$(uname -m)" = "aarch64" ]; then - ARTIFACT_SUFFIX="-native-linux-aarch64" - else - ARTIFACT_SUFFIX="-native-linux-amd64" - 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 + 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 @@ -182,136 +99,67 @@ case "$MILL_VERSION" in ;; esac -MILL="${MILL_DOWNLOAD_PATH}/$MILL_VERSION$ARTIFACT_SUFFIX" - -try_to_use_system_mill() { - if [ "$(uname)" != "Linux" ]; then - return 0 - fi - - MILL_IN_PATH="$(command -v mill || true)" - - if [ -z "${MILL_IN_PATH}" ]; then - return 0 - fi - - SYSTEM_MILL_FIRST_TWO_BYTES=$(head --bytes=2 "${MILL_IN_PATH}") - if [ "${SYSTEM_MILL_FIRST_TWO_BYTES}" = "#!" ]; then - # MILL_IN_PATH is (very likely) a shell script and not the mill - # executable, ignore it. - return 0 - fi - - SYSTEM_MILL_PATH=$(readlink -e "${MILL_IN_PATH}") - SYSTEM_MILL_SIZE=$(stat --format=%s "${SYSTEM_MILL_PATH}") - SYSTEM_MILL_MTIME=$(stat --format=%y "${SYSTEM_MILL_PATH}") - - if [ ! -d "${MILL_USER_CACHE_DIR}" ]; then - mkdir -p "${MILL_USER_CACHE_DIR}" - fi - - SYSTEM_MILL_INFO_FILE="${MILL_USER_CACHE_DIR}/system-mill-info" - if [ -f "${SYSTEM_MILL_INFO_FILE}" ]; then - parseSystemMillInfo() { - LINE_NUMBER="${1}" - # Select the line number of the SYSTEM_MILL_INFO_FILE, cut the - # variable definition in that line in two halves and return - # the value, and finally remove the quotes. - sed -n "${LINE_NUMBER}p" "${SYSTEM_MILL_INFO_FILE}" |\ - cut -d= -f2 |\ - sed 's/"\(.*\)"/\1/' - } - - CACHED_SYSTEM_MILL_PATH=$(parseSystemMillInfo 1) - CACHED_SYSTEM_MILL_VERSION=$(parseSystemMillInfo 2) - CACHED_SYSTEM_MILL_SIZE=$(parseSystemMillInfo 3) - CACHED_SYSTEM_MILL_MTIME=$(parseSystemMillInfo 4) - - if [ "${SYSTEM_MILL_PATH}" = "${CACHED_SYSTEM_MILL_PATH}" ] \ - && [ "${SYSTEM_MILL_SIZE}" = "${CACHED_SYSTEM_MILL_SIZE}" ] \ - && [ "${SYSTEM_MILL_MTIME}" = "${CACHED_SYSTEM_MILL_MTIME}" ]; then - if [ "${CACHED_SYSTEM_MILL_VERSION}" = "${MILL_VERSION}" ]; then - MILL="${SYSTEM_MILL_PATH}" - return 0 - else - return 0 - fi - fi - fi - - SYSTEM_MILL_VERSION=$(${SYSTEM_MILL_PATH} --version | head -n1 | sed -n 's/^Mill.*version \(.*\)/\1/p') - - cat < "${SYSTEM_MILL_INFO_FILE}" -CACHED_SYSTEM_MILL_PATH="${SYSTEM_MILL_PATH}" -CACHED_SYSTEM_MILL_VERSION="${SYSTEM_MILL_VERSION}" -CACHED_SYSTEM_MILL_SIZE="${SYSTEM_MILL_SIZE}" -CACHED_SYSTEM_MILL_MTIME="${SYSTEM_MILL_MTIME}" -EOF - - if [ "${SYSTEM_MILL_VERSION}" = "${MILL_VERSION}" ]; then - MILL="${SYSTEM_MILL_PATH}" - fi -} -try_to_use_system_mill +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.* ) - DOWNLOAD_SUFFIX="" - DOWNLOAD_FROM_MAVEN=0 + MILL_DOWNLOAD_SUFFIX="" + MILL_DOWNLOAD_FROM_MAVEN=0 ;; 0.5.* | 0.6.* | 0.7.* | 0.8.* | 0.9.* | 0.10.* | 0.11.0-M* ) - DOWNLOAD_SUFFIX="-assembly" - DOWNLOAD_FROM_MAVEN=0 + MILL_DOWNLOAD_SUFFIX="-assembly" + MILL_DOWNLOAD_FROM_MAVEN=0 ;; *) - DOWNLOAD_SUFFIX="-assembly" - DOWNLOAD_FROM_MAVEN=1 + MILL_DOWNLOAD_SUFFIX="-assembly" + MILL_DOWNLOAD_FROM_MAVEN=1 ;; 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 ) - DOWNLOAD_EXT="jar" + MILL_DOWNLOAD_EXT="jar" ;; 0.12.* ) - DOWNLOAD_EXT="exe" + MILL_DOWNLOAD_EXT="exe" ;; 0.* ) - DOWNLOAD_EXT="jar" + MILL_DOWNLOAD_EXT="jar" ;; *) - DOWNLOAD_EXT="exe" + MILL_DOWNLOAD_EXT="exe" ;; esac - DOWNLOAD_FILE=$(mktemp mill.XXXXXX) - if [ "$DOWNLOAD_FROM_MAVEN" = "1" ] ; then - DOWNLOAD_URL="https://repo1.maven.org/maven2/com/lihaoyi/mill-dist${ARTIFACT_SUFFIX}/${MILL_VERSION}/mill-dist${ARTIFACT_SUFFIX}-${MILL_VERSION}.${DOWNLOAD_EXT}" + MILL_TEMP_DOWNLOAD_FILE="${MILL_OUTPUT_DIR:-out}/mill-temp-download" + mkdir -p "$(dirname "${MILL_TEMP_DOWNLOAD_FILE}")" + + if [ "$MILL_DOWNLOAD_FROM_MAVEN" = "1" ] ; then + MILL_DOWNLOAD_URL="https://repo1.maven.org/maven2/com/lihaoyi/mill-dist${ARTIFACT_SUFFIX}/${MILL_VERSION}/mill-dist${ARTIFACT_SUFFIX}-${MILL_VERSION}.${MILL_DOWNLOAD_EXT}" else MILL_VERSION_TAG=$(echo "$MILL_VERSION" | sed -E 's/([^-]+)(-M[0-9]+)?(-.*)?/\1\2/') - DOWNLOAD_URL="${GITHUB_RELEASE_CDN}${MILL_REPO_URL}/releases/download/${MILL_VERSION_TAG}/${MILL_VERSION}${DOWNLOAD_SUFFIX}" + MILL_DOWNLOAD_URL="${GITHUB_RELEASE_CDN}${MILL_REPO_URL}/releases/download/${MILL_VERSION_TAG}/${MILL_VERSION}${MILL_DOWNLOAD_SUFFIX}" unset MILL_VERSION_TAG fi + if [ "$MILL_TEST_DRY_RUN_LAUNCHER_SCRIPT" = "1" ] ; then - echo $DOWNLOAD_URL + echo $MILL_DOWNLOAD_URL echo $MILL exit 0 fi - # TODO: handle command not found - echo "Downloading mill ${MILL_VERSION} from ${DOWNLOAD_URL} ..." 1>&2 - ${CURL_CMD} -f -L -o "${DOWNLOAD_FILE}" "${DOWNLOAD_URL}" - chmod +x "${DOWNLOAD_FILE}" - mkdir -p "${MILL_DOWNLOAD_PATH}" - mv "${DOWNLOAD_FILE}" "${MILL}" - unset DOWNLOAD_FILE - unset DOWNLOAD_SUFFIX -fi + echo "Downloading mill ${MILL_VERSION} from ${MILL_DOWNLOAD_URL} ..." 1>&2 + curl -f -L -o "${MILL_TEMP_DOWNLOAD_FILE}" "${MILL_DOWNLOAD_URL}" + + chmod +x "${MILL_TEMP_DOWNLOAD_FILE}" + + mkdir -p "${MILL_FINAL_DOWNLOAD_FOLDER}" + mv "${MILL_TEMP_DOWNLOAD_FILE}" "${MILL}" -if [ -z "$MILL_MAIN_CLI" ] ; then - MILL_MAIN_CLI="${0}" + unset MILL_TEMP_DOWNLOAD_FILE + unset MILL_DOWNLOAD_SUFFIX fi MILL_FIRST_ARG="" @@ -321,7 +169,7 @@ if [ "$1" = "--bsp" ] || [ "${1#"-i"}" != "$1" ] || [ "$1" = "--interactive" ] | shift fi -unset MILL_DOWNLOAD_PATH +unset MILL_FINAL_DOWNLOAD_FOLDER unset MILL_OLD_DOWNLOAD_PATH unset OLD_MILL unset MILL_VERSION diff --git a/mill.bat b/mill.bat index 37d5df2..f4e4b58 100644 --- a/mill.bat +++ b/mill.bat @@ -1,40 +1,8 @@ @echo off -rem This is a wrapper script, that automatically selects or downloads Mill from Maven Central or GitHub release pages. -rem -rem This script determines the Mill version to use by trying these sources -rem - env-variable `MILL_VERSION` -rem - local file `.mill-version` -rem - local file `.config/mill-version` -rem - `mill-version` from YAML fronmatter of current buildfile -rem - if accessible, find the latest stable version available on Maven Central (https://repo1.maven.org/maven2) -rem - env-variable `DEFAULT_MILL_VERSION` -rem -rem If a version has the suffix '-native' a native binary will be used. -rem If a version has the suffix '-jvm' an executable jar file will be used, requiring an already installed Java runtime. -rem If no such suffix is found, the script will pick a default based on version and platform. -rem -rem Once a version was determined, it tries to use either -rem - a system-installed mill, if found and it's version matches -rem - an already downloaded version under %USERPROFILE%\.mill\download -rem -rem If no working mill version was found on the system, -rem this script downloads a binary file from Maven Central or Github Pages (this is version dependent) -rem into a cache location (%USERPROFILE%\.mill\download). -rem -rem Mill Project URL: https://github.com/com-lihaoyi/mill -rem Script Version: 1.0.0-M1-21-7b6fae-DIRTY892b63e8 -rem -rem If you want to improve this script, please also contribute your changes back! -rem This script was generated from: dist/scripts/src/mill.bat -rem -rem Licensed under the Apache License, Version 2.0 - -rem setlocal seems to be unavailable on Windows 95/98/ME -rem but I don't think we need to support them in 2019 setlocal enabledelayedexpansion -if [!DEFAULT_MILL_VERSION!]==[] ( set "DEFAULT_MILL_VERSION=1.0.4" ) +if [!DEFAULT_MILL_VERSION!]==[] ( set "DEFAULT_MILL_VERSION=1.0.6" ) if [!MILL_GITHUB_RELEASE_CDN!]==[] ( set "MILL_GITHUB_RELEASE_CDN=" ) @@ -65,27 +33,68 @@ if [!MILL_VERSION!]==[] ( if exist .config\mill-version ( set /p MILL_VERSION=<.config\mill-version ) else ( - if not "%MILL_BUILD_SCRIPT%"=="" ( - for /f "tokens=1-2*" %%a in ('findstr /C:"//| mill-version:" %MILL_BUILD_SCRIPT%') do ( - set "MILL_VERSION=%%c" - ) + rem Determine which config file to use for version extraction + set "MILL_VERSION_CONFIG_FILE=" + set "MILL_VERSION_SEARCH_PATTERN=" + + if exist build.mill.yaml ( + set "MILL_VERSION_CONFIG_FILE=build.mill.yaml" + set "MILL_VERSION_SEARCH_PATTERN=mill-version:" ) else ( + if not "%MILL_BUILD_SCRIPT%"=="" ( + set "MILL_VERSION_CONFIG_FILE=%MILL_BUILD_SCRIPT%" + set "MILL_VERSION_SEARCH_PATTERN=//\|.*mill-version" + ) + ) + + rem Process the config file if found + if not "!MILL_VERSION_CONFIG_FILE!"=="" ( + rem Find the line and process it + for /f "tokens=*" %%a in ('findstr /R /C:"!MILL_VERSION_SEARCH_PATTERN!" "!MILL_VERSION_CONFIG_FILE!"') do ( + set "line=%%a" + + rem --- 1. Replicate sed 's/.*://' --- + rem This removes everything up to and including the first colon + set "line=!line:*:=!" + + rem --- 2. Replicate sed 's/#.*//' --- + rem Split on '#' and keep the first part + for /f "tokens=1 delims=#" %%b in ("!line!") do ( + set "line=%%b" + ) + + rem --- 3. Replicate sed 's/['"]//g' --- + rem Remove all quotes + set "line=!line:'=!" + set "line=!line:"=!" + + rem --- 4. Replicate sed's trim/space removal --- + rem Remove all space characters from the result. This is more robust. + set "MILL_VERSION=!line: =!" + + rem We found the version, so we can exit the loop + goto :version_found + ) + + :version_found rem no-op ) ) ) ) -if [!MILL_VERSION!]==[] set MILL_VERSION=%DEFAULT_MILL_VERSION% +if [!MILL_VERSION!]==[] ( + set MILL_VERSION=%DEFAULT_MILL_VERSION% +) -if [!MILL_DOWNLOAD_PATH!]==[] set MILL_DOWNLOAD_PATH=%USERPROFILE%\.mill\download +if [!MILL_FINAL_DOWNLOAD_FOLDER!]==[] set MILL_FINAL_DOWNLOAD_FOLDER=%USERPROFILE%\.cache\mill\download rem without bat file extension, cmd doesn't seem to be able to run it set "MILL_NATIVE_SUFFIX=-native" set "MILL_JVM_SUFFIX=-jvm" -set "FULL_MILL_VERSION=%MILL_VERSION%" -set "MILL_EXT=.bat" +set "MILL_FULL_VERSION=%MILL_VERSION%" +set "MILL_DOWNLOAD_EXT=.bat" set "ARTIFACT_SUFFIX=" REM Check if MILL_VERSION contains MILL_NATIVE_SUFFIX echo !MILL_VERSION! | findstr /C:"%MILL_NATIVE_SUFFIX%" >nul @@ -95,7 +104,7 @@ if !errorlevel! equ 0 ( REM https://github.com/oracle/graal/issues/9215 IF /I NOT "%PROCESSOR_ARCHITECTURE%"=="ARM64" ( set "ARTIFACT_SUFFIX=-native-windows-amd64" - set "MILL_EXT=.exe" + set "MILL_DOWNLOAD_EXT=.exe" ) else ( rem no-op ) @@ -123,7 +132,7 @@ if !errorlevel! equ 0 ( if "!SKIP_VERSION!"=="false" ( IF /I NOT "%PROCESSOR_ARCHITECTURE%"=="ARM64" ( set "ARTIFACT_SUFFIX=-native-windows-amd64" - set "MILL_EXT=.exe" + set "MILL_DOWNLOAD_EXT=.exe" ) ) else ( rem no-op @@ -131,7 +140,7 @@ if !errorlevel! equ 0 ( ) ) -set MILL=%MILL_DOWNLOAD_PATH%\!FULL_MILL_VERSION!!MILL_EXT! +set MILL=%MILL_FINAL_DOWNLOAD_FOLDER%\!MILL_FULL_VERSION!!MILL_DOWNLOAD_EXT! set MILL_RESOLVE_DOWNLOAD= @@ -227,34 +236,26 @@ if [!MILL_RESOLVE_DOWNLOAD!]==[true] ( ) rem there seems to be no way to generate a unique temporary file path (on native Windows) - set MILL_DOWNLOAD_FILE=%MILL%.tmp + if defined MILL_OUTPUT_DIR ( + set MILL_TEMP_DOWNLOAD_FILE=%MILL_OUTPUT_DIR%\mill-temp-download + if not exist "%MILL_OUTPUT_DIR%" mkdir "%MILL_OUTPUT_DIR%" + ) else ( + set MILL_TEMP_DOWNLOAD_FILE=out\mill-bootstrap-download + if not exist "out" mkdir "out" + ) echo Downloading mill !MILL_VERSION! from !MILL_DOWNLOAD_URL! ... 1>&2 - if not exist "%MILL_DOWNLOAD_PATH%" mkdir "%MILL_DOWNLOAD_PATH%" - rem curl is bundled with recent Windows 10 - rem but I don't think we can expect all the users to have it in 2019 - where /Q curl - if !ERRORLEVEL! EQU 0 ( - curl -f -L "!MILL_DOWNLOAD_URL!" -o "!MILL_DOWNLOAD_FILE!" - ) else ( - rem bitsadmin seems to be available on Windows 7 - rem without /dynamic, github returns 403 - rem bitsadmin is sometimes needlessly slow but it looks better with /priority foreground - bitsadmin /transfer millDownloadJob /dynamic /priority foreground "!MILL_DOWNLOAD_URL!" "!MILL_DOWNLOAD_FILE!" - ) - if not exist "!MILL_DOWNLOAD_FILE!" ( - echo Could not download mill !MILL_VERSION! 1>&2 - exit /b 1 - ) + curl -f -L "!MILL_DOWNLOAD_URL!" -o "!MILL_TEMP_DOWNLOAD_FILE!" - move /y "!MILL_DOWNLOAD_FILE!" "%MILL%" + if not exist "%MILL_FINAL_DOWNLOAD_FOLDER%" mkdir "%MILL_FINAL_DOWNLOAD_FOLDER%" + move /y "!MILL_TEMP_DOWNLOAD_FILE!" "%MILL%" - set MILL_DOWNLOAD_FILE= + set MILL_TEMP_DOWNLOAD_FILE= set MILL_DOWNLOAD_SUFFIX= ) -set MILL_DOWNLOAD_PATH= +set MILL_FINAL_DOWNLOAD_FOLDER= set MILL_VERSION= set MILL_REPO_URL= From 91cb1c55792464831f09a1388ada581acdb4db5c Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Tue, 2 Dec 2025 13:46:02 +0100 Subject: [PATCH 03/11] Bump `mill-native-image` & `mill-native-image-upload` to 0.2.3 --- build.mill.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.mill.scala b/build.mill.scala index 493a905..75eecd3 100644 --- a/build.mill.scala +++ b/build.mill.scala @@ -1,6 +1,6 @@ //| mvnDeps: -//| - io.github.alexarchambault.mill::mill-native-image::0.2.2 -//| - io.github.alexarchambault.mill::mill-native-image-upload:0.2.2 +//| - io.github.alexarchambault.mill::mill-native-image::0.2.3 +//| - io.github.alexarchambault.mill::mill-native-image-upload:0.2.3 //| - com.goyeau::mill-scalafix::0.6.0 //| - com.lumidion::sonatype-central-client-requests:0.6.0 package build From 50739abe0acb8678ce9bb7d86bd1fce6c9f2b511 Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Tue, 2 Dec 2025 13:46:18 +0100 Subject: [PATCH 04/11] Bump Scala to 3.3.7 --- build.mill.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.mill.scala b/build.mill.scala index 75eecd3..584b064 100644 --- a/build.mill.scala +++ b/build.mill.scala @@ -24,7 +24,7 @@ import mill.scalalib.publish.{Developer, License, PomSettings, VersionControl} import mill.util.{Tasks, VcsVersion} object Versions { - def scala = "3.3.6" + def scala = "3.3.7" def scalaCli = "1.8.5" def graalVmVersion = "22.3.1" def coursier = "2.1.24" From 6b89e00913fa92ef489a67b974b2243b017cde0c Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Tue, 2 Dec 2025 13:46:44 +0100 Subject: [PATCH 05/11] Bump `coursier` to 2.1.25-M19 --- build.mill.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.mill.scala b/build.mill.scala index 584b064..b05d1a2 100644 --- a/build.mill.scala +++ b/build.mill.scala @@ -27,7 +27,7 @@ object Versions { def scala = "3.3.7" def scalaCli = "1.8.5" def graalVmVersion = "22.3.1" - def coursier = "2.1.24" + def coursier = "2.1.25-M19" def osLib = "0.11.5" def uTest = "0.9.1" def jline = "3.25.0" From 4a5aac18ce85153df57a2a16ec08c4226f184cf6 Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Tue, 2 Dec 2025 13:47:04 +0100 Subject: [PATCH 06/11] Bump `os-lib` to 0.11.6 --- build.mill.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.mill.scala b/build.mill.scala index b05d1a2..db40cb3 100644 --- a/build.mill.scala +++ b/build.mill.scala @@ -28,7 +28,7 @@ object Versions { def scalaCli = "1.8.5" def graalVmVersion = "22.3.1" def coursier = "2.1.25-M19" - def osLib = "0.11.5" + def osLib = "0.11.6" def uTest = "0.9.1" def jline = "3.25.0" def ubuntu = "24.04" From 0e70ab1cebcb5e846a6a8e8d427250523c486bc0 Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Tue, 2 Dec 2025 13:47:27 +0100 Subject: [PATCH 07/11] Bump `utest` to 0.9.4 --- build.mill.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.mill.scala b/build.mill.scala index db40cb3..2b0e2ff 100644 --- a/build.mill.scala +++ b/build.mill.scala @@ -29,7 +29,7 @@ object Versions { def graalVmVersion = "22.3.1" def coursier = "2.1.25-M19" def osLib = "0.11.6" - def uTest = "0.9.1" + def uTest = "0.9.4" def jline = "3.25.0" def ubuntu = "24.04" } From 05ea18c2c045dc474ba8f02f4e5b8cf07869050d Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Tue, 2 Dec 2025 13:52:13 +0100 Subject: [PATCH 08/11] Bump MacOS CI to `macos-15`/`macos-15-intel` --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 327850c..237f6ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-24.04, windows-latest, macos-13, macos-latest] + os: [ubuntu-24.04, windows-latest, macos-15-intel, macos-15] steps: - uses: actions/checkout@v5 with: From fab15e7c8fcd7934d89c9126138c76d13576eff2 Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Tue, 2 Dec 2025 13:53:12 +0100 Subject: [PATCH 09/11] Bump `actions/checkout` to v6 --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 237f6ad..bbb5813 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: matrix: os: [ubuntu-24.04, windows-latest, macos-15-intel, macos-15] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 submodules: true @@ -57,7 +57,7 @@ jobs: - format runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 submodules: true @@ -89,7 +89,7 @@ jobs: - format runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 submodules: true @@ -118,7 +118,7 @@ jobs: timeout-minutes: 15 runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 submodules: true @@ -133,7 +133,7 @@ jobs: timeout-minutes: 15 runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 submodules: true @@ -151,7 +151,7 @@ jobs: if: github.event_name == 'push' runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 submodules: true From f7cded307a7f0a25f966bfe6190c0befeca269bb Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Tue, 2 Dec 2025 13:54:08 +0100 Subject: [PATCH 10/11] Bump `coursier/cache-action` to v7 --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbb5813..7614cba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: with: fetch-depth: 0 submodules: true - - uses: coursier/cache-action@v6 + - uses: coursier/cache-action@v7 - uses: coursier/setup-action@v1 with: jvm: temurin:17 @@ -61,7 +61,7 @@ jobs: with: fetch-depth: 0 submodules: true - - uses: coursier/cache-action@v6 + - uses: coursier/cache-action@v7 - uses: coursier/setup-action@v1 with: jvm: temurin:17 @@ -93,7 +93,7 @@ jobs: with: fetch-depth: 0 submodules: true - - uses: coursier/cache-action@v6 + - uses: coursier/cache-action@v7 - uses: coursier/setup-action@v1 with: jvm: temurin:17 @@ -122,7 +122,7 @@ jobs: with: fetch-depth: 0 submodules: true - - uses: coursier/cache-action@v6 + - uses: coursier/cache-action@v7 - uses: coursier/setup-action@v1 with: jvm: temurin:17 @@ -155,7 +155,7 @@ jobs: with: fetch-depth: 0 submodules: true - - uses: coursier/cache-action@v6 + - uses: coursier/cache-action@v7 - uses: coursier/setup-action@v1 with: jvm: temurin:17 From 6f2232d2c26d2105aadab5748427e6f0b5c3807e Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Tue, 2 Dec 2025 16:23:20 +0100 Subject: [PATCH 11/11] Fix `jline-*` downgrade to 3.25.0 --- build.mill.scala | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/build.mill.scala b/build.mill.scala index 2b0e2ff..e6c374d 100644 --- a/build.mill.scala +++ b/build.mill.scala @@ -87,22 +87,22 @@ trait JavaClassNameModule extends ScalaModule with ScalafixModule { ) ) + protected def downgradeJline(deps: Seq[Dep]): Seq[Dep] = + deps.map(_.exclude(jlineDeps.map(d => d.organization -> d.name)*)) ++ jlineDeps + override def allMvnDeps: T[Seq[Dep]] = Task { - super.allMvnDeps() - .map(_.exclude(jlineDeps.map(d => d.organization -> d.name)*)) ++ jlineDeps + downgradeJline(super.allMvnDeps()) } - override def mvnDeps: T[Seq[Dep]] = - super.mvnDeps().map(_.exclude(jlineDeps - .map(d => d.organization -> d.name)*)) ++ jlineDeps + override def mvnDeps: T[Seq[Dep]] = downgradeJline(super.mvnDeps()) } object `scala3-graal-processor` extends JavaClassNameModule { override def mainClass: T[Option[String]] = Some("scala.cli.graal.CoursierCacheProcessor") - override def mvnDeps: T[Seq[Dep]] = jlineDeps ++ Seq( - mvn"org.virtuslab.scala-cli::scala3-graal:${Versions.scalaCli}" - ) + override def mvnDeps: T[Seq[Dep]] = downgradeJline { + super.mvnDeps() ++ Seq(mvn"org.virtuslab.scala-cli::scala3-graal:${Versions.scalaCli}") + } } object `java-class-name` extends JavaClassNameModule with JavaMainClassNativeImage @@ -130,9 +130,9 @@ object `java-class-name` extends JavaClassNameModule with JavaMainClassNativeIma cp.split(File.pathSeparator).toSeq.map(p => mill.PathRef(os.Path(p))) } - override def mvnDeps: T[Seq[Dep]] = super.mvnDeps() ++ jlineDeps ++ Seq( - mvn"org.scala-lang::scala3-compiler:${Versions.scala}" - ) + override def mvnDeps: T[Seq[Dep]] = downgradeJline { + super.mvnDeps() ++ Seq(mvn"org.scala-lang::scala3-compiler:${Versions.scala}") + } override def compileMvnDeps: T[Seq[Dep]] = super.compileMvnDeps() ++ Seq( mvn"org.graalvm.nativeimage:svm:${Versions.graalVmVersion}"