Repository navigation
Add musl builds of the native library for Alpine Linux - #374
Open
Nitjsefnie wants to merge 3 commits into
Open
Nitjsefnie wants to merge 3 commits into
Nitjsefnie wants to merge 3 commits into
Conversation
Build musl cdylibs with a dynamic CRT, pin Linux native resource packaging against JNE, and smoke test the uber JAR with its runtime dependencies on Alpine. Co-Authored-By: GPT-6.1 Sol <noreply@openai.com> Signed-off-by: Nitjsefnie <zmatek.peter@gmail.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com> Signed-off-by: Nitjsefnie <zmatek.peter@gmail.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com> Signed-off-by: Nitjsefnie <zmatek.peter@gmail.com>
Nitjsefnie
force-pushed
the
fix/335-musl-native-library
branch
from
October 23, 2026 03:08
a6df479 to
adf0ee1
Compare
Author
|
Heads-up: this branch lives in an organization-owned fork, and GitHub doesn't let maintainers push to those. If anything needs changing, just say so here and I'll make the change on this branch right away. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Packages musl-native JNI libraries in the uber JAR so cedar-java works on Alpine/musl systems without a manually supplied library, and proves it in CI by authorizing on Alpine.
Related Issues and Pull Requests
Fixes #335
Relates to #264 (the earlier musl request; its 2024 attempt predated JNE's musl support and was closed by its author)
Changes
x86_64-unknown-linux-muslandaarch64-unknown-linux-musltorustLibraryTargets, packaged under JNE's musl resource paths (linux_musl/x86_64,linux_musl/aarch64)compileFFIbuilds musl targets withRUSTFLAGS=-C target-feature=-crt-static: Rust's static musl CRT cannot produce a cdylib, so the musl libraries link dynamically against musl'slibc.so, which Alpine providesNativeLibraryPackagingTestsderives the expected resource paths by driving JNE's ownNativeTarget.resolveResourcePathsand requires a packaged library at a candidate path for all four Linux combinations (musl/gnu, x86_64/aarch64)eclipse-temurin:17-alpinewithCEDAR_JAVA_FFI_LIBunset, asserting a permit and a forbid throughBasicAuthorizationEngine.isAuthorizedTesting
readelf -dshows onlyNEEDED [libc.so]with zeroGLIBC_symbols for bothjne/linux_musl/{x64,x86_64,amd64}/...andjne/linux_musl/{arm64,aarch64}/...), so the packaged directory names resolve on a musl hostadf0ee14b38c57de43927461f2a59cf70b289ada: FFIcargo test, FFI formatting, Gradle build with the new packaging test, javadoc, and the Alpine smoke (permit: allowed=true,forbid: allowed=false)Follow-ups / Known Limitations
Footer
Generated by GPT-6.1 Sol (implementation), GPT-6 Astra (review), GLM-5.3-Flash (brief, verification)