Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wash): only generate tinygo when wit-dir present #1246

Conversation

vados-cosmonic
Copy link
Contributor

@vados-cosmonic vados-cosmonic commented Dec 27, 2023

Feature or Problem

Golang projects built by wash which have
wasm32-wasi-preview1 set as their wasm_target (in wasmcloud.toml) fail to build due to go
bindgen (i.e. wit-bindgen-go) being run on them.

While the wasmcloud ecosystem is WIT-first, it is possible to build preview1/preview2 components without WIT (i.e. with the legacy Smithy ecosystem), and projects that are built in that way should not have bindgen run on them.

This commit improves the check to use wit_world to determine whether to run go-based bindgen

Related Issues

#1241

Release Information

next

Consumer Impact

templates built with tinygo that are using legacy smithy interfaces will build when using wasm_target = "wasm32-wasi-preview1")

Testing

Unit Test(s)

Acceptance or Integration

There's a test that caught this failure -- integration_build_tinygo_actor_unsigned

Manual Verification

Verified manually

@vados-cosmonic vados-cosmonic requested a review from a team as a code owner December 27, 2023 01:32
Copy link
Contributor

@thomastaylor312 thomastaylor312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor addition here around UX

crates/wash-lib/src/build.rs Outdated Show resolved Hide resolved
@vados-cosmonic vados-cosmonic force-pushed the fix/wash/only-tinygo-generate-when-wit-dir-present branch 3 times, most recently from d349a79 to f348b70 Compare December 28, 2023 05:52
Golang projects built by wash which have
`wasm32-wasi-preview1` set as their `wasm_target` (in
`wasmcloud.toml`) fail to build due to go
bindgen (i.e. `wit-bindgen-go`) being run on them.

While the wasmcloud ecosystem is WIT-first, it is possible to build
preview1/preview2 components *without* WIT (i.e. with the legacy
Smithy ecosystem), and projects that are built in that way should not
have bindgen run on them.

This commit improves the check to use `wit_world` to determine
whether to run go-based bindgen.

Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
@vados-cosmonic vados-cosmonic force-pushed the fix/wash/only-tinygo-generate-when-wit-dir-present branch from f348b70 to 0ca54d9 Compare December 28, 2023 05:58
@vados-cosmonic vados-cosmonic merged commit e9213de into wasmCloud:main Jan 8, 2024
47 checks passed
@vados-cosmonic vados-cosmonic deleted the fix/wash/only-tinygo-generate-when-wit-dir-present branch January 8, 2024 18:56
vados-cosmonic added a commit to vados-cosmonic/wasmCloud that referenced this pull request Jan 8, 2024
This commit fixes a tiny typo that was left out of a preivous PR (wasmCloud#1246)

Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
vados-cosmonic added a commit that referenced this pull request Jan 8, 2024
This commit fixes a tiny typo that was left out of a preivous PR (#1246)

Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants