Skip to content

Commit 73044d8

Browse files
Merge pull request #2673 from fibonacci1729/component-dependencies
Implementation of Component Dependencies
2 parents 8200834 + b121199 commit 73044d8

File tree

38 files changed

+22865
-108
lines changed

38 files changed

+22865
-108
lines changed

Cargo.lock

Lines changed: 99 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/app/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ async-trait = "0.1"
1010
serde = { version = "1.0", features = ["derive"] }
1111
serde_json = "1.0"
1212
spin-locked-app = { path = "../locked-app" }
13-
spin-serde = { path = "../serde" }
1413
thiserror = "1.0"

crates/app/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ impl App {
166166
pub struct AppComponent<'a> {
167167
/// The app this component belongs to.
168168
pub app: &'a App,
169-
locked: &'a LockedComponent,
169+
/// The locked component.
170+
pub locked: &'a LockedComponent,
170171
}
171172

172173
impl<'a> AppComponent<'a> {

crates/common/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ edition = { workspace = true }
66

77
[dependencies]
88
anyhow = "1.0"
9-
dirs = "4.0"
9+
dirs = "5.0.1"
1010
sha2 = "0.10"
1111
tempfile = "3.5"
1212
tokio = { version = "1", features = ["rt", "time"] }
13-
url = "2"
13+
url = "2"

crates/compose/Cargo.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[package]
2+
name = "spin-compose"
3+
version.workspace = true
4+
authors.workspace = true
5+
edition.workspace = true
6+
license.workspace = true
7+
homepage.workspace = true
8+
repository.workspace = true
9+
rust-version.workspace = true
10+
11+
[dependencies]
12+
anyhow = { workspace = true }
13+
async-trait = "0.1"
14+
indexmap = "2.2.6"
15+
spin-app = { path = "../app" }
16+
spin-serde = { path = "../serde" }
17+
spin-componentize = { workspace = true }
18+
semver = "1"
19+
thiserror = "1"
20+
tokio = { version = "1.23", features = ["fs"] }
21+
wac-graph = "0.5.0"
22+
23+
[lints]
24+
workspace = true

crates/compose/deny-all/Cargo.toml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[package]
2+
name = "deny-all"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
wit-bindgen-rt = { version = "0.28.0", features = ["bitflags"] }
8+
9+
[lib]
10+
crate-type = ["cdylib"]
11+
12+
[profile.release]
13+
codegen-units = 1
14+
opt-level = "s"
15+
debug = false
16+
strip = true
17+
lto = true
18+
19+
[package.metadata.component]
20+
package = "fermyon:spin-virt"
21+
22+
[package.metadata.component.target]
23+
world = "deny-all"
24+
25+
[package.metadata.component.target.dependencies]
26+
"fermyon:spin" = { path = "wit/deps/fermyon/spin.wasm" }
27+
"wasi:filesystem" = { path = "wit/deps/wasi/filesystem.wasm" }
28+
"wasi:sockets" = { path = "wit/deps/wasi/sockets.wasm" }
29+
"wasi:clocks" = { path = "wit/deps/wasi/clocks.wasm" }
30+
"wasi:http" = { path = "wit/deps/wasi/http.wasm" }
31+
"wasi:cli" = { path = "wit/deps/wasi/cli.wasm" }
32+
"wasi:io" = { path = "wit/deps/wasi/io.wasm" }
33+
34+
[workspace]

crates/compose/deny-all/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
This directory contains the `deny-all` adapter used to enforce configuration isolation in dependencies when using the component dependencies feature of Spin.
2+
3+
To build:
4+
```
5+
cargo component build --release
6+
```

0 commit comments

Comments
 (0)