Skip to content

refactor(compiler): extract emitted-spec? from write-packages! and emit-frame! - #1090

Merged
mparrett merged 1 commit into
mainfrom
wt/emitted-spec
Oct 28, 2026
Merged

mparrett merged 1 commit into
mainfrom
wt/emitted-spec

Conversation

@mparrett

Copy link
Copy Markdown
Collaborator

#1082 happened because emit-frame! decided which packages to import with its own copy of the condition write-packages! uses to decide which packages to write, and the two copies disagreed. #1083 fixed the copy, and the review suggested one predicate so they can't drift again.

emitted-spec? is that predicate. write-packages! writes a package exactly when it holds, and emit-frame! imports exactly those packages. The skip branch stays first in write-packages!'s cond, so its "skipped" message for a namespace with no lowerable defns is unchanged.

Verification

🤖 Generated with Claude Code

@mparrett
mparrett requested a review from nooga October 22, 2026 03:56

@mparrett mparrett left a comment •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Self-check. No actionable findings.

The extraction preserves write-packages!'s skipped-input diagnostic and emission/failure behavior, while emit-frame! now uses the exact same emitted-spec? predicate for its imports. I checked the surrounding compile-program flow and the existing regression coverage.

Validation at 9a710d0: make build and smoke checks passed; TestLgCompileCommand passed all five subtests, including the data-only input case (which verifies the skipped package is not imported and that runtime initialization still runs); make check-generated-manifest passed. Existing CI is green, including generated artifacts and gogen-diff.

@nooga nooga left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Approving. One predicate for both callers removes the #1082 drift risk. GitHub flags this CONFLICTING but it merges cleanly against current main.

…ages! and emit-frame!

emit-frame! re-derived write-packages!'s condition for writing a
package, and #1082 came from the two disagreeing. emitted-spec? is now
the one definition both use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mparrett
mparrett merged commit 58cb81e into main Oct 28, 2026
21 checks passed
@mparrett
mparrett deleted the wt/emitted-spec branch October 28, 2026 06:37
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