Repository navigation
fix: do not report musl on Alpine images running glibc - #1475
Open
ChrisJr404 wants to merge 1 commit into
Open
ChrisJr404 wants to merge 1 commit into
ChrisJr404 wants to merge 1 commit into
Conversation
Collaborator
|
thanks for the PR, can you check the code formatting failing and fix via |
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.
Fixes #1474
Problem
On an Alpine-based image that ships glibc (not musl),
OSInfo.isMusl()returnstrueand sqlite-jdbc selects theLinux-Muslnative library, which then fails to load on glibc.The cause is the
isMusl()fallback. When/proc/self/map_fileshas no entry resolving to amuslpath,isMusl()falls back toisAlpineLinux(), which returnstruefor any/etc/os-releaseline that starts withIDand containsalpine. Images such asbellsoft/hardened-liberica-runtime-container:...-glibchaveID_LIKE=alpineandLIBC_TYPE=glibc, so the fallback reports musl even though the runtime libc is glibc.Fix
Honor
LIBC_TYPE=glibcin/etc/os-release. The os-release check now reports musl only when the file marks an Alpine system (ID/ID_LIKEcontainsalpine) and does not also declareLIBC_TYPE=glibc. A standard musl Alpine image (noLIBC_TYPE) is still detected as musl, so the existing behavior is preserved.Tests
Added
testMuslDetectionFromOsReleasetoOSInfoTest, covering three os-release cases: a real musl Alpine image (true), an Alpine-based glibc image withLIBC_TYPE=glibc(false, the regression), and a non-Alpine distribution (false).mvn test -Dtest=OSInfoTestpasses (13 tests, 0 failures).