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.
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.
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 packageFor 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.
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.
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.
Sounds good - whatever works out to be more convenient is fine!
There was a problem hiding this comment.
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 |
itowlson
left a comment
There was a problem hiding this comment.
Nice one @kate-goldenring - the registries stuff definitely provides an easier ramp for readers following the tutorial!
Signed-off-by: Kate Goldenring <kate.goldenring@fermyon.com>
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