spin icon indicating copy to clipboard operation
spin copied to clipboard

Guest and host "worlds" don't align

Open rylev opened this issue 2 years ago • 6 comments

We are currently using two different sets of wit documents to define the guest's and the host's view of the spin "world". This is mainly because the guest is using an old version of wit-bindgen (which will be fixed in #1424) where the wit grammar is significantly different than the latest versions.

Ideally these two definitions would be semantically exactly the same, but alas they are not. The host definitions deal with an interface called "config" while the guests require an imported interface called "spin-config". spin-componentize has smoothed over this discrepancy, but in the future it would be ideal if we didn't have to worry about this difference at all.

rylev avatar Apr 29 '23 16:04 rylev

We've discussed this elsewhere, but the bottom line is we need to update the guest SDKs to use the latest wit-bindgen and the new WIT files, at which point we can delete the old WIT files and eliminate the misalignment.

dicej avatar May 12 '23 17:05 dicej

@rylev @dicej What are some next steps on this issue? I saw we updated wit-bindgen and there have been updates to the WIT files since May but I'm not sure those cover this issue.

michelleN avatar Jul 19 '23 22:07 michelleN

I think @rylev's recent work to update the SDKs took care of this. If he agrees, we can close it.

dicej avatar Jul 19 '23 22:07 dicej

This will be fixed when the Go SDK moves to the latest version of wit-bindgen. This is being tracked in #1630. Until then this should stay open.

rylev avatar Jul 25 '23 16:07 rylev

@rylev #1630 is closed and TinyGo SDK for mysql and pg were implemented in https://github.com/fermyon/spin/pull/1794 and https://github.com/fermyon/spin/pull/1922. Do they complete this or is there still a gap the needs work here?

jpshackelford avatar Nov 01 '23 21:11 jpshackelford

This is not quite ready to be closed. The issue is not the user facing API but rather the tooling that generates the low-level bindings allowing Go based components to communicate to the Spin host.

The Go SDK still uses a very old version of wit-bindgen and thus an old set of wit files. This is because wit-bindgen's Go support is not fully ready for the Spin 2.0.0 world, because it doesn't yet support resources. Until that lands this issue remains.

rylev avatar Nov 02 '23 08:11 rylev