Skip to content

Commit

Permalink
Merge #3341
Browse files Browse the repository at this point in the history
3341: Make `tools/` a cargo workspace. r=hudson-ayers a=jrvanwhy

### Pull Request Overview

The root cargo workspace was created in PR #1714. #1714's description asked the question "Should `tools/` also be part of the workspace? Have their own workspace?", which doesn't appear to have been answered.

This PR makes `tools/` its own cargo workspace.

### Testing Strategy

Ran `cargo check --workspace --exclude litex-ci-runner` in `tools/` (I excluded `litex-ci-runner` as it requires a dependency I don't have installed).
Ran `cargo check` in the root of the repository.
Ran `make prepush`.

### Open Questions

Do we want to make `tools/` part of the root workspace rather than making it its own workspace? I made it a separate workspace because the compilation profiles in the root workspace are intended for embedded code, whereas `tools/` is host-side code, but I'm open to making it all one workspace. Building host-side tools with embedded profiles will make things a bit slower but shouldn't break anything (unless something relies on panic unwinding).

### Documentation Updated

- [X] Updated the relevant files in `/docs`, or no updates are required.

### Formatting

- [X] Ran `make prepush`.

Co-authored-by: Johnathan Van Why <jrvanwhy@google.com>
  • Loading branch information
bors[bot] and jrvanwhy committed Dec 5, 2022
2 parents b59ac82 + 0997f42 commit 38ece1c
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 37 deletions.
13 changes: 1 addition & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,7 @@ members = [
"libraries/tock-register-interface",
"libraries/tickv",
]
exclude = [
"tools/alert_codes",
"tools/board-runner",
"tools/qemu",
"tools/litex-ci-runner",
"tools/qemu-runner",
"tools/sha256sum",
"tools/usb/bulk-echo",
"tools/usb/bulk-echo-fast",
"tools/usb/bulk-test",
"tools/usb/control-test",
]
exclude = ["tools/"]

[workspace.package]
version = "0.1.0"
Expand Down
13 changes: 3 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,7 @@ allstack stack stack-analysis:
.PHONY: clean
clean:
@echo "$$(tput bold)Clean top-level Cargo workspace" && cargo clean
@for f in `./tools/list_tools.sh`;\
do echo "$$(tput bold)Clean tools/$$f";\
cargo clean --manifest-path "tools/$$f/Cargo.toml" || exit 1;\
done
@echo "$$(tput bold)Clean tools Cargo workspace" && cargo clean --manifest-path tools/Cargo.toml
@echo "$$(tput bold)Clean rustdoc" && rm -rf doc/rustdoc
@echo "$$(tput bold)Clean ci-artifacts" && rm -rf tools/ci-artifacts

Expand Down Expand Up @@ -477,12 +474,8 @@ ci-setup-tools:

define ci_job_tools
$(call banner,CI-Job: Tools)
@for tool in `./tools/list_tools.sh`;\
do echo "$$(tput bold)Build & Test $$tool";\
cd tools/$$tool;\
NOWARNINGS=true RUSTFLAGS="-D warnings" cargo build --all-targets || exit 1;\
cd - > /dev/null;\
done
@NOWARNINGS=true RUSTFLAGS="-D warnings" \
cargo build --all-targets --manifest-path=tools/Cargo.toml --workspace || exit 1
endef

.PHONY: ci-job-tools
Expand Down
15 changes: 15 additions & 0 deletions tools/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[workspace]
members = [
"alert_codes",
"board-runner",
"litex-ci-runner",
"qemu-runner",
"sha256sum",
"usb/bulk-echo",
"usb/bulk-test",
"usb/control-test",
]

[workspace.package]
authors = ["Tock Project Developers <tock-dev@googlegroups.com>"]
edition = "2021"
4 changes: 2 additions & 2 deletions tools/alert_codes/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "alert_codes"
version = "0.1.0"
authors = ["jrvanwhy <jrvanwhy@google.com>"]
edition = "2021"
authors.workspace = true
edition.workspace = true

[dependencies]
4 changes: 2 additions & 2 deletions tools/board-runner/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "board-runner"
version = "0.1.0"
authors = ["Tock Project Developers <tock-dev@googlegroups.com>"]
edition = "2021"
authors.workspace = true
edition.workspace = true

[dependencies]
rexpect = "0.4"
Expand Down
8 changes: 0 additions & 8 deletions tools/list_tools.sh

This file was deleted.

2 changes: 1 addition & 1 deletion tools/litex-ci-runner/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "litex-ci-runner"
version = "0.1.0"
authors = ["Tock Project Developers <tock-dev@googlegroups.com>"]
authors.workspace = true
edition = "2018"

[dependencies]
Expand Down
4 changes: 2 additions & 2 deletions tools/qemu-runner/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "qemu-runner"
version = "0.1.0"
authors = ["Tock Project Developers <tock-dev@googlegroups.com>"]
edition = "2021"
authors.workspace = true
edition.workspace = true

[dependencies]
rexpect = "0.4.0"
1 change: 1 addition & 0 deletions tools/usb/bulk-echo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "bulk-echo"
version = "0.1.0"
authors = ["Daniel B Giffin <daniel@beech-grove.net>"]
edition.workspace = true

[dependencies]
libusb = { git ="https://github.com/tock/libusb-rs" }
1 change: 1 addition & 0 deletions tools/usb/bulk-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "bulk-test"
version = "0.1.0"
authors = ["Daniel B. Giffin <dbg@scs.stanford.edu>"]
edition.workspace = true

[dependencies]
libusb = { git ="https://github.com/tock/libusb-rs" }
1 change: 1 addition & 0 deletions tools/usb/control-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "control-test"
version = "0.1.0"
authors = ["Daniel B. Giffin <dbg@scs.stanford.edu>"]
edition.workspace = true

[dependencies]
libusb = { git ="https://github.com/tock/libusb-rs" }

0 comments on commit 38ece1c

Please sign in to comment.