Skip to content

Commit 0c00dba

Browse files
authored
Merge pull request #7823 from Friendseeker/musl
[1.x] Static link `musl` during x86 Linux Native Image build
2 parents 91ea2fe + 60b451c commit 0c00dba

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ jobs:
8080
repository: sbt/zinc
8181
ref: 1.10.x
8282
path: zinc
83+
- uses: graalvm/setup-graalvm@v1
84+
if: ${{ matrix.jobtype >= 7 && matrix.jobtype <= 9 }}
85+
with:
86+
java-version: '23'
87+
native-image-musl: 'true'
88+
set-java-home: 'false'
89+
github-token: ${{ secrets.GITHUB_TOKEN }}
8390
- name: Setup JDK
8491
uses: actions/setup-java@v4
8592
with:

build.sbt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,8 +1176,7 @@ lazy val sbtClientProj = (project in file("client"))
11761176
nativeImageReady := { () =>
11771177
()
11781178
},
1179-
nativeImageVersion := "23.0",
1180-
nativeImageJvm := "graalvm-java23",
1179+
nativeImageInstalled := true,
11811180
nativeImageOutput := {
11821181
val outputDir = (target.value / "bin").toPath
11831182
if (!Files.exists(outputDir)) {
@@ -1199,7 +1198,7 @@ lazy val sbtClientProj = (project in file("client"))
11991198
s"-H:Name=${target.value / "bin" / "sbtn"}",
12001199
) ++ (if (isLinux && isArmArchitecture)
12011200
Seq("-H:PageSize=65536") // Make sure binary runs on kernels with page size set to 4k, 16 and 64k
1202-
else Nil),
1201+
else Nil) ++ (if (isLinux && !isArmArchitecture) Seq("--static", "--libc=musl") else Nil),
12031202
buildThinClient := {
12041203
val isFish = Def.spaceDelimited("").parsed.headOption.fold(false)(_ == "--fish")
12051204
val ext = if (isWin) ".bat" else if (isFish) ".fish" else ".sh"

0 commit comments

Comments
 (0)