fix(backend): adjust libc detection for musl distros#10020
Conversation
Greptile SummaryThis PR fixes libc detection on Alpine Linux (and other musl distros) when
Confidence Score: 5/5Safe to merge. The os-release check correctly short-circuits linker detection for known musl distros, and MISE_LIBC override precedence is preserved at every call site. The core fix is narrow and well-tested: musl_from_os_release handles blank lines and comments with continue, the MISE_LIBC env-var override is checked before detect_libc() in both Platform::current() and vfox_plugin.rs, and the duplicate detection code in the vfox crate has been cleanly removed. No files require special attention. Important Files Changed
Reviews (4): Last reviewed commit: "fix(backend): adjust libc detection for ..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request improves musl libc detection on Linux by parsing /etc/os-release for specific distribution IDs, ensuring correct identification even when compatibility shims like gcompat are present. Review feedback identified a bug in the parsing logic where the use of the ? operator causes the function to exit prematurely when encountering empty lines or comments. Additionally, it is recommended to centralize the musl_from_os_release function to avoid code duplication between the vfox crate and the main platform module.
786d80d to
d78acbb
Compare
| env_logger = { version = "0.11", optional = true } | ||
| clap = { version = "4", features = ["derive"], optional = true } | ||
| tempfile = "3" | ||
| mise-libc-detect = { path = "../mise-libc-detect" } |
There was a problem hiding this comment.
a whole new crate for this seems excessive
There was a problem hiding this comment.
Hi @jdx thanks for the view.
Where would you prefer the code live?
- Duplicate the code between vfox and mise
- Move the code into vfox
- An independent crate
I don't have a strong opinion and want to respect your preference. Thank you.
There was a problem hiding this comment.
I would probably just configure vfox from the mise crate
d78acbb to
db444ff
Compare
Hi,
I was running into issues where if
gcompatwas installed on Alpine, mise would select the wrong environment. The workaround is to explicitly set withMISE_LIBC. and refactored out an existing piece that followed the same logic.Thank you