Skip to content

Commit

Permalink
Build oak_restricted_kernel crate for bare metal with Bazel.
Browse files Browse the repository at this point in the history
BUG: 334871992
Change-Id: I423c42502d2bded16298216fed4e120e99a9890c
  • Loading branch information
ernoc committed Jun 19, 2024
1 parent 59f284d commit cc7e0fe
Show file tree
Hide file tree
Showing 16 changed files with 2,582 additions and 329 deletions.
8 changes: 8 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ platform(
],
)

platform(
name = "x86_64-linux",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
],
)

filegroup(
name = "clang_tidy_config",
srcs = [".clang-tidy"],
Expand Down
13 changes: 0 additions & 13 deletions Cargo.bazel.lock
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,6 @@ dependencies = [
"tonic-build",
"tower",
"uart_16550",
"virtio-drivers",
"walkdir",
"x509-cert",
"x86_64",
Expand Down Expand Up @@ -2675,17 +2674,6 @@ version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"

[[package]]
name = "virtio-drivers"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4fd50c69dad27f9d266e42be17da981cd507d6cd47077558a81c25169431392"
dependencies = [
"bitflags 2.5.0",
"log",
"zerocopy",
]

[[package]]
name = "volatile"
version = "0.4.6"
Expand Down Expand Up @@ -3025,7 +3013,6 @@ version = "0.7.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be"
dependencies = [
"byteorder",
"zerocopy-derive",
]

Expand Down
170 changes: 168 additions & 2 deletions Cargo_no_std.bazel.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
# It is not intended for manual editing.
version = 3

[[package]]
name = "acpi"
version = "5.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e248409195304021f61b39ba2628f62a45a3abf6119669d44b3399d60eabe4c3"
dependencies = [
"bit_field",
"log",
]

[[package]]
name = "aead"
version = "0.5.2"
Expand Down Expand Up @@ -37,12 +47,31 @@ dependencies = [
"subtle",
]

[[package]]
name = "aml"
version = "0.16.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4f8cba7d4260ea05671dda81029f6f718b54402a4ec926a0d9a41bdbb96b415"
dependencies = [
"bit_field",
"bitvec",
"byteorder",
"log",
"spinning_top",
]

[[package]]
name = "anyhow"
version = "1.0.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3"

[[package]]
name = "autocfg"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"

[[package]]
name = "base16ct"
version = "0.2.0"
Expand All @@ -67,6 +96,18 @@ version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"

[[package]]
name = "bitvec"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c"
dependencies = [
"funty",
"radium",
"tap",
"wyz",
]

[[package]]
name = "block-buffer"
version = "0.10.4"
Expand Down Expand Up @@ -272,8 +313,10 @@ dependencies = [
name = "direct-cargo-bazel-deps"
version = "0.0.1"
dependencies = [
"acpi",
"aead",
"aes-gcm",
"aml",
"anyhow",
"bitflags",
"bytes",
Expand All @@ -282,6 +325,7 @@ dependencies = [
"curve25519-dalek",
"ecdsa",
"getrandom",
"goblin",
"hex",
"hkdf",
"hpke",
Expand All @@ -292,6 +336,7 @@ dependencies = [
"prost",
"rand_core",
"sha2",
"virtio-drivers",
"x86_64",
"zeroize",
]
Expand Down Expand Up @@ -346,6 +391,12 @@ version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d"

[[package]]
name = "funty"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c"

[[package]]
name = "generic-array"
version = "0.14.7"
Expand Down Expand Up @@ -378,6 +429,17 @@ dependencies = [
"polyval",
]

[[package]]
name = "goblin"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47"
dependencies = [
"log",
"plain",
"scroll",
]

[[package]]
name = "group"
version = "0.13.0"
Expand Down Expand Up @@ -459,6 +521,16 @@ version = "0.2.154"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346"

[[package]]
name = "lock_api"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
dependencies = [
"autocfg",
"scopeguard",
]

[[package]]
name = "log"
version = "0.4.21"
Expand Down Expand Up @@ -502,6 +574,12 @@ dependencies = [
"spki",
]

[[package]]
name = "plain"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"

[[package]]
name = "platforms"
version = "3.4.0"
Expand Down Expand Up @@ -567,6 +645,12 @@ dependencies = [
"proc-macro2",
]

[[package]]
name = "radium"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"

[[package]]
name = "rand_core"
version = "0.6.4"
Expand Down Expand Up @@ -601,6 +685,32 @@ version = "1.0.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "092474d1a01ea8278f69e6a358998405fae5b8b963ddaeb2b0b04a128bf1dfb0"

[[package]]
name = "scopeguard"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"

[[package]]
name = "scroll"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6"
dependencies = [
"scroll_derive",
]

[[package]]
name = "scroll_derive"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f81c2fde025af7e69b1d1420531c8a8811ca898919db177141a85313b1cb932"
dependencies = [
"proc-macro2",
"quote",
"syn",
]

[[package]]
name = "sec1"
version = "0.7.3"
Expand Down Expand Up @@ -662,6 +772,15 @@ dependencies = [
"rand_core",
]

[[package]]
name = "spinning_top"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b9eb1a2f4c41445a3a0ff9abc5221c5fcd28e1f13cd7c0397706f9ac938ddb0"
dependencies = [
"lock_api",
]

[[package]]
name = "spki"
version = "0.7.3"
Expand Down Expand Up @@ -689,6 +808,12 @@ dependencies = [
"unicode-ident",
]

[[package]]
name = "tap"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"

[[package]]
name = "typenum"
version = "1.17.0"
Expand Down Expand Up @@ -717,6 +842,17 @@ version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"

[[package]]
name = "virtio-drivers"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e7f49914233c1d3b612f891e986b0c1e0e8a54d7076a0f2501a5e8a53e7054f"
dependencies = [
"bitflags",
"log",
"zerocopy",
]

[[package]]
name = "volatile"
version = "0.4.6"
Expand All @@ -729,6 +865,15 @@ version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"

[[package]]
name = "wyz"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed"
dependencies = [
"tap",
]

[[package]]
name = "x25519-dalek"
version = "2.0.1"
Expand All @@ -741,16 +886,37 @@ dependencies = [

[[package]]
name = "x86_64"
version = "0.15.1"
version = "0.14.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bc79523af8abf92fb1a970c3e086c5a343f6bcc1a0eb890f575cbb3b45743df"
checksum = "3b835097a84e4457323331ec5d6eb23d096066cbfb215d54096dcb4b2e85f500"
dependencies = [
"bit_field",
"bitflags",
"rustversion",
"volatile",
]

[[package]]
name = "zerocopy"
version = "0.7.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087"
dependencies = [
"byteorder",
"zerocopy-derive",
]

[[package]]
name = "zerocopy-derive"
version = "0.7.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b"
dependencies = [
"proc-macro2",
"quote",
"syn",
]

[[package]]
name = "zeroize"
version = "1.8.1"
Expand Down
1 change: 0 additions & 1 deletion bazel/crates/oak_crates_index.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ def oak_crates_index(cargo_lockfile, lockfile):
"tonic-build": crate.spec(version = "*"),
"tower": crate.spec(version = "*"),
"uart_16550": crate.spec(version = "*"),
"virtio-drivers": crate.spec(version = "*"),
"walkdir": crate.spec(version = "*"),
"x509-cert": crate.spec(
default_features = False,
Expand Down
Loading

0 comments on commit cc7e0fe

Please sign in to comment.