support combining SDKs with multiple WIT worlds#35
support combining SDKs with multiple WIT worlds#35dicej wants to merge 1 commit intobytecodealliance:mainfrom
Conversation
Per bytecodealliance/componentize-go#35, Spin applications can now refer to WIT files by way of the `github.com/spinframework/spin-go-sdk/v3` source package; no need for the application to supply them itself. That PR also allows us to pass multiple `--world` flags to `componentize-go`, allowing us to target e.g. the `fermyon:spin/redis-trigger` _and_ `spin:up/platform` worlds at the same time (which is what Spin actually implements for Redis triggers). Signed-off-by: Joel Dice <joel.dice@akamai.com>
Per bytecodealliance/componentize-go#35, Spin applications can now refer to WIT files by way of the `github.com/spinframework/spin-go-sdk/v3` source package; no need for the application to supply them itself. That PR also allows us to pass multiple `--world` flags to `componentize-go`, allowing us to target e.g. the `fermyon:spin/redis-trigger` _and_ `spin:up/platform` worlds at the same time (which is what Spin actually implements for Redis triggers). Signed-off-by: Joel Dice <joel.dice@akamai.com>
Per bytecodealliance/componentize-go#35, Spin applications can now refer to WIT files by way of the `github.com/spinframework/spin-go-sdk/v3` source package; no need for the application to supply them itself. That PR also allows us to pass multiple `--world` flags to `componentize-go`, allowing us to target e.g. the `fermyon:spin/redis-trigger` _and_ `spin:up/platform` worlds at the same time (which is what Spin actually implements for Redis triggers). Signed-off-by: Joel Dice <joel.dice@akamai.com>
|
Thanks for this Joel! I'm wondering if you might be open to having componentize-go automatically scan the go.mod dependencies for a |
Yeah, I was just thinking the same thing now that I've read up more on what |
|
I was planning on finishing that PR when I got back from Europe; however, if you have the bandwidth to incorporate the go.mod search feature into this PR, I won't be offended 😄 |
|
I'll give that a shot today. |
|
@asteurer I just pushed an update. My version doesn't look at |
This adds two new features: - Multiple `--world` options are accepted, in which case the worlds will be merged into a single world for building, testing, or bindings generation. - In addition to any worlds and/or WIT paths specified explicitly via CLI options, `componentize-go` will use `go list` to scan the current module and its dependencies, looking for files named `componentize-go.toml` in their source trees. For each such file found, any worlds and/or WIT paths referenced therein will be added to the respective lists. This behavior can be disabled using the `--ignore-toml-files` option if desired. In combination, these options make it easier to use multiple SDKs or other libraries which contain `wit-bindgen-go`-generated code. Note that I've also removed the `wat` dependency because `go build` always generates a binary Wasm file, so no need to check for or parse WAT. Fixes bytecodealliance#28
This adds two new features:
Multiple
--worldoptions are accepted, in which case the worlds will bemerged into a single world for building, testing, or bindings generation.
In addition to any worlds and/or WIT paths specified explicitly via CLI
options,
componentize-gowill usego listto scan the current module andits dependencies, looking for files named
componentize-go.tomlin theirsource trees. For each such file found, any worlds and/or WIT paths
referenced therein will be added to the respective lists. This behavior can
be disabled using the
--ignore-toml-filesoption if desired.In combination, these options make it easier to use multiple SDKs or other
libraries which contain
wit-bindgen-go-generated code.Note that I've also removed the
watdependency becausego buildalwaysgenerates a binary Wasm file, so no need to check for or parse WAT.
Fixes #28