Skip to content

[1.x] Static link musl during x86 Linux Native Image build #7823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

Friendseeker
Copy link
Member

@Friendseeker Friendseeker commented Oct 23, 2024

Partially fixes #7785

GraalVM does not support static link musl for arm64, we have to wait for upstream support. Hopefully not too many people use abtn on arm64 Linux distos without `GLIBC_2.32' installed...

@Friendseeker Friendseeker changed the title Static link musl during Native Image build [1.x] Static link musl during Native Image build Oct 23, 2024
@Friendseeker Friendseeker marked this pull request as ready for review October 23, 2024 08:28
@Friendseeker
Copy link
Member Author

CI failure is false positive.

[error] (scripted) Failed tests:
[error] nio/make-clone

@Friendseeker Friendseeker changed the title [1.x] Static link musl during Native Image build [1.x] Static link musl during Linux Native Image build Oct 23, 2024
Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@adpi2
Copy link
Member

adpi2 commented Oct 23, 2024

CI failure is false positive.

It failed 3 times in a row

Comment on lines 85 to 90
- uses: graalvm/setup-graalvm@v1
with:
java-version: '23'
native-image-musl: 'true'
set-java-home: 'false'
github-token: ${{ secrets.GITHUB_TOKEN }}
Copy link
Member

@eed3si9n eed3si9n Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an FYI, we produce sbtn in a different repo, so we'd likely need to copy-paste this setting and implement a manual version for QEMU ARM Linux emulation - https://github.com/sbt/sbtn-dist, which I was doing last night coincidentally - eed3si9n/sbtn-dist@e166373

Copy link
Member Author

@Friendseeker Friendseeker Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't make to make a new release soon we can wait for Github Action arm64 runner which are planned to arrive by EOY, then make PR at sbtn-dist end.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it turns out that --libc=musl is not supported on ARM Linux:
https://www.graalvm.org/21.3/reference-manual/native-image/ARM64/index.html

@eed3si9n
Copy link
Member

This is make clone written using sbt (https://github.com/sbt/sbt/tree/1.10.x/sbt-app/src/sbt-test/nio/make-clone). Likely it needs to be adjusted to the musl toolchain that's now on the PATH?

[info] Running nio/make-clone
[info] [info] welcome to sbt 1.10.4-SNAPSHOT (Eclipse Adoptium Java 21.0.4)
[info] [info] loading settings for project global-plugins from metals.sbt ...
[info] [info] loading global plugins from /tmp/sbt_e3f41de7/global/plugins
[info] [info] loading project definition from /tmp/sbt_e3f41de7/project
[info] [info] compiling 1 Scala source to /tmp/sbt_e3f41de7/project/target/scala-2.12/sbt-1.0/classes ...
[info] [info] done compiling
[info] [success] Generated .bloop/sbt_e3f41de7-build.json
[info] [success] Total time: 0 s, completed Oct 23, 2024, 8:29:06 AM
[info] [info] loading settings for project sbt_e3f41de7 from build.sbt,tests.sbt ...
[info] [warn] Discarding 4 session settings.  Use 'session save' to persist session settings.
[info] [info] set current project to sbt_e3f41de7 (in build file:/tmp/sbt_e3f41de7/)
[info] [warn] there are 2 keys that are not used by any other settings/tasks:
[info] [warn]  
[info] [warn] * sbt_e3f41de7 / compileLib / target
[info] [warn]   +- /tmp/sbt_e3f41de7/build.sbt:12
[info] [warn] * sbt_e3f41de7 / linkLib / target
[info] [warn]   +- /tmp/sbt_e3f41de7/build.sbt:46
[info] [warn]  
[info] [warn] note: a setting might still be used by a command; to exclude a key from this `lintUnused` check
[info] [warn] either append it to `Global / excludeLintKeys` or call .withRank(KeyRanks.Invisible) on the key
[info] [info] Compiling /tmp/sbt_e3f41de7/src/lib/lib.c to /tmp/sbt_e3f41de7/target/streams/_global/compileLib/_global/streams/lib.o
[info] [info] Linking /tmp/sbt_e3f41de7/target/streams/_global/linkLib/_global/streams/libfoo.so
[info] [info] Building executable /tmp/sbt_e3f41de7/out/main/main.out
[info] [info] Running /tmp/sbt_e3f41de7/out/main/main.out with arguments: '1'
[info] [error] java.io.IOException: Cannot run program "/tmp/sbt_e3f41de7/out/main/main.out": error=2, No such file or directory
[info] [error] 	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
[info] [error] 	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
[info] [error] 	at RunBinary$.apply(RunBinary.scala:10)
[info] [error] 	at $585ecb8736b3c86dd54c$.$anonfun$$sbtdef$5(/tmp/sbt_e3f41de7/build.sbt:108)
[info] [error] 	at sbt.util.LoggerContext$LoggerContextImpl$Log.log(LoggerContext.scala:124)
[info] [error] 	at sbt.internal.util.ManagedLogger.log(ManagedLogger.scala:42)
[info] [error] 	at sbt.util.Logger.info(Logger.scala:27)
[info] [error] 	at $585ecb8736b3c86dd54c$.$anonfun$$sbtdef$3(/tmp/sbt_e3f41de7/build.sbt:108)
[info] [error] 	at $585ecb8736b3c86dd54c$.$anonfun$$sbtdef$3$adapted(/tmp/sbt_e3f41de7/build.sbt:99)
....
[info] [error] Caused by: java.io.IOException: error=2, No such file or directory
[info] [error] 	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
[info] [error] 	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
[info] [error] 	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
[info] [error] 	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
[info] [error] 	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
[info] [error] 	at RunBinary$.apply(RunBinary.scala:10)
[info] [error] 	at $585ecb8736b3c86dd54c$.$anonfun$$sbtdef$5(/tmp/sbt_e3f41de7/build.sbt:108)
....
[info] [error] (executeMain) java.io.IOException: Cannot run program "/tmp/sbt_e3f41de7/out/main/main.out": error=2, No such file or directory
[info] [error] Total time: 0 s, completed Oct 23, 2024, 8:29:08 AM
Error:  x nio/make-clone 
Error:   Cause of test exception: {line 1}  Command failed: executeMain failed

It's probably overspecifying as an sbt test, so I'm okay with removing the test.

@Friendseeker
Copy link
Member Author

CI failure is false positive.

It failed 3 times in a row

I should not have made a conclusion at 1 AM late night 😢.

@Friendseeker Friendseeker changed the title [1.x] Static link musl during Linux Native Image build [1.x] Static link musl during x86 Linux Native Image build Oct 24, 2024
Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@eed3si9n eed3si9n merged commit 0c00dba into sbt:1.10.x Oct 24, 2024
10 checks passed
@Friendseeker Friendseeker deleted the musl branch October 24, 2024 21:27
Friendseeker added a commit to Friendseeker/sbt that referenced this pull request Nov 1, 2024
This reverts commit 0c00dba, reversing
changes made to 91ea2fe.
eed3si9n added a commit that referenced this pull request Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sbtn "/home/runner/.cache/sbt/boot/sbtn/1.10.3/sbtn: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found"
3 participants