Skip to content

Commit 0bb8b9c

Browse files
author
Thomas Hebb
committed
Create overarching Cargo workspace
This makes it easier for engineers unfamiliar with the project to see where all the crates live and prevents lots of nested target/ and Cargo.lock files from cluttering up the tree. It's perhaps not as useful as for other projects, since optee-utee still needs to be built via Xargo, which means "cargo build" from the root can't build everything. But the other benefits still apply. I had to rename the "systest" crates inside optee-teec and optee-utee so their names don't conflict. I also didn't include examples in the workspace yet, since every example currently has the same three crate names, meaning multiple can't coexist in one workspace. Also, the example Makefiles and tests/ scripts hardcode per-example target/ dirs. If we did add the examples to the workspace, we could build all of them much faster since they'd share a dependency graph. Doing that is just out of scope of this commit.
1 parent 56210a5 commit 0bb8b9c

6 files changed

Lines changed: 47 additions & 10 deletions

File tree

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
/optee-utee/Cargo.lock
19-
/optee-teec/Cargo.lock
18+
/Cargo.lock
2019
/examples/**/proto/Cargo.lock
2120
*.rs.bk
2221
.user_ta_header.o.d

Cargo.toml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
[workspace]
19+
# The -sys and macros crates would included in the workspace transitively even
20+
# if not listed, but list them anyway for completeness.
21+
members = [
22+
"optee-teec",
23+
"optee-teec/macros",
24+
"optee-teec/optee-teec-sys",
25+
"optee-teec/systest",
26+
"optee-utee",
27+
"optee-utee/macros",
28+
"optee-utee/optee-utee-sys",
29+
"optee-utee/systest",
30+
]
31+
32+
# Don't try to build crates requiring Xargo on a workspace-level "cargo build",
33+
# since they'll just fail.
34+
default-members = [
35+
"optee-teec",
36+
"optee-teec/systest",
37+
]
38+
39+
exclude = [
40+
# OP-TEE contains no Rust code, but exclude it in case future versions do.
41+
"optee",
42+
"rust",
43+
"examples",
44+
]

optee-teec/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,3 @@ optee-teec-macros = { path = "macros" }
3030
libc = "0.2"
3131
uuid = "0.7"
3232
hex = "0.3"
33-
34-
[workspace]
35-
members = ['systest']

optee-teec/systest/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# under the License.
1717

1818
[package]
19-
name = "systest"
19+
name = "optee-teec-systest"
2020
version = "0.2.0"
2121
authors = ["Teaclave Contributors <dev@teaclave.apache.org>"]
2222
license = "Apache-2.0"

optee-utee/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,3 @@ libc = { path = "../rust/libc", version = "=0.2.99" }
3131
bitflags = "=1.0.4"
3232
uuid = { version = "0.8", default-features = false }
3333
hex = "0.3"
34-
35-
[workspace]
36-
members = ['systest']

optee-utee/systest/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# under the License.
1717

1818
[package]
19-
name = "systest"
19+
name = "optee-utee-systest"
2020
version = "0.2.0"
2121
authors = ["Teaclave Contributors <dev@teaclave.apache.org>"]
2222
license = "Apache-2.0"

0 commit comments

Comments
 (0)