Skip to content

Commit

Permalink
Add bin directory for oak_loader (#1230)
Browse files Browse the repository at this point in the history
This change adds a binary directory for `oak_loader`.

Fixes #719
  • Loading branch information
ipetr0v authored Jul 6, 2020
1 parent 467f509 commit 8bc660c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
# Ignore downloaded temporary files, such as the trusted root CA certificates.
/downloads/

# Ignore generated binary example files
**/examples/**/bin
# Ignore generated binary files.
**/bin/

### Rust ###
# Generated by Cargo
Expand Down
6 changes: 5 additions & 1 deletion scripts/build_server
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ Build the specified version of the Oak Runtime server.
esac
done

cargo build "${cargo_build_flags[@]}" --manifest-path=oak/server/rust/oak_loader/Cargo.toml
rm -rf "${SERVER_BIN_DIR:?}"
mkdir --parents "${SERVER_BIN_DIR}"
# `--out-dir` is unstable and requires `-Z unstable-options`.
cargo build "${cargo_build_flags[@]}" --manifest-path=oak/server/rust/oak_loader/Cargo.toml \
--out-dir="${SERVER_BIN_DIR}" -Z unstable-options
1 change: 1 addition & 0 deletions scripts/common
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ readonly DOCKER_IMAGE_NAME='gcr.io/oak-ci/oak'
readonly SERVER_DOCKER_IMAGE_NAME='gcr.io/oak-ci/oak-server'

readonly CACHE_DIR='bazel-cache'
readonly SERVER_BIN_DIR="${PWD}/oak/server/bin"

# List all workspaces.
declare -ar ALL_CRATES=("oak_utils" "oak_abi" "oak/server" "sdk" "examples" "runner" "experimental")
Expand Down
4 changes: 1 addition & 3 deletions scripts/run_server
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,4 @@ 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.
exec cargo run "${cargo_build_flags[@]}" --manifest-path=oak/server/rust/oak_loader/Cargo.toml -- \
--application="${APPLICATION_FILE}" \
"${additional_args[@]}"
exec "${SERVER_BIN_DIR}/oak_loader" --application="${APPLICATION_FILE}" "${additional_args[@]}"

0 comments on commit 8bc660c

Please sign in to comment.