a collection of lightweight TypeScript packages for AT Protocol, the protocol powering Bluesky
atproto bluesky typescript npm
101
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(time-ms): use alternative way to detect libc

Mary be5cd28c 9588d133

+12 -3
+5
.changeset/vast-suns-repeat.md
··· 1 + --- 2 + '@atcute/time-ms': patch 3 + --- 4 + 5 + use alternative way to detect libc
+7 -3
packages/misc/time-ms/lib/index.node.ts
··· 1 + import { readFileSync } from 'node:fs'; 1 2 import { createRequire } from 'node:module'; 2 - import { arch, platform, report } from 'node:process'; 3 + import { arch, platform } from 'node:process'; 3 4 4 5 type TimeBinding = { 5 6 now: () => number; ··· 21 22 try { 22 23 const getPrebuildDir = (): string => { 23 24 if (platform === 'linux') { 24 - const header = (report.getReport() as Record<string, any>).header; 25 - const libc = header.glibcVersionRuntime ? 'glibc' : 'musl'; 25 + const ldd = readFileSync('/usr/bin/ldd', 'utf-8'); 26 + const libc = ldd.includes('musl') ? 'musl' : ldd.includes('GNU C Library') ? 'glibc' : null; 27 + if (libc === null) { 28 + throw new Error(`unable to detect libc`); 29 + } 26 30 return `${platform}-${arch}-${libc}`; 27 31 } 28 32 return `${platform}-${arch}`;