Skip to content

Commit

Permalink
Bazel build for hello world trusted app
Browse files Browse the repository at this point in the history
Fixed: 342280489

Change-Id: If148f83ef6ba360125f1d90b73672af9ccdb5522
  • Loading branch information
jblebrun committed May 28, 2024
1 parent 3560f26 commit 450d621
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 1 deletion.
76 changes: 76 additions & 0 deletions oak_containers_hello_world_trusted_app/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#
# 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_binary", "rust_library")

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

rust_library(
name = "lib",
srcs = [
"src/app_service.rs",
"src/lib.rs",
],
crate_name = "oak_containers_hello_world_trusted_app",
deps = [
":build",
"//oak_containers_sdk",
"//oak_crypto",
"//oak_proto_rust",
"@oak_crates_index//:anyhow",
"@oak_crates_index//:prost",
"@oak_crates_index//:prost-types",
"@oak_crates_index//:tokio",
"@oak_crates_index//:tokio-stream",
"@oak_crates_index//:tonic",
],
)

rust_binary(
name = "oak_containers_hello_world_trusted_app",
srcs = ["src/main.rs"],
deps = [
":lib",
"//oak_containers_sdk",
"@oak_crates_index//:anyhow",
"@oak_crates_index//:tokio",
],
)

cargo_build_script(
name = "build",
srcs = [
"build.rs",
],
build_script_env = {
"PROTOC": "$(execpath @com_google_protobuf//:protoc)",
},
data = [
"//oak_containers_hello_world_trusted_app/proto:interface_proto",
"//proto/crypto:crypto_proto",
],
tools = [
"@com_google_protobuf//:protoc",
],
deps = [
"//oak_grpc_utils",
"@oak_crates_index//:prost-build",
],
)
5 changes: 4 additions & 1 deletion oak_containers_hello_world_trusted_app/proto/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ load("@rules_cc//cc:defs.bzl", "cc_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")

package(
default_visibility = ["//cc/containers/hello_world_trusted_app:__subpackages__"],
default_visibility = [
"//cc/containers/hello_world_trusted_app:__subpackages__",
"//oak_containers_hello_world_trusted_app:__subpackages__",
],
licenses = ["notice"],
)

Expand Down

0 comments on commit 450d621

Please sign in to comment.