Skip to content

build: bring the prebuilt addon into new worktrees - #586

Merged
colinhacks merged 1 commit into
mainfrom
worktreeinclude-addon
Jul 28, 2026
Merged

build: bring the prebuilt addon into new worktrees#586
colinhacks merged 1 commit into
mainfrom
worktreeinclude-addon

Conversation

@colinhacks

Copy link
Copy Markdown
Contributor

cargo clippy --all-targets --all-features — the pre-push gate AGENTS.md prescribes — cannot run in a fresh worktree. --all-features enables embed-runtime, whose build script hashes every runtime entrypoint and panics on the missing runtime/addons/nub-native.node:

embed-runtime: cannot read entrypoint …/runtime/addons/nub-native.node for integrity
hashing: No such file or directory (os error 2) (stage the full runtime incl.
addons/nub-native.node before the build)

The addon is gitignored, so git worktree add never brings it along and every new worktree hits this until someone stages the file by hand. It reads as a build failure on correct source, which is what makes it cost time rather than a moment.

Adding it to .worktreeinclude closes that.

Copied, not symlinked: make addon-fast writes that exact path, so a symlink would send a worktree's addon build through into the shared tree and clobber it for every sibling. A missing source is skipped by the existing loop, so a tree that has never built the addon still creates worktrees fine.

`--all-features` enables `embed-runtime`, whose build script hashes every
runtime entrypoint and panics when `runtime/addons/nub-native.node` is missing.
The file is gitignored, so a fresh worktree never has it and
`cargo clippy --all-targets --all-features` — the pre-push gate AGENTS.md
prescribes — cannot run there at all until it is staged by hand.

Copied rather than symlinked: `make addon-fast` writes that exact path, so a
symlink would send a worktree's addon build through into the shared tree and
clobber it for every sibling worktree. A missing source is skipped, so a tree
that has never built the addon still creates worktrees fine.
Copilot AI review requested due to automatic review settings July 28, 2026 18:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nub Ready Ready Preview, Comment Jul 28, 2026 6:19pm

Request Review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — a single .worktreeinclude entry so fresh worktrees carry the gitignored N-API addon that the --all-features pre-push clippy gate requires.

  • Bring runtime/addons/nub-native.node into new worktrees — adds copy runtime/addons/nub-native.node (with an explanatory comment) so cargo clippy --all-targets --all-features no longer panics in a fresh worktree on the missing embed-runtime entrypoint.

Every claim in the comment checks out against the code:

  • make addon-fast (Makefile:65-73) writes exactly runtime/addons/nub-native.node, so the copy-not-symlink rationale (a symlink would route a worktree's addon build back into the shared tree and clobber siblings) is correct.
  • applyInclude in scripts/new-worktree.ts skips a missing source (151-153), mkdirSyncs the runtime/addons/ parent before copying (160), and cpSyncs the single file (165) — so a never-built tree still creates worktrees fine and the destination dir is created as needed.

Pullfrog  | View workflow run | Using Claude Opus𝕏

@colinhacks
colinhacks merged commit cf5a8f4 into main Jul 28, 2026
30 checks passed
@colinhacks

Copy link
Copy Markdown
Contributor Author

Shipped in v0.7.0: https://github.com/nubjs/nub/releases/tag/v0.7.0

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