Commit 6cd2fda
authored
Windows support (#18)
* Windows platform support:
- Justfile: [windows] recipes for build-hyperlight, resolve-hyperlight-dir, start-debug
- Justfile: runtime-cflags forward-slash fix for clang cross-compilation
- build-binary.js: .cmd launcher, platform-aware post-build output
- plugins: O_NOFOLLOW fallback (Windows lacks O_NOFOLLOW, relies on lstat pre-check)
- agent/index.ts: pathToFileURL for ESM plugin imports on Windows
- build.rs: forward-slash CFLAGS for clang on Windows
- code-validator/guest: win32-x64-msvc NAPI target
- .gitattributes: enforce LF line endings across platforms
VM resource management:
- sandbox/tool.js: invalidateSandbox() now calls dispose() on LoadedJSSandbox
and JSSandbox for deterministic VM cleanup instead of relying on V8 GC
- Updated hyperlight-js dep to include dispose() API
Error handling:
- agent/event-handler.ts: suppress duplicate 'Tool execution failed' messages
- sandbox/tool.js: MMIO error detection in compilation and runtime paths
- agent/index.ts: surrogate pool env vars (HYPERLIGHT_INITIAL/MAX_SURROGATES)
Test fixes (Windows compatibility):
- tests: symlink EPERM skip for Windows (path-jail, fs-read, fs-write)
- tests/dts-sync: rmSync instead of shell rm -rf
- tests/pattern-loader: unique tmpdir per test to avoid Windows EBUSY locks
CI:
- pr-validate.yml: Windows WHP matrix
- publish.yml: Windows build support
Security:
- npm audit fix across all workspaces (picomatch, brace-expansion)
- plugin-system/manager.ts: simplified ternary
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
* fix: cross-platform npm publish with runtime NAPI detection
- build-binary.js: use napi-rs generated index.js for platform detection
instead of hardcoded triple shim. Copies all available .node files so
the package works on any platform.
- publish.yml: build native addons on Linux AND Windows in parallel,
upload as artifacts, combine in publish job. Tests run on each platform
before upload. Follows same pattern as hyperlight-js PR #36.
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
* fix: download artifacts after setup to avoid symlink clobber
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
* feat: add musl (Alpine) build target for hyperlight-analysis
- Add x86_64-unknown-linux-musl to napi targets in package.json
- Add linux-musl build matrix entry in publish.yml (same Linux runner,
installs musl-tools and adds Rust musl target)
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
* fix: cross-platform publish with musl detection and CI corrections
build-binary.js:
- Launcher detects musl vs glibc for hyperlight-analysis .node loading
using ldd probe, tries platform-specific .node directly
- Uses napi-rs generated index.js for js-host-api (has full detection)
- Copies all available platform .node files via ALL_TRIPLES loop
publish.yml:
- musl build: cross-compiles from glibc runner with musl-tools,
uses napi build --target x86_64-unknown-linux-musl, skips tests
(musl .node can't run on glibc host)
- gnu/win32 builds: run tests natively on their platforms
- publish-npm: runs on self-hosted runner (needs Rust toolchain),
downloads artifacts AFTER setup to avoid symlink clobber
- Verifies musl .node files are produced before artifact upload
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
* fix: commit regenerated ha-modules.d.ts + add sync test
- ha-modules.d.ts: update return types to ShapeFragment (was string)
to match upstream ShapeFragment safety system changes
- dts-sync.test.ts: add ha-modules.d.ts regeneration check that catches
drift when module exports/types change but the generator isn't re-run
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
---------
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>1 parent c6d4d72 commit 6cd2fda
File tree
4 files changed
+182
-34
lines changed- .github/workflows
- scripts
- src/code-validator/guest
- tests
4 files changed
+182
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | | - | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | | - | |
37 | | - | |
38 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
39 | 48 | | |
40 | 49 | | |
41 | 50 | | |
| |||
53 | 62 | | |
54 | 63 | | |
55 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
56 | 85 | | |
| 86 | + | |
57 | 87 | | |
| 88 | + | |
| 89 | + | |
58 | 90 | | |
59 | 91 | | |
| 92 | + | |
60 | 93 | | |
61 | 94 | | |
62 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
63 | 110 | | |
64 | 111 | | |
65 | | - | |
66 | | - | |
| 112 | + | |
| 113 | + | |
67 | 114 | | |
68 | 115 | | |
69 | 116 | | |
| |||
81 | 128 | | |
82 | 129 | | |
83 | 130 | | |
84 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
85 | 141 | | |
86 | 142 | | |
87 | 143 | | |
| |||
100 | 156 | | |
101 | 157 | | |
102 | 158 | | |
103 | | - | |
| 159 | + | |
104 | 160 | | |
105 | 161 | | |
106 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
225 | 239 | | |
226 | 240 | | |
227 | 241 | | |
228 | 242 | | |
229 | 243 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
234 | 257 | | |
235 | 258 | | |
236 | 259 | | |
| |||
250 | 273 | | |
251 | 274 | | |
252 | 275 | | |
| 276 | + | |
253 | 277 | | |
254 | 278 | | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
259 | 289 | | |
260 | 290 | | |
261 | 291 | | |
262 | 292 | | |
263 | 293 | | |
264 | 294 | | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
271 | 300 | | |
272 | 301 | | |
273 | 302 | | |
| |||
403 | 432 | | |
404 | 433 | | |
405 | 434 | | |
406 | | - | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
407 | 464 | | |
408 | 465 | | |
409 | 466 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
11 | 17 | | |
12 | 18 | | |
13 | 19 | | |
| |||
230 | 236 | | |
231 | 237 | | |
232 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
233 | 267 | | |
234 | 268 | | |
235 | 269 | | |
| |||
0 commit comments