fix(sdk): fail the build when list-ingredients fails, instead of repacking stale - #3660
Merged
Conversation
…cking stale `start-cli s9pk list-ingredients` produces the s9pk's entire source-dependency list, `javascript/index.js` included — nothing else in s9pk.mk ties the package to its TypeScript. `$(shell)` discards exit status, so any failure left INGREDIENTS empty and detached every source file from the target's prerequisites. Make then compared the existing s9pk against its only surviving prerequisites, `.git/HEAD` and `.git/index`, found it newer, and declared it up to date — while the arch/% recipe still printed "Build Complete" and exited 0. The build therefore shipped a package without the changes just made to it, with nothing to indicate anything was wrong. The window is the ordinary inner loop: edit a source file and rebuild without touching git in between. Touch git first and the s9pk is genuinely out of date, so it reaches pack and fails loudly instead, which is why it presents intermittently. Guard with a sentinel rather than $(.SHELLSTATUS), which is undefined on the GNU Make 3.81 macOS ships and would fire the guard on every build there. Today's trigger is #3601 — start-cli resolves the configured host even for commands that contact no server, so a workspace naming a `.local` box that is off the LAN fails every invocation. That is a separate fix; this one keeps any future failure of that command from silently producing a stale package. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…file It was listed beside the ts-rs osBindings under "don't edit generated binding files", which is wrong on both counts: nothing generates it, and this repo is where it is meant to be edited. Its "DO NOT EDIT" header speaks to package authors looking at the copy npm put in their node_modules. Following it as written would block the fix in this branch. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
dr-bonez
reviewed
Aug 12, 2026
Simplified the error message for ingredient listing failure.
dr-bonez
approved these changes
Aug 12, 2026
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.
s9pk.mkcould print✅ Build Complete!, exit 0, and leave the previous s9pk in place — omitting the changes just made to the package, with nothing to indicate anything was wrong.Cause
list-ingredientsproduces the s9pk's entire source-dependency list,./javascript/index.jsincluded. Nothing else in the file ties the package to its TypeScript.$(shell)discards exit status. When the command fails it exits 9, its stderr is swallowed by2>/dev/null, andINGREDIENTSis simply empty — so:javascript/index.jsis orphaned from the graph entirely, so its own rule (which does correctly depend on$(shell find startos -type f)) is never visited;.git/HEADand.git/index. If the existing s9pk is newer than both, make declares it up to date;arch/%has no file behind it, so its recipe runs regardless and prints the success banner.Reproduced with source at
09:36:01, s9pk at09:36:00,.git/indexat09:28:42:The window is the ordinary inner loop: edit a source file, rebuild, no git activity in between. Run
git addfirst and.git/indexis newer, so the target is out of date, reachespack, and fails loudly (exit 2) — which is why this presents intermittently and reads as a network problem rather than a stale build.Fix
Append a sentinel on failure and
$(error)on it. Deliberately not$(.SHELLSTATUS): it is undefined on the GNU Make 3.81 that macOS still ships, whereifneq ($(.SHELLSTATUS),0)would fire the guard on every build.Verified
Against a real package (
tor-startos) with the configured host unresolvable:list-ingredientsreturning normally,INGREDIENTSholds the clean list with no sentinel, the guard stays silent, and a touched source file correctly triggers annccrebuild (exit 0) — the very rebuild the bug was suppressing.Relationship to #3601
#3601 is today's trigger: start-cli resolves the configured host even for commands that contact no server, so a workspace naming a
.localbox that is off the LAN fails every invocation. That remains a separate fix. This one is independent — it keeps any future failure oflist-ingredientsfrom silently producing a stale package, which is the part that can ship wrong bits.🤖 Generated with Claude Code
Also here
projects/start-os/AGENTS.mdlistedprojects/start-sdk/s9pk.mkunder "don't edit generated binding files", beside the ts-rsosBindings. Nothing generates it, and this repo is where it is meant to be edited — itsDO NOT EDITheader addresses package authors reading the copy npm put in theirnode_modules. Followed as written, that line forbids the fix above.