Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move to One Big Cargo Workspace (#219)
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: ```shell # 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. This is also necessary in order to make the `x86_64` build process added in PR #216 work, since it relies on cargo artifact dependencies, which appear not to work across workspaces. 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
- Loading branch information