Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a global Cargo workspace #613

Merged
merged 5 commits into from
Feb 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@
# https://github.com/bazelbuild/bazel-gazelle/issues/609

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

# Export LICENSE file for projects that reference Oak in Bazel as an external dependency.
exports_files(["LICENSE"])

# These files are built via cargo outside of Bazel.
exports_files(srcs = glob(["target/wasm32-unknown-unknown/release/*.wasm"]))
141 changes: 141 additions & 0 deletions examples/Cargo.lock → Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[workspace]

members = [
"examples/abitest/abitest_common",
"examples/abitest/module_0/rust",
"examples/abitest/module_1/rust",
"examples/abitest/tests",
"examples/chat/module/rust",
"examples/hello_world/module/rust",
"examples/machine_learning/module/rust",
"examples/private_set_intersection/module/rust",
"examples/running_average/module/rust",
"examples/rustfmt/module/rust",
"examples/translator/common",
"examples/translator/module/rust",

"oak/server/rust/oak_abi",
"oak/server/rust/oak_runtime",

"runner",

"sdk/rust/oak",
"sdk/rust/oak_derive",
"sdk/rust/oak_log",
"sdk/rust/oak_tests",
"sdk/rust/oak_utils",
]

# Patch dependencies on oak crates so that they refer to the versions within this same repository.
#
# From https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html :
# > Cargo doesn’t assume that crates in a workspace will depend on each other, so we need to be
# > explicit about the dependency relationships between the crates.
[patch.crates-io]
# Oak.
asylo_rust = { path = "oak/asylo_rust" }
oak = { path = "sdk/rust/oak" }
oak_abi = { path = "oak/server/rust/oak_abi" }
oak_derive = { path = "sdk/rust/oak_derive" }
oak_log = { path = "sdk/rust/oak_log" }
oak_runtime = { path = "oak/server/rust/oak_runtime" }
oak_tests = { path = "sdk/rust/oak_tests" }
oak_utils = { path = "sdk/rust/oak_utils" }
runner = { path = "runner" }
ipetr0v marked this conversation as resolved.
Show resolved Hide resolved

# Examples.
abitest_common = { path = "examples/abitest/abitest_common" }
abitest_0_frontend = { path = "examples/abitest/module_0/rust" }
abitest_1_backend = { path = "examples/abitest/module_1/rust" }
abitest_tests = { path = "examples/abitest/tests" }
chat = { path = "examples/chat/module/rust" }
hello_world = { path = "examples/hello_world/module/rust" }
machine_learning = { path = "examples/machine_learning/module/rust" }
private_set_intersection = { path = "examples/private_set_intersection/module/rust" }
running_average = { path = "examples/running_average/module/rust" }
rustfmt = { path = "examples/rustfmt/module/rust" }
translator = { path = "examples/translator/module/rust" }
translator_common = { path = "examples/translator/common" }

# Third party.
expect = { path = "third_party/expect" }
grpc-compiler = { path = "third_party/grpc-rust/grpc-compiler" }
protoc-rust-grpc = { path = "third_party/grpc-rust/protoc-rust-grpc" }
rust = { path = "third_party/rust/src/libstd" }
2 changes: 1 addition & 1 deletion docs/programming-oak.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ Serialization script looks like follows:
```shell
./bazel-bin/oak/common/app_config_serializer \
--textproto=examples/hello_world/config/config.textproto \
--modules=app://examples/target/wasm32-unknown-unknown/release/hello_world.wasm \
--modules=app://target/wasm32-unknown-unknown/release/hello_world.wasm \
--output_file=config.bin"
```
<!-- prettier-ignore-end -->
Expand Down
23 changes: 0 additions & 23 deletions examples/BUILD

This file was deleted.

Loading