Skip to content

Commit

Permalink
🔧 Better usage of cargo workspace
Browse files Browse the repository at this point in the history
prep work to publish on crates.io
  • Loading branch information
BertrandD committed Feb 26, 2025
1 parent 1bb36c1 commit 0694630
Show file tree
Hide file tree
Showing 15 changed files with 115 additions and 118 deletions.
100 changes: 50 additions & 50 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 29 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ repository = "https://github.com/Hyle-org/hyle/"
rust-version = "1.84"
# licence = ""

[workspace.dependencies]
bonsai-runner = { version = "0.12.0", default-features = false, path = "crates/bonsai-runner", package = "hyle-bonsai-runner" }
sdk = { version = "0.12.0", default-features = false, path = "crates/contract-sdk", package = "hyle-contract-sdk" }
hyle-contract-sdk = { version = "0.12.0", default-features = false, path = "crates/contract-sdk", package = "hyle-contract-sdk" }
client-sdk = { version = "0.12.0", default-features = false, path = "crates/client-sdk", package = "hyle-client-sdk" }
hyle-contracts = { version = "0.12.0", default-features = false, path = "crates/contracts", package = "hyle-contracts" }
hyle-model = { version = "0.12.0", default-features = false, path = "crates/hyle-model", package = "hyle-model" }
hyle-verifiers = { version = "0.12.0", default-features = false, path = "crates/hyle-verifiers", package = "hyle-verifiers" }
risc0-recursion = { version = "0.12.0", default-features = false, path = "crates/contracts/risc0-recursion", package = "risc0-recursion" }
hydentity = { version = "0.12.0", default-features = false, path = "crates/contracts/hydentity", package = "hydentity" }
hyllar = { version = "0.12.0", default-features = false, path = "crates/contracts/hyllar", package = "hyllar" }
staking = { version = "0.12.0", default-features = false, path = "crates/contracts/staking", package = "staking" }
amm = { version = "0.12.0", default-features = false, path = "crates/contracts/amm", package = "amm" }
uuid-tld = { version = "0.12.0", default-features = false, path = "crates/contracts/uuid-tld", package = "uuid-tld" }

[package]
name = "hyle"
version = { workspace = true }
Expand All @@ -58,26 +73,25 @@ indexing_slicing = "warn"

[dependencies]
# Public dependencies
hyle-contract-sdk = { path = "./crates/contract-sdk", default-features = false, features = [
hyle-contract-sdk = { workspace = true, default-features = false, features = [
"tracing",
] }
staking = { path = "./crates/contracts/staking", default-features = false, features = [
staking = { workspace = true, default-features = false, features = [
"client",
] }
client-sdk = { path = "./crates/client-sdk", default-features = false, features = [
"rest",
client-sdk = { workspace = true, features = [
"rest",
"tcp",
"indexer"
] }
hyle-model = { path = "./crates/hyle-model", default-features = false, features = [
hyle-model = { workspace = true, default-features = false, features = [
"full",
"sqlx",
] }
hydentity = { path = "./crates/contracts/hydentity", features = ["client"] }
hyllar = { path = "./crates/contracts/hyllar", features = ["client"] }
risc0-recursion = { path = "./crates/contracts/risc0-recursion" }

hyle-verifiers = { path = "crates/hyle-verifiers" }
hydentity = { workspace = true, features = ["client"] }
hyllar = { workspace = true, features = ["client"] }
risc0-recursion = { workspace = true }
hyle-verifiers = { workspace = true }


anyhow = "1.0.96"
Expand All @@ -100,7 +114,7 @@ bytes = { version = "1.10.0" }
clap = { version = "4.5.31", features = ["derive"] }
config = { version = "=0.15.0", default-features = false, features = ["ron"] }
futures = { version = "0.3.31" }
hyle-contracts = { path = "./crates/contracts", package = "hyle-contracts" }
hyle-contracts = { workspace = true }
indexmap = { version = "2.7.1", features = ["serde"] }
# opentelemetry and axum-otel-metrics must be updated together (so that there is only one opentelemetry version)
opentelemetry = { version = "0.28" }
Expand Down Expand Up @@ -135,9 +149,9 @@ utoipa-axum = { version = "0.2.0" }
testcontainers-modules = { version = "0.11.6", features = ["postgres"] }

[dev-dependencies]
amm = { path = "./crates/contracts/amm", features = ["client"] }
uuid-tld = { path = "./crates/contracts/uuid-tld", features = ["client"] }
client-sdk = { path = "./crates/client-sdk", default-features = false, features = [
amm = { workspace = true, features = ["client"] }
uuid-tld = { workspace = true, features = ["client"] }
client-sdk = { workspace = true, default-features = false, features = [
"rest",
"tcp",
"risc0",
Expand All @@ -155,7 +169,7 @@ test-log = { version = "0.2.17", features = [
tokio-stream = "0.1.17"
tempfile = "3.17.1"
assert-json-diff = "2.0.2"
risc0-recursion = { path = "./crates/contracts/risc0-recursion" }
risc0-recursion = { workspace = true }
risc0-zkvm = { version = "1.2.4", default-features = false, features = [
"client",
] }
Expand Down
2 changes: 1 addition & 1 deletion crates/bonsai-runner/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "bonsai-runner"
name = "hyle-bonsai-runner"
version = { workspace = true }
edition = { workspace = true }
# license = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/bonsai-runner/src/bin/bonsai-runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async fn prove_handler(
}

// Appeler la fonction `run_bonsai`
let receipt = bonsai_runner::run_bonsai(&payload.elf, payload.input_data)
let receipt = hyle_bonsai_runner::run_bonsai(&payload.elf, payload.input_data)
.await
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;

Expand Down
6 changes: 3 additions & 3 deletions crates/client-sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "client-sdk"
name = "hyle-client-sdk"
version = { workspace = true }
edition = { workspace = true }
# license = { workspace = true }
Expand All @@ -8,7 +8,7 @@ repository = { workspace = true }
rust-version = { workspace = true }

[dependencies]
sdk = { path = "../contract-sdk", package = "hyle-contract-sdk", default-features = false, features = [
sdk = { workspace = true, default-features = false, features = [
"full-model",
] }
anyhow = "1.0.96"
Expand All @@ -17,7 +17,7 @@ serde = "1.0"
serde_json = { version = "1" }
tracing = "0.1"

bonsai-runner = { path = "../bonsai-runner", optional = true }
bonsai-runner = { workspace = true, optional = true }
risc0-zkvm = { version = "1.2.4", default-features = false, optional = true }
sp1-sdk = { version = "4.1.1", default-features = false, optional = true }
bincode = { version = "1.3.3", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions crates/contract-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = { workspace = true }
rust-version = "1.81"

[dependencies]
hyle_model = { path = "../hyle-model", package = "hyle-model", default-features = false }
hyle-model = { workspace = true, default-features = false }
serde = { version = "1.0", default-features = false, features = [
"derive",
"alloc",
Expand All @@ -26,4 +26,4 @@ mockall = "0.13.0"
risc0 = ["dep:risc0-zkvm"]
sp1 = ["dep:sp1-zkvm"]
tracing = ["dep:tracing"]
full-model = ["hyle_model/full"]
full-model = ["hyle-model/full"]
2 changes: 1 addition & 1 deletion crates/contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ rust-version = "1.81"
path = "metadata.rs"

[dependencies]
sdk = { path = "../contract-sdk", package = "hyle-contract-sdk" }
sdk = { workspace = true }

[build-dependencies]
risc0-build = { version = "2.0.0", optional = true }
Expand Down
8 changes: 3 additions & 5 deletions crates/contracts/amm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ required-features = ["risc0"]
test = false

[dependencies]
sdk = { path = "../../contract-sdk", package = "hyle-contract-sdk" }
sdk = { workspace = true }
serde = { version = "1.0", default-features = false, features = [
"derive",
"alloc",
Expand All @@ -24,11 +24,9 @@ borsh = { version = "1.5.5", features = ["derive"] }
risc0-zkvm = { version = "1.2.4", default-features = false, optional = true, features = [
'std',
] }
client_sdk = { path = "../../client-sdk", package = "client-sdk", features = [
"risc0",
], optional = true }
client-sdk = { workspace = true, features = ["risc0"], optional = true }

[features]
default = []
client = ["dep:client_sdk"]
client = ["dep:client-sdk"]
risc0 = ["dep:risc0-zkvm", "sdk/risc0"]
Loading

0 comments on commit 0694630

Please sign in to comment.