Repository navigation
Ship platform-specific packages with build and publish workflows - #1016
Closed
John-David Dalton (jdalton) wants to merge 1 commit into
Closed
John-David Dalton (jdalton) wants to merge 1 commit into
John-David Dalton (jdalton) wants to merge 1 commit into
Conversation
John-David Dalton (jdalton)
marked this pull request as ready for review
November 10, 2026 03:31
Author
|
@microsoft-github-policy-service agree |
Author
Author
|
I actually think #1018 is the way to avoid most of this, it leverages Node FFI in Node 26 (LTS now). |
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.
Install only the native binaries needed by the current OS and CPU, addressing #864 with the optional-package approach used by @lydell/node-pty. In the measured macOS ARM64 example, wrapper plus native package fall from 26.9 MB to 2.67 MB unpacked and 7.15 MB to 1.25 MB downloaded, while retaining source-build fallback.
Fixes #864. This is the per-platform distribution option. The alternative is #1015, which keeps the existing distribution and compresses its native addons. Both address the package-size overhead discussed in #864, with different savings and tradeoffs. These are independent proposals; maintainers can choose either approach.
Package and loader changes
@node-pty, with OS/CPU constraints and glibc metadata for Linux.Build and publication workflows
Lydell provides build/publish scripts rather than a GitHub workflow. This adds a manual six-platform workflow that builds and tests native packages, packs all seven tarballs, and tests actual installs with lifecycle scripts disabled before allowing publication.
The opt-in upstream-main publish job uses npm trusted publishing and a protected
npmenvironment. It verifies every tarball's SHA-512, publishes native packages before the wrapper, stops on failures, and only skips already-published versions when their integrity matches.Azure build/test/scan configuration remains; its old publish switch is removed to prevent independent publication of the monolithic wrapper. The new GitHub release job does not automatically inherit Azure organizational approval/security gates.
Maintainer setup is required: ownership/bootstrap of the proposed scope and six package names, npm trusted publishing for seven packages, and the protected environment/release gates. No npm packages or account settings were changed.
Release workflow and local reproduction.
Measurements and validation
The size example uses node-pty 1.2.0-beta.18 native builds with this branch's wrapper. The macOS ARM64 package pair contains 2,674,852 unpacked bytes and 1,251,650 tarball bytes. Savings include removing debug symbols as well as other platforms; shared dependencies and filesystem allocation are excluded.
Per-package sizes.