Repository navigation
Bump sharp to 0.35.3 and bring compliance tooling up to date - #36
Merged
Giorgio Ughini (GiorgioUghini) merged 3 commits intoAug 3, 2026
Merged
Conversation
6 tasks
Upgrades sharp 0.34.5 -> 0.35.3 (sharp-libvips 1.2.4 -> 1.3.2, libvips 8.17.3 -> 8.18.3) and reworks the fail-closed compliance machinery so the LGPL obligations for the bundled libvips stack stay satisfied. sharp 0.35 dropped the `cpu: ["wasm32"]` constraint from @img/sharp-wasm32 and moved gating to the freebsd/webcontainers wrapper packages, so npm now installs the WASM payload on every platform. It is non-functional (@emnapi/runtime is not installed) but still landed inside asarUnpack'd node_modules/@img/**, and its differing versions.json broke license preparation. It is now excluded from packaging and the packaged artifact verifiers reject it. Compliance engine: - select the architecture-matched native payload instead of requiring every installed @img package to agree; POSIX resolves through @img/sharp-libvips-* because @img/sharp-{darwin,linux}-* no longer ship versions.json - disambiguate the Linux payload by runtime libc, since package-lock.json cannot express `libc` and npm installs both glibc and musl variants - derive source materials from the selected payload's versions.json, with version-qualified ids so the Windows and POSIX manifests can diverge - fetch commit-pinned components (mozjpeg, libtiff, libultrahdr) by immutable SHA via git archive - emit only the in-repo Windows build archive on win32, and the four externally fetched POSIX patches elsewhere; drop the stale aom, highway and heif patch entries plus spng - resolve SPDX `AND` expressions so multi-licensed payloads are covered Also fixes verify-windows-package.mjs, which expected lib/sharp-win32-<arch>.node; 0.35 renames it to lib/sharp-win32-<arch>-<version>.node. Release targets are now Windows x64, Windows arm64 and macOS arm64; the unused Linux AppImage target is removed and macOS CI runs the full compliance:prepare rather than licenses only. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 485e0e65-2d1a-4a93-a864-ec460c2059dd
Giorgio Ughini (GiorgioUghini)
force-pushed
the
bump-sharp-libvips-compliance
branch
from
August 3, 2026 08:51
daca1a2 to
d5ef22e
Compare
Giorgio Ughini (GiorgioUghini)
marked this pull request as ready for review
August 3, 2026 08:51
`npm ci` failed on ubuntu-latest and on the Windows source-install job with packages missing from the lock file. sharp 0.35 makes @img/sharp-wasm32 installable on every platform, so its @emnapi/runtime dependency is now required everywhere, but npm on Windows prunes entries it does not need locally when it updates an existing lock. The result installs fine here and fails everywhere else, which breaks the documented `npm ci` source-install path. install.sh and install.ps1 both pull `latest-v24.x`, which currently ships a newer npm than the one that generated the lock, and that newer npm also wants @emnapi/core hoisted to the root. The lock is now repaired with that exact npm, so it satisfies both. Verified with `npm ci --dry-run` under npm 11.6.2 and 11.16.0 on Linux, and for linux x64/arm64 (glibc and musl), darwin arm64 and win32 x64/arm64. Adds assertLockfileClosure so every compliance run rejects a lock whose declared dependencies cannot be resolved, instead of finding out from a release job. @emnapi/runtime exists only to support the WASM payload we already exclude, so it is excluded from packaging too rather than shipped as dead code. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 485e0e65-2d1a-4a93-a864-ec460c2059dd
Giorgio Ughini (GiorgioUghini)
force-pushed
the
bump-sharp-libvips-compliance
branch
from
August 3, 2026 09:32
2b0f77b to
de17698
Compare
Chromium's LICENSES.chromium.html is not the same file on every platform, so the single reviewed hash in the policy only ever matched Windows. macOS now runs the full compliance:prepare and failed on it. Keys electron.notices by platform-arch alongside electron.distributions, with the macOS hash derived from the already-reviewed darwin-arm64 distribution archive, and makes both the preparation and the packaged-artifact verifier look up the reviewed value for the platform they are running on. A missing entry is now an explicit "has not been reviewed" failure rather than a hash mismatch. Also stops asserting a fixed detectLinuxLibc() result for the host running the tests, which made the suite fail on Linux. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 485e0e65-2d1a-4a93-a864-ec460c2059dd
Giorgio Ughini (GiorgioUghini)
left a comment
Contributor
There was a problem hiding this comment.
Fixed compliance, now ok
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.
Bumps
sharp0.34.5 -> 0.35.3 (sharp-libvips1.2.4 -> 1.3.2,libvips8.17.3 -> 8.18.3) and reworks the compliance tooling so the LGPL obligations for the bundled libvips stack stay satisfied.Why the tooling had to change
sharp 0.35 removed
cpu: ["wasm32"]from@img/sharp-wasm32and moved the gating to the@img/sharp-freebsd-wasm32/@img/sharp-webcontainers-wasm32wrappers, which merely depend on it. npm therefore hoists and installs the WASM payload on every platform. It is non-functional (@emnapi/runtimeis not installed) but still landed inside theasarUnpack'dnode_modules/@img/**, and its differingversions.jsonmadecompliance:licensesfail with "Installed Sharp native packages disagree about embedded library versions."There are exactly two shipped native manifests, and they are not identical:
@img/sharp-win32-*)@img/sharp-libvips-*)732665cd01a94b13a058f1acdbed@img/sharp-{darwin,linux}-*@0.35.3no longer ship aversions.json, so POSIX must resolve through the@img/sharp-libvips-*package.spngis gone;libultrahdr(dual MIT + Apache-2.0) is new.Changes
Packaging
@img/sharp-wasm32,@img/sharp-freebsd-wasm32and@img/sharp-webcontainers-wasm32from the app bundle.verify-packaged-compliance.mjsandverify-windows-package.mjsnow reject those packages and any.wasmundernode_modules/@img/in the packaged artifact.Compliance engine (
scripts/compliance.mjs)@imgpackage to agree.package-lock.jsoncannot expresslibc, sonpm ciinstalls both the glibc and musl variants on every host — verified withnpm ci --dry-run --os=linux --cpu=x64 --libc=glibc.versions.json, with version-qualified ids so the two manifests can diverge.mozjpeg,libtiff,libultrahdr) by immutable SHA viagit archive.aom,highwayandheifpatch entries plusspng.e2daed8da97d8857dcec2fd68d2f6f3326170f67rather than the mutablepull/383.patchURL.ANDexpressions so multi-licensed payloads are fully covered.Also fixed:
verify-windows-package.mjsexpectedlib/sharp-win32-<arch>.node, but 0.35 renames it tolib/sharp-win32-<arch>-<version>.node. Windows CI would have failed on this.CI: macOS now runs the full
compliance:prepareinstead of licenses-only, and both workflows cache.compliance-cache.New:
scripts/review-compliance-sources.mjs(npm run compliance:review) downloads candidate source material into a scratch directory and prints proposed policy hashes for human review. It never writes the policy itself.Verification
compliance:licenses(179 packages),compliance:prepare(34 Windows source materials)compliance:test27/27,typecheck,npm test72/73 (the one failure,writeDebugBundle, is pre-existing onmain— nounzipon Windows)npm run dist:win:arm64+verify-windows-package.mjs arm64; the packaged app contains only@img/colourand@img/sharp-win32-arm64git fetch --depth=1 <repo> <sha>confirmed working for every commit-pinned sourceFixed while getting CI green
@img/sharp-wasm32installable everywhere, so its@emnapi/runtimedependency is now required on every platform, but npm on Windows prunes entries it does not need locally when it updates an existing lock.install.sh/install.ps1also pulllatest-v24.x, which ships a newer npm that additionally wants@emnapi/corehoisted to the root. The lock is repaired with that exact npm and verified under npm 11.6.2 and 11.16.0 for linux x64/arm64 (glibc and musl), darwin arm64 and win32 x64/arm64.assertLockfileClosurenow rejects a lock whose declared dependencies cannot be resolved.LICENSES.chromium.htmldiffers per platform. The single reviewed hash only ever matched Windows, so macOS failed as soon as it started running the fullcompliance:prepare.electron.noticesis now keyed by platform-arch alongsideelectron.distributions, with the macOS hash derived from the already-revieweddarwin-arm64distribution archive.selectNativePayloadthrew on every glibc Linux host.package-lock.jsoncannot expresslibc, so npm installs both the glibc and musl payloads; the payload is now chosen by the running C library.verify-windows-package.mjslooked for the wrong addon filename. 0.35 renames it tolib/sharp-win32-<arch>-<version>.node.