Merged
Conversation
- 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>
- 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>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates HyperAgent’s build/release pipeline to ship a single cross-platform npm package by producing and bundling prebuilt native addons (Linux + Windows), alongside a few Windows-focused robustness tweaks.
Changes:
- Update
scripts/build-binary.jsto bundle all available platform.nodeaddons intodist/and improve Windows-safe launcher importing. - Refactor
.github/workflows/publish.ymlto build native addons per-platform, upload them as artifacts, then combine/publish from a single Ubuntu job. - Minor Windows stability fix in tests (more selective cleanup error swallowing) and a small
postinstallscript fix.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tests/pattern-loader.test.ts |
Tightens Windows temp-dir cleanup handling to only swallow known lock-related errors. |
scripts/build-binary.js |
Copies multiple platform native addons into the packaged binary output; improves addon resolution and Windows path importing. |
package.json |
Fixes postinstall inline script termination (adds trailing semicolon inside the conditional). |
builtin-modules/src/types/ha-modules.d.ts |
Updates generated builtin-module typings (but currently introduces major API/type mismatches vs implementations). |
builtin-modules/pptx.json |
Updates module metadata hashes. |
builtin-modules/pptx-tables.json |
Updates module metadata hashes. |
builtin-modules/pptx-charts.json |
Updates module metadata hashes. |
builtin-modules/ooxml-core.json |
Updates module metadata hashes. |
.github/workflows/publish.yml |
Splits build vs publish; adds Windows build target and combines native addon artifacts before publishing. |
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
- 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>
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>
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the build and packaging process to produce a cross-platform npm package with prebuilt native addons for multiple platforms. It also refines the GitHub Actions workflow to build and combine these native artifacts, and improves the logic for copying and resolving native modules. Minor fixes and improvements are included in scripts and tests.