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

chore: put everything in one big Cargo workspace #18

Merged
merged 1 commit into from Jul 15, 2022

Conversation

hawkw
Copy link
Contributor

@hawkw hawkw commented Jul 15, 2022

Currently, this repo contains three separate Cargo workspaces: one for
source/, which contains the actual mnemOS crates, and then a separate
root workspace for each crate in tools/.

This is a bit unfortunate, as it means that it's not possible to run
cargo run --bin WHATEVER from the root directory of the repo. Instead,
in order to run melpomene, it's necessary to cd into source.
Similarly, if I want to run tools like crowtty, I need to cd into
tools/crowtty. This is very mildly annoying. The lack of a global
workspace also means that it's not currently possible to run cargo
commands like cargo build --workspace and build everything in one go.

This branch rectifies this by moving the workspace's Cargo.toml to the
root of the repo, and including all crates in the workspace (both
source/ and tools/). The potential downside of this is that it means
there's a lockfile, Cargo.toml, and .cargo/ directory in the root of
the workspace, which previously was nice and clean, and didn't have a
bunch of random config files and stuff in it. But, I think this is
probably not that bad?

If you'd really prefer not to make this change, that's fine --- having
to change dirs was really only a minor inconvenience.

Currently, this repo contains three separate Cargo workspaces: one for
`source/`, which contains the actual mnemOS crates, and then a separate
root workspace for each crate in `tools/`.

This is a bit unfortunate, as it means that it's not possible to run
`cargo run --bin WHATEVER` from the root directory of the repo. Instead,
in order to run `melpomene`, it's necessary to `cd` into `source`.
Similarly, if I want to run tools like `crowtty`, I need to `cd` into
`tools/crowtty`. This is very mildly annoying. The lack of a global
workspace also means that it's not currently possible to run cargo
commands like `cargo build --workspace` and build everything in one go.

This branch rectifies this by moving the workspace's `Cargo.toml` to the
root of the repo, and including all crates in the workspace (both
`source/` and `tools`/). The potential downside of this is that it means
there's a lockfile, `Cargo.toml`, and `.cargo/` directory in the root of
the workspace, which previously was nice and clean, and didn't have a
bunch of random config files and stuff in it. But, I think this is
probably not *that* bad?

If you'd really prefer not to make this change, that's fine --- having
to change dirs was really only a minor inconvenience.
@hawkw hawkw requested a review from jamesmunns July 15, 2022 17:00
Copy link
Contributor

@jamesmunns jamesmunns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern with this is that I have some memory of workspaces for multiple targets (e.g. desktop linux + cortex-m) not working right/being a pain in the ass.

I can't remember if it was cargo or rust-analyzer's fault, but the original division of workspaces was made to avoid "embedded" crates and "desktop crates" being in the same workspace.

That being said - in this consideration melpo should probably be in the "tools" folder.

I'm happy to merge this now, but it might make sense to back out later when we get closer to working with real hardware.

@hawkw
Copy link
Contributor Author

hawkw commented Jul 15, 2022

My only concert with this is that I have some memory of workspaces for multiple targets not working right/being a pain in the ass.

I can't remember if it was cargo or rust-analyzer's fault, but the original division of workspaces was made to avoid "embedded" crates and "desktop crates" being in the same workspace.

That being said - in this consideration melpo should probably be in the "tools" folder.

I'm happy to merge this now, but it might make sense to back out later when we get closer to working with real hardware.

Ah, hmm, I was wondering if there was some issue like that. I've not had problems with having all the mycelium stuff in the same workspace even though it will do builds for both the host target (build tools) and the actual OS target (which is still x86 in my case but uses a very different target.json). But, it's possible that only works because of some specific aspect of the way I've set things up.

If this causes problems, we can definitely undo it later.

hawkw added a commit that referenced this pull request Jul 15, 2022
This branch adds `cargo melpomene` and `cargo melpo` aliases for running
Melpomene that are equivalent to `cargo run --bin melpomene -- <ARGS>`
but with slightly fewer characters.

This is very minor but I thought maybe nice to have.

Depends on #18
@hawkw hawkw merged commit 8f59d98 into main Jul 15, 2022
hawkw added a commit that referenced this pull request Jul 15, 2022
This branch adds `cargo melpomene` and `cargo melpo` aliases for running
Melpomene that are equivalent to `cargo run --bin melpomene -- <ARGS>`
but with slightly fewer characters.

This is very minor but I thought maybe nice to have.

Depends on #18
hawkw added a commit that referenced this pull request Jul 15, 2022
This branch adds `cargo melpomene` and `cargo melpo` aliases for running
Melpomene that are equivalent to `cargo run --bin melpomene -- <ARGS>`
but with slightly fewer characters.

This is very minor but I thought maybe nice to have.

Depends on #18
@jamesmunns jamesmunns deleted the eliza/one-big-workspace branch July 17, 2022 00:01
@jamesmunns jamesmunns added the area: tools & build Related to host developer tools, including tracing, Crowtty and build processes label Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tools & build Related to host developer tools, including tracing, Crowtty and build processes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants