@adhdev/ghostty-vt-node 1.0.77 → 1.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/prebuilt/linux-x64-node115/libghostty-vt.so.0 +0 -0
- package/prebuilt/linux-x64-node127/libghostty-vt.so.0 +0 -0
- package/prebuilt/linux-x64-node137/libghostty-vt.so.0 +0 -0
- package/prebuilt/linux-x64-node141/libghostty-vt.so.0 +0 -0
- package/scripts/ensure-prebuilt-sonames.mjs +52 -0
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Make every Linux prebuilt directory carry the SONAME file its addon links
|
|
3
|
+
// against (libghostty-vt.so.0). CI artifacts and npm tarballs drop symlinks, so
|
|
4
|
+
// a directory restored from an artifact has only libghostty-vt.so and
|
|
5
|
+
// libghostty-vt.so.0.1.0 — and the addon then fails to load on every Linux
|
|
6
|
+
// machine (v1.0.77). Copies the versioned file to the SONAME name when missing.
|
|
7
|
+
//
|
|
8
|
+
// node scripts/ensure-prebuilt-sonames.mjs # fix in place
|
|
9
|
+
// node scripts/ensure-prebuilt-sonames.mjs --check # fail if any is missing
|
|
10
|
+
// ... --load also require() the package and fail unless the binding loads
|
|
11
|
+
// (only meaningful on a platform that has a prebuilt)
|
|
12
|
+
import { copyFileSync, existsSync, readdirSync, statSync } from 'node:fs';
|
|
13
|
+
import { createRequire } from 'node:module';
|
|
14
|
+
import { dirname, join } from 'node:path';
|
|
15
|
+
import { fileURLToPath } from 'node:url';
|
|
16
|
+
|
|
17
|
+
const pkgDir = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
18
|
+
const prebuiltDir = join(pkgDir, 'prebuilt');
|
|
19
|
+
const check = process.argv.includes('--check');
|
|
20
|
+
const load = process.argv.includes('--load');
|
|
21
|
+
const SONAME = 'libghostty-vt.so.0';
|
|
22
|
+
const VERSIONED = /^libghostty-vt\.so\.0\.\d+\.\d+$/;
|
|
23
|
+
|
|
24
|
+
const problems = [];
|
|
25
|
+
for (const triplet of existsSync(prebuiltDir) ? readdirSync(prebuiltDir) : []) {
|
|
26
|
+
if (!triplet.startsWith('linux-')) continue;
|
|
27
|
+
const dir = join(prebuiltDir, triplet);
|
|
28
|
+
if (!statSync(dir).isDirectory()) continue;
|
|
29
|
+
if (existsSync(join(dir, SONAME))) continue;
|
|
30
|
+
const versioned = readdirSync(dir).find((name) => VERSIONED.test(name));
|
|
31
|
+
if (!versioned) { problems.push(`${triplet}: no ${SONAME} and no versioned library to copy`); continue; }
|
|
32
|
+
if (check) { problems.push(`${triplet}: missing ${SONAME}`); continue; }
|
|
33
|
+
copyFileSync(join(dir, versioned), join(dir, SONAME));
|
|
34
|
+
console.log(`[ghostty-vt] ${triplet}: ${versioned} -> ${SONAME}`);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (load) {
|
|
38
|
+
try {
|
|
39
|
+
const req = createRequire(join(pkgDir, 'index.js'));
|
|
40
|
+
const mod = req(join(pkgDir, 'index.js'));
|
|
41
|
+
if (!mod || (typeof mod !== 'object' && typeof mod !== 'function')) throw new Error('binding export is empty');
|
|
42
|
+
console.log(`[ghostty-vt] binding loads on ${process.platform}-${process.arch} (abi ${process.versions.modules})`);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
problems.push(`binding failed to load on ${process.platform}-${process.arch}: ${error?.message || error}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (problems.length) {
|
|
49
|
+
for (const p of problems) console.error(`✗ ${p}`);
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
if (check) console.log('[ghostty-vt] prebuilt SONAME check passed');
|