Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make build directories as valid (empty) go packages. (#45)
go mod vendor will not copy the header and library directory contents not referred in any go source code. A common workaround is to add "_" imports to such directories with necessary cgo files, but doing so requires rendering such directories as valid go packages. This patch does exactly that. With this patch, one can vendor the C headers and libraries by introducing the following imports in the code using the wasmtime-go bindings. import ( _ "github.com/bytecodealliance/wasmtime-go/build/include" _ "github.com/bytecodealliance/wasmtime-go/build/linux-x86_64" _ "github.com/bytecodealliance/wasmtime-go/build/macos-x86_64" _ "github.com/bytecodealliance/wasmtime-go/build/windows-x86_64" ) Optionally, one could consider introducing these imports to the "github.com/bytecodealliance/wasmtime-go" package itself. For more information about the underlying limitation of vendoring, see for example: golang/go#26366
- Loading branch information