Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
feat: generate golang code during wash build
Browse files Browse the repository at this point in the history
Components-first golang actors require that `go generate` be run, with
wit-bindgen as the directive. While this is easy to do, it makes the
build workflow (i.e. calling `wash build`) require more steps.

This commit adds support for running the golang wit-bindgen
functionality as a part of `wash build`, so that users don't have to
call wit-bindgen themselves, or add stanzas for generate to their
code.

In the future, examples can be created that assume that the
'generated' folder is present, and import code as necssary.

Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
  • Loading branch information
vados-cosmonic authored and connorsmith256 committed Oct 27, 2023
1 parent bc02af8 commit 17bb1aa
Show file tree
Hide file tree
Showing 4 changed files with 304 additions and 72 deletions.
100 changes: 57 additions & 43 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ wasmcloud-control-interface = { workspace = true }
wasmcloud-test-util = { workspace = true }
weld-codegen = { workspace = true }
which = { workspace = true }
wit-bindgen-core = { workspace = true }
wit-bindgen-go = { workspace = true }

[dev-dependencies]
assert-json-diff = { workspace = true }
Expand Down Expand Up @@ -162,5 +164,7 @@ wasmparser = "0.115.0"
wat = "1.0.77"
weld-codegen = "0.7.0"
which = "4.4.0"
wit-component = "0.14"
wit-parser = "0.11"
wit-bindgen-core = "0.13.0"
wit-bindgen-go = "0.13.0"
wit-component = "0.16"
wit-parser = "0.12.1"
2 changes: 2 additions & 0 deletions crates/wash-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ wasmcloud-component-adapters = { workspace = true }
wasmcloud-control-interface = { workspace = true }
wat = { workspace = true }
weld-codegen = { workspace = true }
wit-bindgen-core = { workspace = true }
wit-bindgen-go = { workspace = true }
wit-component = { workspace = true }
wit-parser = { workspace = true }

Expand Down
Loading

0 comments on commit 17bb1aa

Please sign in to comment.