Skip to content

Commit

Permalink
Build oak_containers_orchestrator with bazel
Browse files Browse the repository at this point in the history
Keeping the existing build script for GRPC generation.

Fixes: 334102532

Change-Id: I19fcf240f2e62ac9f24ba6d39b5f05f3f849fe41
  • Loading branch information
jblebrun committed May 17, 2024
1 parent 93bc167 commit 4db7f08
Show file tree
Hide file tree
Showing 11 changed files with 14,670 additions and 3,864 deletions.
1,464 changes: 1,431 additions & 33 deletions Cargo.bazel.lock

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions Cargo_no_std.bazel.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,47 @@ version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"

[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"

[[package]]
name = "direct-cargo-bazel-deps"
version = "0.0.1"
dependencies = [
"anyhow",
"bitflags",
"bytes",
"getrandom",
"log",
"x86_64",
]

[[package]]
name = "getrandom"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
dependencies = [
"cfg-if",
"libc",
"wasi",
]

[[package]]
name = "libc"
version = "0.2.154"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346"

[[package]]
name = "log"
version = "0.4.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"

[[package]]
name = "rustversion"
version = "1.0.16"
Expand All @@ -48,6 +79,12 @@ version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "442887c63f2c839b346c192d047a7c87e73d0689c9157b00b53dcc27dd5ea793"

[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"

[[package]]
name = "x86_64"
version = "0.15.1"
Expand Down
95 changes: 92 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,28 @@ git_repository(
# Default crate repository - some crates may require std.
crates_repository(
name = "oak_crates_index",
annotations = {
# Provide the jemalloc library built by the library included above.
# The tikv-jemalloc-sys crate using by tikv-jemallocator uses a build script to run
# configure/make for libjemalloc. This doesn't work out of the box. The suggestion is to
# instead build libjemalloc with bazel, and then provide the generated lbirary to the
# build script.
#
# See: https://github.com/bazelbuild/rules_rust/issues/1670
# The example there didn't work exactly as written in this context, but I was able
# to modify it to get it working.
"tikv-jemalloc-sys": [crate.annotation(
build_script_data = [
"@jemalloc//:gen_dir",
],
build_script_env = {
"JEMALLOC_OVERRIDE": "$(execpath @jemalloc//:gen_dir)/lib/libjemalloc.a",
},
data = ["@jemalloc//:gen_dir"],
version = "*",
deps = ["@jemalloc"],
)],
},
cargo_lockfile = "//:Cargo.bazel.lock", # In Cargo-free mode this is used as output, not input.
lockfile = "//:cargo-bazel-lock.json", # Shares most contents with cargo_lockfile.
packages = {
Expand All @@ -390,6 +412,9 @@ crates_repository(
default_features = False,
version = "*",
),
"async-stream": crate.spec(
version = "*",
),
"arrayvec": crate.spec(
default_features = False,
version = "*",
Expand All @@ -415,6 +440,10 @@ crates_repository(
default_features = False,
version = "*",
),
"clap": crate.spec(
features = ["derive"],
version = "*",
),
"coset": crate.spec(
default_features = False,
version = "*",
Expand All @@ -436,9 +465,6 @@ crates_repository(
version = "*",
),
"getrandom": crate.spec(
default_features = False,
# rdrand is required to support x64_64-unknown-none.
features = ["rdrand"],
version = "*",
),
"goblin": crate.spec(
Expand Down Expand Up @@ -481,6 +507,27 @@ crates_repository(
default_features = False,
version = "*",
),
"nix": crate.spec(
features = ["user"],
version = "*",
),
"oci-spec": crate.spec(
version = "*",
),
"opentelemetry": crate.spec(
version = "*",
),
"opentelemetry-otlp": crate.spec(
features = ["metrics"],
version = "*",
),
"opentelemetry_sdk": crate.spec(
features = [
"metrics",
"rt-tokio",
],
version = "*",
),
"p256": crate.spec(
default_features = False,
features = [
Expand Down Expand Up @@ -508,6 +555,9 @@ crates_repository(
default_features = False,
version = "*",
),
"procfs": crate.spec(
version = "*",
),
"prost": crate.spec(
default_features = False,
features = ["prost-derive"],
Expand All @@ -516,6 +566,9 @@ crates_repository(
"prost-build": crate.spec(
version = "*",
),
"prost-types": crate.spec(
version = "*",
),
"rand_core": crate.spec(
default_features = False,
features = ["getrandom"],
Expand Down Expand Up @@ -552,6 +605,13 @@ crates_repository(
features = ["derive"],
version = "*",
),
"syslog": crate.spec(
version = "*",
),
"tar": crate.spec(
version = "*",
),
"tikv-jemallocator": crate.spec(version = "*"),
"time": crate.spec(
default_features = False,
features = [
Expand All @@ -560,8 +620,27 @@ crates_repository(
],
version = "0.3.28",
),
"tokio": crate.spec(
features = [
"rt-multi-thread",
"macros",
"sync",
"fs",
"process",
"net",
],
version = "*",
),
"tokio-stream": crate.spec(
features = ["net"],
version = "*",
),
"tokio-util": crate.spec(version = "*"),
"tonic": crate.spec(version = "*"),
"tonic-build": crate.spec(version = "*"),
"uart_16550": crate.spec(version = "*"),
"virtio-drivers": crate.spec(version = "*"),
"walkdir": crate.spec(version = "*"),
"x509-cert": crate.spec(
default_features = False,
features = ["pem"],
Expand Down Expand Up @@ -612,6 +691,16 @@ crates_repository(
package = "bitflags",
version = "*",
),
"getrandom": crate.spec(
default_features = False,
# rdrand is required to support x64_64-unknown-none.
features = ["rdrand"],
version = "0.2.12",
),
"log": crate.spec(
features = [],
version = "*",
),
"x86_64": crate.spec(version = "*"),
},
supported_platform_triples = [
Expand Down
Loading

0 comments on commit 4db7f08

Please sign in to comment.