-
Notifications
You must be signed in to change notification settings - Fork 63
Update rust guide and tutorial examples to use registries for WITs #251
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
Update rust guide and tutorial examples to use registries for WITs #251
Conversation
This is awesome, going to take a deeper look first thing tomorrow. |
[package.metadata.component.target] | ||
path = "../wit/adder" | ||
world = "adder" | ||
package = "docs:adder" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really slick now!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed! I've sometimes been accused of being too verbose, but what do you all think about a comment line near this explaining how this works?
A small blurb (or even a link) to let people know that BCA packages are automatically pullable from a known registry (which is recognized by/built into I see that we have the cargo component
), and maybe a link to docs and/or the OCI repo.registry
key in here which should make things a bit easier to figure out!
Heavily commented configuration files are often an underrated entry point for understanding how things work IMO, and explaining a little bit of the magic here would be nice.
[EDIT] How about leaving the world
in here? IMO it's nice to be overly explicit -- while single-world WIT interfaces can have their world auto-selected, I personally prefer people thinking about this actively up until they optimize that away (and only people who care about absolutely minimal configuration files will do that anyway).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there may be a bug in cargo-componen because when i add a world to reference, i get this error:
error: failed to create a target world for package `adder` (/Users/kagold/Programs/component-docs/component-model/examples/tutorial/adder/Cargo.toml)
Caused by:
0: failed to select world from target package `docs:adder`
1: no world named `adder` in package
For now, i'll leave the world out but ill file an issue with cargo-component
[package.metadata.component.target] | ||
path = "../wit/adder" | ||
world = "adder" | ||
package = "docs:adder" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have another example (or text) which shows people how to use a local WIT file? I am cautious lest the second thing they do is "ooh let me try this with my own interface" and bam, they're lost.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add in docs on that or we can have the calculator
component take the local filesystem approach. Maybe both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good - whatever works out to be more convenient is fine!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To both example implementations I added local and registry options to the Cargo.toml and in the Rust doc I added a note on how to use local files instead
a809649
to
8316393
Compare
@itowlson @vados-cosmonic this is ready for another review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one @kate-goldenring - the registries stuff definitely provides an easier ramp for readers following the tutorial!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Signed-off-by: Kate Goldenring <[email protected]>
8316393
to
7ea483e
Compare
The adder and calculator worlds are now published to GHCR. This updates the Rust docs to use those WITs from GHCR.
@vados-cosmonic @mkatychev this should help make the Rust guide experience smoother