-
Notifications
You must be signed in to change notification settings - Fork 260
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
Templates: add a Rust template for non-trigger components #2970
base: main
Are you sure you want to change the base?
Conversation
This new template makes it easy to create a component that can be used as a dependency in another component. Until now, that required fully manually setting up a component and adding it to the Spin manifest, etc. Signed-off-by: Till Schneidereit <[email protected]>
@@ -0,0 +1,6 @@ | |||
[component.{{project-name | kebab_case}}] | |||
source = "{{ output-path }}/target/wasm32-wasip2/release/{{project-name | snake_case}}.wasm" |
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.
We use wasip1 everywhere else - is p2 stable enough that we should be moving to it?
@@ -0,0 +1,13 @@ | |||
spin_manifest_version = 2 |
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.
It feels extremely awkward to create a spin.toml
for a library component. Why does a dependency need a Spin manifest file? It can't be referenced by a trigger. It can't be referenced by its component ID (although we could allow that of course). Most of its settings are misleading e.g. setting allowed outbound hosts looks like it grants access but actually does nothing. Is this just to opt it into getting included spin build
?
I feel like the ask here is for the manifest to provide for building and referencing library components but I am not sold that mixing them in with "application" components is the way to go right now: perhaps we should step back and ask how we should represent library components in the manifest, then create a template as part of that?
@@ -0,0 +1,12 @@ | |||
manifest_version = "1" | |||
id = "component-rust" | |||
description = "Pure Rust component to be used as a dependency for other component" |
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.
Remove "pure" e.g.
description = "Pure Rust component to be used as a dependency for other component" | |
description = "Library (dependency) component using Rust" |
or something like that?
authors = ["{{authors}}"] | ||
description = "{{project-description}}" | ||
version = "0.1.0" | ||
rust-version = "1.78" |
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.
What is the status of the wasm32-wasip2 target in 1.78?
This new template makes it easy to create a component that can be used as a dependency in another component. Until now, that required fully manually setting up a component and adding it to the Spin manifest, etc.