Allow linking against wasmtime's minimal build#272
Allow linking against wasmtime's minimal build#272alexcrichton merged 1 commit intobytecodealliance:mainfrom
Conversation
|
Thanks for the PR! This is something that I'm not personally very well versed in with the Go ecosystem, however, so I'm a bit hesitant about this. Some concerns I have are:
|
I opened #273 for just that part.
I think we'll need the v43 release of wasmtime to come out first, since the gc_support setter is needed to be able to exercise the minimal build. But I can add the test coverage to this PR after that's out.
What do you think if we keep the .go files split as in the current PR, but instead of gating them on the corresponding feature, we just gate them on a single I originally thought per-feature tags would be nice in case anyone wants to use a custom compiled wasmtime binary that's somewhere in between minimal and full, but if someone is doing that, they already would need a more complex build script and can use other techniques than Go build tags to control it: for example, their build script could just delete the unwanted .go files from the |
|
This PR is now not mergeable. I'd like to do some cleanup on it first, but it now has test coverage. |
|
Do you know if there's any way for cgo in Go to feed into the build process at all? For example can a
While this doesn't literally contain an english-language double-negative it still effectively does the same thing where turning on a feature disables functionality, as opposed to the other way around. That makes this not composable with other features/dependencies, for example. Given Go's build system I don't think there's really a way around this, however. One way might be to just go ahead and separate the files and make it easier for forks to delete files and swap in separate libraries? Not that that's a great solution... W.r.t. #273 one of the worries I have about that is that this repository's releases are already massive with hundreds of MBs of artifacts. Merging that would increase the size even further since there's yet-more artifacts. Personally I feel that this is more-or-less a situation that the combination of Go & C is not well-equipped to handle. I don't know how other Go libraries handle something like this, though. |
That works for me. For my application, it's no problem at all for my app's build script to download the min binary to replace the full one and to delete the unwanted .go files from its local vendor directory. I updated the PR to only separate the files, and then made test.sh perform a similar flow to how an application would use it. The test.sh script can certainly be cleaned up to be made much nicer, but before I proceed with that, does this approach address your concerns? |
5e361e3 to
771231e
Compare
…'s minimal build (bytecodealliance#272) Co-authored-by: Cursor Agent <cursoragent@cursor.com>
|
This is ready for another review.
I don't. So this PR instead just splits the files and leaves it to the application to delete unwanted files. The test shows this now.
This PR now has the test downloading the minimal build artifact during test execution without it needing to be committed to this repo. |
|
Oh yeah wow this looks great, thanks for this! Everything here looks good to me so I'm going to go ahead and merge, thanks again for working with me on this! |
Wasmtime releases include precompiled "full" and "min" binaries. I'd like to create a Go application that uses the min binary. My main obstacle to this is that the Go source files call C functions that don't exist in the min binary, causing compilation to fail during linking.
This PR splits those Go functions out into separate files that are gated behind build tags.