feat: use build manifest to load compatible binaries #717
Merged
Conversation
This adds a `manifest.json` for the built binaries under built that allows the package to load the correct addon path during runtime. This PR also adds the libc/abi as information in the key, so it will avoid the conflicts between Musl/Glib, and loading will be faster since the compatible binaries are found deterministically.
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a manifest-based approach for loading compatible addon binaries, replacing a directory scan with a manifest lookup. It also updates the CI workflow to download artifacts, merge manifests, and adjust build commands for native Windows builds.
- Use a manifest.json to deterministically locate the correct addon based on platform, architecture, libc, and ABI.
- Reflect the changes in both TypeScript (src/load-addon.ts) and JavaScript (lib/load-addon.js) implementations.
- Update CI workflow (CI.yml) steps to merge build artifacts and manifests.
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/load-addon.ts | Replaces directory scanning with manifest-based addon matching and adds build config. |
| lib/load-addon.js | Mirrors TypeScript changes to use manifest for addon lookup. |
| .github/workflows/CI.yml | Adjusts CI steps for artifact handling, manifest merging, and native Windows builds. |
Files not reviewed (2)
- package.json: Language not supported
- pnpm-lock.yaml: Language not supported
Revert "build: target ES2019 in TypeScript" This reverts commit c8e6259. Update tsconfig.json
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 adds a
manifest.jsonfor the built binaries under built that allows the package to load the correct addon path during runtime. This PR also adds the libc/abi as information in the key, so it will avoid the conflicts between Musl/Glib, and loading will be faster since the compatible binaries are found deterministically.Fixes #715