Skip to content

Commit

Permalink
Build oak_client with bazel
Browse files Browse the repository at this point in the history
Change-Id: Ia7289c4f2c7de54355485359dc105db858680635
  • Loading branch information
jblebrun committed May 29, 2024
1 parent bca1c73 commit 9aed297
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.bazel.lock
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ dependencies = [
"coset",
"curve25519-dalek",
"ecdsa",
"futures-util",
"getrandom",
"goblin",
"hex",
Expand Down
1 change: 1 addition & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ crates_repository(
],
version = "*",
),
"futures-util": crate.spec(version = "*"),
"getrandom": crate.spec(
version = "*",
),
Expand Down
8 changes: 7 additions & 1 deletion cargo-bazel-lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"checksum": "87666e043302a436f42f430e49d01477dc8bac0050d2afbab59f1c5e74216c93",
"checksum": "9872a2c4b34b30e31ccb5db846832f1a2642beec9fa9266f82f20c3db29bbf54",
"crates": {
"acpi 5.0.0": {
"name": "acpi",
Expand Down Expand Up @@ -4379,6 +4379,10 @@
"id": "ecdsa 0.16.9",
"target": "ecdsa"
},
{
"id": "futures-util 0.3.30",
"target": "futures_util"
},
{
"id": "getrandom 0.2.12",
"target": "getrandom"
Expand Down Expand Up @@ -5808,6 +5812,7 @@
"alloc",
"async-await",
"async-await-macro",
"default",
"futures-macro",
"futures-sink",
"sink",
Expand Down Expand Up @@ -19318,6 +19323,7 @@
"coset 0.3.7",
"curve25519-dalek 4.1.1",
"ecdsa 0.16.9",
"futures-util 0.3.30",
"getrandom 0.2.12",
"goblin 0.8.0",
"hex 0.4.3",
Expand Down
68 changes: 68 additions & 0 deletions oak_client/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#
# Copyright 2024 The Project Oak Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

load("@rules_rust//cargo:defs.bzl", "cargo_build_script")
load("@rules_rust//rust:defs.bzl", "rust_library")

package(
default_visibility = ["//visibility:public"],
licenses = ["notice"],
)

rust_library(
name = "oak_client",
srcs = [
"src/client.rs",
"src/lib.rs",
"src/transport.rs",
"src/verifier.rs",
],
proc_macro_deps = [
"@oak_crates_index//:async-trait",
],
deps = [
":build",
"//oak_attestation_verification",
"//oak_crypto",
"//oak_proto_rust",
"@oak_crates_index//:anyhow",
"@oak_crates_index//:futures-util",
"@oak_crates_index//:prost",
"@oak_crates_index//:tonic",
],
)

cargo_build_script(
name = "build",
srcs = [
"build.rs",
],
build_script_env = {
"PROTOC": "$(execpath @com_google_protobuf//:protoc)",
},
crate_features = ["bazel"],
data = [
"//proto/session:messages_proto",
"//proto/session:service_streaming_proto",
],
tools = [
"@com_google_protobuf//:protoc",
],
deps = [
"//oak_grpc_utils",
"@oak_crates_index//:prost-build",
],
)

0 comments on commit 9aed297

Please sign in to comment.