Skip to content

Commit 395d0f3

Browse files
committed
chore: put everything in One Big Workspace
This commit changes the Cargo workspace setup to put all crates in One Big Workspace, rather than having separate workspaces for some targets. We now use the `per-package-target` unstable cargo feature to build different crates for different targets. This means that `cargo` commands in the root workspace now work without requiring the user to `cd` into a particular directory to build a platform target --- for example, I can now run: ```console # in the repo root directory $ cargo build -p mnemos-d1 --bin mq-pro ``` and build a MnemOS binary for the MQ Pro, without having to `cd` into the MQ Pro directory. One issue is that `cargo build --workspace` (and `check --workspace`, etc) still does not work correctly, due to some [weird][1] [issues][2] with feature unification which I don't entirely understand. However, as a workaround, I've changed the workspace Cargo.toml to add a [`default-members` field][3], so that running `cargo build` or `cargo check` _without_ `--workspace` will build the subset of crates in the `default-members` key. This way, `cargo {build, check, etc}` in the repo root will do something reasonable by default, and the actual platform targets can be built/checked with `cargo $WHATEVER --package $CRATE`. IMO, this is still substantially nicer than having a bunch of separate workspaces. [1]: ia0/data-encoding#47 [2]: bincode-org/bincode#556 [3]: https://doc.rust-lang.org/cargo/reference/workspaces.html#the-default-members-field
1 parent 4421ed7 commit 395d0f3

File tree

26 files changed

+1073
-250
lines changed

26 files changed

+1073
-250
lines changed

.cargo/config.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
[alias]
2+
crowtty = "run --bin crowtty --release --"
3+
melpomene = "run --bin melpomene --release --"
4+
melpo = "melpomene"
5+
forth3 = "run --bin f3repl --release --"
6+
17
[build]
28
# Currently needed for `tokio-console` support.
3-
rustflags = ["--cfg", "tokio_unstable"]
9+
rustflags = ["--cfg", "tokio_unstable"]
10+
11+
[target.riscv32imac-unknown-none-elf]
12+
runner = "espflash flash --monitor"

0 commit comments

Comments
 (0)