Skip to content

Commit

Permalink
Add bazel rule for no_std flavour of oak_functions_service
Browse files Browse the repository at this point in the history
This is half of the exercise, because we need a std build that includes
wasmtime but wasmtime is being problematic.

Bug: 349587510
Change-Id: Ia09608eb7a58240c41f647e70282e554d56cc194
  • Loading branch information
andrisaar committed Jul 5, 2024
1 parent b905b06 commit 8bd38b4
Show file tree
Hide file tree
Showing 7 changed files with 783 additions and 266 deletions.
52 changes: 8 additions & 44 deletions Cargo.bazel.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2201,12 +2201,6 @@ dependencies = [
"windows-sys 0.48.0",
]

[[package]]
name = "multi-stash"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "685a9ac4b61f4e728e1d2c6a7844609c16527aeb5e6c865915c08e619c16410f"

[[package]]
name = "multimap"
version = "0.8.3"
Expand Down Expand Up @@ -2336,17 +2330,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"

[[package]]
name = "num-derive"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.58",
]

[[package]]
name = "num-integer"
version = "0.1.46"
Expand Down Expand Up @@ -3609,16 +3592,6 @@ dependencies = [
"thread_local",
]

[[package]]
name = "string-interner"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c6a0d765f5807e98a091107bae0a56ea3799f66a5de47b2c84c94a39c09974e"
dependencies = [
"cfg-if",
"hashbrown 0.14.3",
]

[[package]]
name = "strsim"
version = "0.11.1"
Expand Down Expand Up @@ -4362,37 +4335,28 @@ dependencies = [

[[package]]
name = "wasmi"
version = "0.33.0"
version = "0.31.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d81cc42a9b7e7f4145fecc7360849438a5f4bc3e48ac3ac5edc3b5493c152d8"
checksum = "77a8281d1d660cdf54c76a3efa9ddd0c270cada1383a995db3ccb43d166456c7"
dependencies = [
"arrayvec",
"multi-stash",
"num-derive",
"num-traits",
"smallvec",
"spin 0.9.8",
"wasmi_collections",
"wasmi_arena",
"wasmi_core",
"wasmparser-nostd",
]

[[package]]
name = "wasmi_collections"
version = "0.33.0"
name = "wasmi_arena"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f6968a028db1def31d086e6b9cede39325996602750091bdb471fefe4c15a04"
dependencies = [
"ahash",
"hashbrown 0.14.3",
"string-interner",
]
checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073"

[[package]]
name = "wasmi_core"
version = "0.33.0"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fa3327fa8ff84ccc3b6670195c47bf246a831c253d10b152c41985784ab346d"
checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a"
dependencies = [
"downcast-rs",
"libm",
Expand Down
86 changes: 86 additions & 0 deletions Cargo_no_std.bazel.lock
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,17 @@ dependencies = [
"static_assertions",
"strum",
"virtio-drivers",
"wasmi",
"x86_64",
"zeroize",
]

[[package]]
name = "downcast-rs"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2"

[[package]]
name = "ecdsa"
version = "0.16.9"
Expand Down Expand Up @@ -523,6 +530,12 @@ dependencies = [
"zeroize",
]

[[package]]
name = "indexmap-nostd"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590"

[[package]]
name = "inout"
version = "0.1.3"
Expand All @@ -538,6 +551,12 @@ version = "0.2.154"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346"

[[package]]
name = "libm"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058"

[[package]]
name = "lock_api"
version = "0.4.12"
Expand All @@ -560,6 +579,15 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"

[[package]]
name = "num-traits"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
]

[[package]]
name = "opaque-debug"
version = "0.3.1"
Expand All @@ -578,6 +606,12 @@ dependencies = [
"sha2",
]

[[package]]
name = "paste"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"

[[package]]
name = "pem-rfc7468"
version = "0.7.0"
Expand Down Expand Up @@ -811,6 +845,18 @@ dependencies = [
"rand_core",
]

[[package]]
name = "smallvec"
version = "1.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"

[[package]]
name = "spin"
version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"

[[package]]
name = "spinning_top"
version = "0.2.5"
Expand Down Expand Up @@ -932,6 +978,46 @@ version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"

[[package]]
name = "wasmi"
version = "0.31.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77a8281d1d660cdf54c76a3efa9ddd0c270cada1383a995db3ccb43d166456c7"
dependencies = [
"smallvec",
"spin",
"wasmi_arena",
"wasmi_core",
"wasmparser-nostd",
]

[[package]]
name = "wasmi_arena"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073"

[[package]]
name = "wasmi_core"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a"
dependencies = [
"downcast-rs",
"libm",
"num-traits",
"paste",
]

[[package]]
name = "wasmparser-nostd"
version = "0.100.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5a015fe95f3504a94bb1462c717aae75253e39b9dd6c3fb1062c934535c64aa"
dependencies = [
"indexmap-nostd",
]

[[package]]
name = "wyz"
version = "0.5.1"
Expand Down
3 changes: 2 additions & 1 deletion bazel/crates/oak_crates_index.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@ def oak_crates_index(cargo_lockfile, lockfile):
"walkdir": crate.spec(version = "*"),
"wasmi": crate.spec(
default_features = False,
version = "*",
# same version as cargo, newer versions had compatibility issues
version = "0.31.2",
),
"wasmtime": crate.spec(version = "*"),
"which": crate.spec(version = "*"),
Expand Down
5 changes: 5 additions & 0 deletions bazel/crates/oak_no_std_crates_index.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ def oak_no_std_crates_index(cargo_lockfile, lockfile):
default_features = False,
version = "*",
),
"wasmi": crate.spec(
default_features = False,
# same version as cargo, newer versions had compatibility issues
version = "0.31.2",
),
},
supported_platform_triples = [
# Linux for dependencies of build scripts (they run on host):
Expand Down
Loading

0 comments on commit 8bd38b4

Please sign in to comment.