From 6874eed4602aafb8eeaaad7c1e5dfeca4747284c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 18 Jan 2026 19:02:56 +0000 Subject: [PATCH 1/2] Initial plan From 307ab2f83cf14b0020ff5995aed3558495bf8769 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 18 Jan 2026 19:14:43 +0000 Subject: [PATCH 2/2] Add libc detection for musl vs glibc on Linux systems Co-authored-by: bytemain <13938334+bytemain@users.noreply.github.com> --- lib/foojay.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/foojay.lua b/lib/foojay.lua index a7ab348..409a3a3 100644 --- a/lib/foojay.lua +++ b/lib/foojay.lua @@ -6,6 +6,20 @@ local foojay = {} local URL = "https://api.foojay.io/disco/v3.0/packages/jdks?version=%s&distribution=%s&architecture=%s&archive_type=%s&operating_system=%s&lib_c_type=%s&release_status=ga&directly_downloadable=true" +--- Detects the libc type on Linux systems (glibc or musl) +--- @return string "glibc" or "musl" +local function detect_lib_c_type() + local handle = io.popen("ldd --version 2>&1") + if handle then + local result = handle:read("*a") + handle:close() + if result and result:lower():find("musl") then + return "musl" + end + end + return "glibc" +end + foojay.fetchtJdkList= function (distribution, version) local os = RUNTIME.osType @@ -24,7 +38,7 @@ foojay.fetchtJdkList= function (distribution, version) local lib_c_type = "" if os == "linux" then - lib_c_type = "glibc" + lib_c_type = detect_lib_c_type() end -- Convert arm64 to aarch64 for foojay API compatibility