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

refactor(provider-wit-bindgen): macro crate structure #1305

Conversation

vados-cosmonic
Copy link
Contributor

Feature or Problem

Up until now, dependencies that were exercised by
wasmcloud-wit-provider-bindgen were required of the downstream binaries that were being used.

To make it easier for people to build providers (as they might be surprised by dependencies introduced by the macro), and encourage consistency in the dependencies used, we want to internalize the dependencies that the macro introduces (i.e. hanging them off the macro crate).

Given that Rust has a limitation where macro crates cannot have any other exports, we must create an "umbrella" crate which hosts the macro along with other dependencies, and use that.

This commit modifies the macro crate structure, renaming out wasmcloud-provider-wit-bindgen
to wasmcloud-provider-wit-bindgen-macro, and keeping wasmcloud-provider-wit-bindgen as the top level macro without breaking backwards compatibility.

This commit does not internalize the deps, it only goes as far as to make the structure where it is possible.

Related Issues

Release Information

Consumer Impact

Testing

Unit Test(s)

Acceptance or Integration

Manual Verification

@vados-cosmonic vados-cosmonic marked this pull request as ready for review January 12, 2024 15:22
@vados-cosmonic vados-cosmonic requested review from a team as code owners January 12, 2024 15:22
Copy link
Member

@brooksmtownsend brooksmtownsend left a comment

Choose a reason for hiding this comment

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

Woo macros

Up until now, dependencies that were exercised by
`wasmcloud-wit-provider-bindgen` were required of the downstream
binaries that were being used.

To make it easier for people to build providers (as they might be
surprised by dependencies introduced by the macro), and encourage
consistency in the dependencies used, we want to internalize the
dependencies that the macro introduces (i.e. hanging them off the
macro crate).

Given that Rust has a limitation where macro crates cannot have any
other exports, we must create an "umbrella" crate which hosts the
macro along with other dependencies, and use *that*.

This commit modifies the macro crate structure, renaming out
`wasmcloud-provider-wit-bindgen`
to `wasmcloud-provider-wit-bindgen-macro`, and keeping
`wasmcloud-provider-wit-bindgen` as the top level macro without breaking backwards compatibility.

This commit does not *internalize* the deps, it only goes as far as to
make the structure where it is possible.

Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
@vados-cosmonic vados-cosmonic force-pushed the feat/provider-wit-bindgen/create-umbrella-macro-package branch from f4eb48b to d4973f9 Compare January 16, 2024 11:42
@vados-cosmonic vados-cosmonic merged commit ab1ccd5 into wasmCloud:main Jan 17, 2024
47 checks passed
@vados-cosmonic vados-cosmonic deleted the feat/provider-wit-bindgen/create-umbrella-macro-package branch January 17, 2024 11:45
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

2 participants