Skip to content

Commit

Permalink
scripts: use Bazel-built version of Rust oak_loader
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddrysdale committed May 1, 2020
1 parent fe2920a commit 210911e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
23 changes: 10 additions & 13 deletions scripts/build_server
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Build the specified version of the Oak Runtime server.
logless)
config='clang-logless';;
rust)
config='rust';;
config='clang';;
arm)
config='armv8';;
asan)
Expand All @@ -49,16 +49,13 @@ if [[ "${config}" == "clang" && "${OSTYPE}" == "darwin"* ]]; then
config='darwin'
fi

if [[ "${config}" == "rust" ]]; then
cargo build --release --target=x86_64-unknown-linux-musl --package=oak_loader
else
bazel_build_flags+=(
"--config=${config}"
)
bazel_build_flags+=(
"--config=${config}"
)

# Use a different output_base so that we don't lose incremental state.
# See https://docs.bazel.build/versions/master/command-line-reference.html#flag--output_base.
bazel --output_base="${CACHE_DIR}/$config" build "${bazel_build_flags[@]}" \
//oak/server/loader:oak_runner \
//oak/server/storage:storage_server
fi
# Use a different output_base so that we don't lose incremental state.
# See https://docs.bazel.build/versions/master/command-line-reference.html#flag--output_base.
bazel --output_base="${CACHE_DIR}/$config" build "${bazel_build_flags[@]}" \
//oak/server/loader:oak_runner \
//oak/server/rust/oak_loader \
//oak/server/storage:storage_server
2 changes: 1 addition & 1 deletion scripts/run_server
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fi
# Launching the server requires a `--application=<dir>/config.bin` flag.
# `exec` is necessary for the `run_example` script to be able to get a PID of a background server.
if [[ "${server}" == "rust" ]]; then
exec cargo run --release --target=x86_64-unknown-linux-musl --package=oak_loader -- \
exec ./bazel-clang-bin/oak/server/rust/oak_loader/oak_loader \
--application="${APPLICATION}" \
--ca-cert="${SCRIPTS_DIR}/../examples/certs/local/ca.pem" \
--cert-chain="${SCRIPTS_DIR}/../examples/certs/local/local.pem" \
Expand Down

0 comments on commit 210911e

Please sign in to comment.