diff --git a/.yarn/versions/1f924e2c.yml b/.yarn/versions/1f924e2c.yml new file mode 100644 index 00000000000..7984e0fe3fa --- /dev/null +++ b/.yarn/versions/1f924e2c.yml @@ -0,0 +1,35 @@ +releases: + "@yarnpkg/core": patch + "@yarnpkg/cli": patch + +declined: + - "@yarnpkg/plugin-compat" + - "@yarnpkg/plugin-constraints" + - "@yarnpkg/plugin-dlx" + - "@yarnpkg/plugin-essentials" + - "@yarnpkg/plugin-exec" + - "@yarnpkg/plugin-file" + - "@yarnpkg/plugin-git" + - "@yarnpkg/plugin-github" + - "@yarnpkg/plugin-http" + - "@yarnpkg/plugin-init" + - "@yarnpkg/plugin-interactive-tools" + - "@yarnpkg/plugin-jsr" + - "@yarnpkg/plugin-link" + - "@yarnpkg/plugin-nm" + - "@yarnpkg/plugin-npm" + - "@yarnpkg/plugin-npm-cli" + - "@yarnpkg/plugin-pack" + - "@yarnpkg/plugin-patch" + - "@yarnpkg/plugin-pnp" + - "@yarnpkg/plugin-pnpm" + - "@yarnpkg/plugin-stage" + - "@yarnpkg/plugin-typescript" + - "@yarnpkg/plugin-version" + - "@yarnpkg/plugin-workspace-tools" + - "@yarnpkg/builder" + - "@yarnpkg/doctor" + - "@yarnpkg/extensions" + - "@yarnpkg/nm" + - "@yarnpkg/pnpify" + - "@yarnpkg/sdks" diff --git a/packages/yarnpkg-core/sources/nodeUtils.ts b/packages/yarnpkg-core/sources/nodeUtils.ts index 02d2d438e7a..21e3d1467f2 100644 --- a/packages/yarnpkg-core/sources/nodeUtils.ts +++ b/packages/yarnpkg-core/sources/nodeUtils.ts @@ -26,9 +26,10 @@ export const openUrl = typeof openUrlBinary !== `undefined` const LDD_PATH = `/usr/bin/ldd` as PortablePath; function getLibc() { - // Darwin and Windows have their own standard libraries, and the getReport() call is costly. - // It also seems that Node randomly crashes with no output under some circumstances when running a getReport() on Windows. - if (process.platform === `darwin` || process.platform === `win32`) + // As of 2025, linux is the only possible process.platform value that does not imply the libc for Node's purposes. + // Technically mingw32 (a way to build and run software using glibc on Windows) exists and even has a node.js port, but no one in + // the broader node.js ecosystem seems to care about it. There have been issues in the past running getReport() on Windows. + if (process.platform !== `linux`) return null; let header: Buffer | undefined; @@ -39,7 +40,7 @@ function getLibc() { // Since the getReport can be prohibitely expensive (it also queries DNS which, if misconfigured, can take a long time to timeout), // we first check if the ldd binary is glibc or musl, and only then run the getReport() if we can't determine the libc variant. if (typeof header !== `undefined`) { - if (header && (header.includes(`GLIBC`) || header.includes(`libc`))) + if (header && (header.includes(`GLIBC`) || header.includes(`GNU libc`) || header.includes(`GNU C Library`))) return `glibc`; if (header && header.includes(`musl`)) { return `musl`;