Skip to content

Commit 9c8002a

Browse files
committed
Migrate to Mill 1.1.0
1 parent 6e60c8a commit 9c8002a

File tree

23 files changed

+64
-38
lines changed

23 files changed

+64
-38
lines changed

.mill-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.6
1+
1.1.0

build.mill.scala renamed to build.mill

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ trait Cli extends CrossSbtModule with ProtoBuildModule with CliLaunchers
864864
| def signingCliJvmVersion = ${Deps.Versions.signingCliJvmVersion}
865865
| def defaultMillVersion = "${BuildInfo.millVersion}"
866866
| def mill012Version = "${Deps.Versions.mill012Version}"
867-
| def mill10Version = "${Deps.Versions.mill10Version}"
867+
| def mill1Version = "${Deps.Versions.mill1Version}"
868868
| def defaultSbtVersion = "${Deps.Versions.sbtVersion}"
869869
| def defaultMavenVersion = "${Deps.Versions.mavenVersion}"
870870
| def defaultMavenScalaCompilerPluginVersion = "${Deps.Versions.mavenScalaCompilerPluginVersion}"
@@ -1121,7 +1121,7 @@ trait CliIntegration extends SbtModule
11211121
| def jmhGeneratorBytecodeModule = "${Deps.jmhGeneratorBytecode.dep.module.name.value}"
11221122
| def defaultMillVersion = "${BuildInfo.millVersion}"
11231123
| def mill012Version = "${Deps.Versions.mill012Version}"
1124-
| def mill10Version = "${Deps.Versions.mill10Version}"
1124+
| def mill1Version = "${Deps.Versions.mill1Version}"
11251125
|}
11261126
|""".stripMargin
11271127
if (!os.isFile(dest) || os.read(dest) != code)

mill.bat

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setlocal enabledelayedexpansion
44

5-
if [!DEFAULT_MILL_VERSION!]==[] ( set "DEFAULT_MILL_VERSION=0.12.17" )
5+
if [!DEFAULT_MILL_VERSION!]==[] ( set "DEFAULT_MILL_VERSION=1.1.0" )
66

77
if [!MILL_GITHUB_RELEASE_CDN!]==[] ( set "MILL_GITHUB_RELEASE_CDN=" )
88

@@ -276,12 +276,8 @@ if [%~1%]==[--bsp] (
276276
if [%~1%]==[--no-daemon] (
277277
set MILL_FIRST_ARG=%1%
278278
) else (
279-
if [%~1%]==[--repl] (
279+
if [%~1%]==[--help] (
280280
set MILL_FIRST_ARG=%1%
281-
) else (
282-
if [%~1%]==[--help] (
283-
set MILL_FIRST_ARG=%1%
284-
)
285281
)
286282
)
287283
)

millw

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
if [ -z "${DEFAULT_MILL_VERSION}" ] ; then DEFAULT_MILL_VERSION="0.12.17"; fi
5+
if [ -z "${DEFAULT_MILL_VERSION}" ] ; then DEFAULT_MILL_VERSION="1.1.0"; fi
66

77
if [ -z "${GITHUB_RELEASE_CDN}" ] ; then GITHUB_RELEASE_CDN=""; fi
88

@@ -56,8 +56,36 @@ MILL_NATIVE_SUFFIX="-native"
5656
MILL_JVM_SUFFIX="-jvm"
5757
FULL_MILL_VERSION=$MILL_VERSION
5858
ARTIFACT_SUFFIX=""
59+
60+
# Check if GLIBC version is at least the required version
61+
# Returns 0 (true) if GLIBC >= required version, 1 (false) otherwise
62+
check_glibc_version() {
63+
required_version="2.39"
64+
required_major=$(echo "$required_version" | cut -d. -f1)
65+
required_minor=$(echo "$required_version" | cut -d. -f2)
66+
# Get GLIBC version from ldd --version (first line contains version like "ldd (GNU libc) 2.31")
67+
glibc_version=$(ldd --version 2>/dev/null | head -n 1 | grep -oE '[0-9]+\.[0-9]+$' || echo "")
68+
if [ -z "$glibc_version" ]; then
69+
# If we can't determine GLIBC version, assume it's too old
70+
return 1
71+
fi
72+
glibc_major=$(echo "$glibc_version" | cut -d. -f1)
73+
glibc_minor=$(echo "$glibc_version" | cut -d. -f2)
74+
if [ "$glibc_major" -gt "$required_major" ]; then
75+
return 0
76+
elif [ "$glibc_major" -eq "$required_major" ] && [ "$glibc_minor" -ge "$required_minor" ]; then
77+
return 0
78+
else
79+
return 1
80+
fi
81+
}
82+
5983
set_artifact_suffix(){
6084
if [ "$(expr substr $(uname -s) 1 5 2>/dev/null)" = "Linux" ]; then
85+
# Native binaries require new enough GLIBC; fall back to JVM launcher if older
86+
if ! check_glibc_version; then
87+
return
88+
fi
6189
if [ "$(uname -m)" = "aarch64" ]; then ARTIFACT_SUFFIX="-native-linux-aarch64"
6290
else ARTIFACT_SUFFIX="-native-linux-amd64"; fi
6391
elif [ "$(uname)" = "Darwin" ]; then
@@ -163,7 +191,7 @@ if [ ! -s "${MILL}" ] || [ "$MILL_TEST_DRY_RUN_LAUNCHER_SCRIPT" = "1" ] ; then
163191
fi
164192

165193
MILL_FIRST_ARG=""
166-
if [ "$1" = "--bsp" ] || [ "${1#"-i"}" != "$1" ] || [ "$1" = "--interactive" ] || [ "$1" = "--no-server" ] || [ "$1" = "--no-daemon" ] || [ "$1" = "--repl" ] || [ "$1" = "--help" ] ; then
194+
if [ "$1" = "--bsp" ] || [ "${1#"-i"}" != "$1" ] || [ "$1" = "--interactive" ] || [ "$1" = "--no-server" ] || [ "$1" = "--no-daemon" ] || [ "$1" = "--help" ] ; then
167195
# Need to preserve the first position of those listed options
168196
MILL_FIRST_ARG=$1
169197
shift

modules/cli/src/main/resources/META-INF/native-image/org.virtuslab/scala-cli-core/reflect-config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@
150150
},
151151
{
152152
"name": "ch.epfl.scala.bsp4j.DebugProvider",
153+
"allDeclaredConstructors": true,
154+
"allPublicConstructors": true,
155+
"allDeclaredMethods": true,
153156
"allDeclaredFields": true
154157
},
155158
{

modules/cli/src/main/scala/scala/cli/exportCmd/MillProject.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ final case class MillProject(
177177
os.write(path0, content, createFolders = true)
178178
}
179179

180-
val outputBuildFile = if isMill1OrNewer then dir / "build.mill.scala" else dir / "build.sc"
180+
val outputBuildFile = if isMill1OrNewer then dir / "build.mill" else dir / "build.sc"
181181
os.write(outputBuildFile, buildFileContent.getBytes(charSet))
182182
}
183183
}

modules/integration/src/test/scala/scala/cli/integration/ExportMill10Tests212.scala

Lines changed: 0 additions & 3 deletions
This file was deleted.

modules/integration/src/test/scala/scala/cli/integration/ExportMill10Tests3Lts.scala

Lines changed: 0 additions & 3 deletions
This file was deleted.

modules/integration/src/test/scala/scala/cli/integration/ExportMill10Tests3NextRc.scala

Lines changed: 0 additions & 3 deletions
This file was deleted.

modules/integration/src/test/scala/scala/cli/integration/ExportMill10TestsDefault.scala

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)