Skip to content

npm: require Node 18 for the downloader - #40

Draft
vados-cosmonic wants to merge 2 commits into
bytecodealliance:mainfrom
vados-cosmonic:fix/npm-downloader-existing-issues
Draft

vados-cosmonic wants to merge 2 commits into
bytecodealliance:mainfrom
vados-cosmonic:fix/npm-downloader-existing-issues

Conversation

@vados-cosmonic

@vados-cosmonic vados-cosmonic commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Note

Merge #41 first. This branch is based on it, so until then the diff includes #41's commit; only the last commit belongs to this PR.

Bumps engines.node for the npm downloader from >=16 to >=18, since it uses the global fetch, which needs Node 18.

The rest of the original PR has been dropped:

  • update.js and the TAG in release.json are replaced by the version bump in ci: automate releases with release PRs #41's release PRs.
  • Download checksum verification is left for a follow-up that generates the checksums in the release workflow.

@cfallin

cfallin commented Dec 2, 2026

Copy link
Copy Markdown
Member

Thanks for working on this!

Question: this seems to imply to me that we have a bit of a chicken-and-egg problem: if the release commit itself contains a checked-in hash of the build of that commit, how do we actually do a release?

Right now, the process is: bump the versions and tags; commit and tag as v0.5.1; wait for the GitHub build to publish the artifacts; then push the npm package. Everything that is published comes from the tree at the same git hash. The "cyclic knot is tied" because we refer to "self" by name (v0.5.1) rather than by hash.

I guess we could make this work by having two commits -- tag and push v0.5.1 and let GitHub do the builds, then gather the artifact hashes, then push another commit with those, then publish the npm package -- but it's a bit more involved and we'd have to be careful not to merge anything in the meantime to keep the correspondence.

One way around that could be to split out the npm package as a separate GitHub repo; so we publish weval in the weval repo, and the only output of that is a tagged release with binary artifacts, then we separately version-bump the artifact dependency in weval-npm and cut a release there too. More steps and more repos but it could work.

My high-level question is: what problem are we solving here? Removing trust in the TLS-verified connection to GitHub + its trustworthy serving of artifacts? I guess that's a worthy goal, but we have the same issue with e.g. the Wasmtime installer too, and undoubtedly other BA artifacts.

@cfallin

cfallin commented Dec 2, 2026

Copy link
Copy Markdown
Member

Another thought: for a while I've wanted to see weval move to an automated release process (like Wasmtime has) instead of the tricky five-step process we have now. Would you be willing to work on that? That also constrains the above, but potentially also lessens the pain of having two separate repos (i.e., automated version bump and release in weval, then automated dependency-bump and version bump and release in weval-npm)...

@vados-cosmonic

Copy link
Copy Markdown
Contributor Author

We could definitely move to an automated release process -- would something like what jco and componentize-js work for you? Single "create-release-pr" action that makes a release PR, then you "just" merge that and the version in question gets released?

Happy to work on this separately from this PR and get weval releasing a bit easier.

I guess we could make this work by having two commits -- tag and push v0.5.1 and let GitHub do the builds, then gather the artifact hashes, then push another commit with those, then publish the npm package -- but it's a bit more involved and we'd have to be careful not to merge anything in the meantime to keep the correspondence.

Yeah I think we might be able to do this all in the same release process -- mostly because the sha of the artifact won't change after we generate it (then, in the same workflow generate the dependent artifact and upload that as well). This should be possible.

My high-level question is: what problem are we solving here? Removing trust in the TLS-verified connection to GitHub + its trustworthy serving of artifacts? I guess that's a worthy goal, but we have the same issue with e.g. the Wasmtime installer too, and undoubtedly other BA artifacts.

Yeah this is a good question, I think what we protect against here is successful supply chain attack (post-release the sha changes, because someone modifies the GH release artifact), but also GH has an immutable release setting now, so actually this may not be necessary at all! We could as well turn that on and remove the verification entirely.

@cfallin

cfallin commented Dec 2, 2026

Copy link
Copy Markdown
Member

Cool, let's plan on immutable releases instead of checked-in hashes -- just much easier to deal with because of the above cyclic issue.

Happy to review a PR to switch the release process whenever you're able -- thanks!

Add a release-PR flow, building on the existing release workflow:

- create-release-pr.yml bumps the version (Cargo.toml, Cargo.lock,
  npm/weval and the downloader TAG), updates CHANGELOG.md with
  git-cliff, and opens a release PR.
- tag-release.yml tags the merged release PR and starts release.yml on
  the tag.
- release.yml publishes tagged releases to crates.io and npm with
  trusted publishing (a dry run outside bytecodealliance/weval), pins
  its actions and scopes its permissions. The github-release action
  marks `-rc`-style tags as prereleases.

Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
@vados-cosmonic
vados-cosmonic force-pushed the fix/npm-downloader-existing-issues branch from ce4321d to 634cdc3 Compare December 3, 2026 15:02
@vados-cosmonic vados-cosmonic changed the title Verify npm downloader releases against published checksums npm: require Node 18 for the downloader Dec 3, 2026
@vados-cosmonic

vados-cosmonic commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor Author

NOTE: we should merge #41 before this PR actually -- I've basically rebased this onto that one, and the only change that matters here is probably the engines.node update

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.

2 participants