Skip to content

Extract dependency WITs during build#3378

Open
itowlson wants to merge 1 commit intospinframework:mainfrom
itowlson:deps-extract-wit
Open

Extract dependency WITs during build#3378
itowlson wants to merge 1 commit intospinframework:mainfrom
itowlson:deps-extract-wit

Conversation

@itowlson
Copy link
Collaborator

@itowlson itowlson commented Jan 21, 2026

Fixes #3376.

WIP. Current status: 1. contains gross, gross hacks replaced with BEAUTIFUL AND ELEGANT hacks, and 2. incomplete.

Work needed:

  • Handle export
  • Test that include is handled correctly I think this works but a second tester would be very welcome
  • Unit tests (and e2e tests and examples)
  • Provide a way to invoke it outside of build (can be deferred if naming is hard, which it always is)

@itowlson
Copy link
Collaborator Author

I think include might be a non-issue because Spin dependencies are on interfaces or packages, not on worlds, and interfaces don't include as far as I can tell (only worlds do).

I do determine the exported interfaces by looking at worlds, but I believe it's safe to ignore include directives for this, because an interface can be exported through an include if there's a world that exports it, and because we iterate the worlds we will pick it up from there.

I am not sure if there is some edge case when a component exports interfaces from other packages but that seems like a potential issue regardless of include. Bother.

@itowlson itowlson force-pushed the deps-extract-wit branch 3 times, most recently from de01fea to 09cf63d Compare February 10, 2026 02:25
@fibonacci1729 fibonacci1729 moved this to Backlog in Spin 4.0 Feb 10, 2026
@itowlson itowlson force-pushed the deps-extract-wit branch 2 times, most recently from 4dbe62d to ed40fa4 Compare February 11, 2026 03:03
@itowlson itowlson marked this pull request as ready for review February 11, 2026 21:10
@fibonacci1729 fibonacci1729 self-requested a review February 25, 2026 20:06
@fibonacci1729 fibonacci1729 moved this from Backlog to In progress in Spin 4.0 Mar 2, 2026
@itowlson itowlson force-pushed the deps-extract-wit branch 2 times, most recently from ccb7fb1 to 5b800e2 Compare March 9, 2026 20:35
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
@itowlson itowlson marked this pull request as draft March 11, 2026 20:48
@itowlson
Copy link
Collaborator Author

Moving to draft until #3421 is resolved. I believe the code is in a reasonable state, but if we are reworking dependencies then some of it becomes moot or will require rework.

Copy link
Collaborator

@fibonacci1729 fibonacci1729 left a comment

Choose a reason for hiding this comment

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

This is looking good, thanks for addressing all my concerns both here and offline! Let's get this landed and iterate 🥇

@itowlson itowlson marked this pull request as ready for review March 19, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

Emit WITs during build

3 participants