* 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.
()
| 50 | * whose result is cached at module load. If the cache isn't populated yet, returns false. |
| 51 | */ |
| 52 | function 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 |
| 62 | let jetBrainsIDECache: string | null | undefined |
nothing calls this directly
no outgoing calls
no test coverage detected