Skip to content

fix(release): drop dead dist/vendor copy; publish the verified tarball; cache cargo#331

Open
ig-ant wants to merge 1 commit into
mainfrom
ig/release-followup
Open

fix(release): drop dead dist/vendor copy; publish the verified tarball; cache cargo#331
ig-ant wants to merge 1 commit into
mainfrom
ig/release-followup

Conversation

@ig-ant

@ig-ant ig-ant commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #321.

dist/vendor/ is dead weight

prepublishOnly copied vendor/{seccomp,srt-win} into dist/vendor/, so the published package shipped two copies of every prebuilt binary — ~10MB of duplicate srt-win.exe and ~1.6MB of duplicate apply-seccomp per release.

Neither resolver needs the dist/vendor/ copy in an installed package:

prepublishOnly is now just npm run clean && npm run build.

Publish the verified tarball

npm pack does not run prepublishOnly — only directory-mode npm publish does. So #321's tarball-contents check was inspecting a different shape than actually shipped (no dist/vendor/, which is why it didn't catch the duplicate-binary bug).

Now: npm run prepublishOnlynpm pack → verify → npm publish "$PKG". Publishing a tarball skips lifecycle scripts, so the verified artifact is byte-identical to what publishes. Tarball listing is captured once and grepped in-memory (was tar -tzf ×7). New assertion: dist/vendor/ absent.

verify-package trimmed

Only the host-arch (x64) srt-win.exe is exercised on windows-latest; drop build-seccomp from needs: and the three unused artifact downloads. Presence of the others in the tarball is covered by the publish job's contents check.

Cargo build cache

Swatinem/rust-cache@v2 with shared-key: srt-win on the Windows legs of both integration-tests.yml (warms the cache on main pushes; speeds the ~5-8min cargo build on every PR) and release.yml build-srt-win (restores from main via the default-branch cache fallback — without the shared key, the tag-ref release would never see a saved cache). Placed after dtolnay/rust-toolchain@stable so the cache key derives from the installed rustc.

@ig-ant ig-ant marked this pull request as ready for review June 24, 2026 00:14
@ig-ant ig-ant self-assigned this Jun 24, 2026
…l; cache cargo

dist/vendor/ is dead weight in the published package. Both resolvers
already find binaries at the package-root vendor/ location:
getSrtWinPath() via repoRoot()+vendor/srt-win/<arch>/, and
getLocalSeccompPaths() via its baseDir/../../vendor/seccomp/<arch>/
candidate. The dist/vendor/ candidate in the seccomp resolver
predates vendor/ being in package.json files[] — it stays in code for
downstream-bundler layouts, but populating dist/vendor in OUR tarball
serves nothing. prepublishOnly is now just clean+build; ~10MB of
duplicate srt-win.exe and ~1.6MB of duplicate apply-seccomp dropped
from every release.

Publish the verified tarball: `npm pack` does not run
prepublishOnly, so the tarball-contents check was inspecting a
different shape than `npm publish` (directory mode) would ship. Run
prepublishOnly explicitly, pack, verify, then publish THAT tarball
via `npm publish "$PKG"` (tarball mode skips lifecycle scripts so
no rebuild happens between verify and publish). Tarball listing is
captured once and grepped in-memory. New assertion: dist/vendor/ is
absent.

verify-package: only the host-arch (x64) srt-win binary is exercised;
drop build-seccomp from needs and the three unused artifact
downloads. Presence of the others is covered by the tarball check.

Cargo cache: Swatinem/rust-cache@v2 with shared-key=srt-win on the
Windows legs of integration-tests.yml (warms the cache on main
pushes) AND build-srt-win in release.yml (restores from main via the
default-branch fallback). Placed after dtolnay/rust-toolchain so the
cache key derives from the installed rustc.
@ig-ant ig-ant force-pushed the ig/release-followup branch from 9e8d552 to 44c6704 Compare June 24, 2026 14:23
@ig-ant ig-ant changed the title fix(release): drop dead dist/vendor/srt-win copy; verify what we publish fix(release): drop dead dist/vendor copy; publish the verified tarball; cache cargo Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant