MCPcopy Create free account
hub / github.com/freecodexyz/free-code / isMuslEnvironment

Function isMuslEnvironment

src/utils/envDynamic.ts:52–59  ·  view source on GitHub ↗

* Checks if the system is using MUSL libc instead of glibc. * In native linux builds, this is statically known at compile time via IS_LIBC_MUSL/IS_LIBC_GLIBC flags. * In node (unbundled), both flags are false and we fall back to a runtime async stat check * whose result is cached at module load.

()

Source from the content-addressed store, hash-verified

50 * whose result is cached at module load. If the cache isn't populated yet, returns false.
51 */
52function isMuslEnvironment(): boolean {
53 if (feature('IS_LIBC_MUSL')) return true
54 if (feature('IS_LIBC_GLIBC')) return false
55
56 // Fallback for node: runtime detection via pre-populated cache
57 if (process.platform !== 'linux') return false
58 return muslRuntimeCache ?? false
59}
60
61// Cache for async JetBrains detection
62let jetBrainsIDECache: string | null | undefined

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected