rust-vmm / vm-virtio

virtio implementation
Apache License 2.0
361 stars 87 forks source link

Move all crates to workspace root #256

Closed epilys closed 8 months ago

epilys commented 11 months ago

Summary of the PR

Having all the workspace crates under the crates/ directory is unnecessary. Rust documentation itself recommends all crates to be in the root directory:

https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html#creating-the-second-package-in-the-workspace

I paste the text content here, in case the online page ever changes or becomes unavailable:

## Creating the Second Package in the Workspace

Next, let’s create another member package in the workspace and call it add_one. Change the top-level Cargo.toml to specify the add_one path in the members list:

Filename: Cargo.toml

[workspace]

members = [
    "adder",
    "add_one",
]

Then generate a new library crate named add_one:

$ cargo new add_one --lib
     Created library `add_one` package

Your add directory should now have these directories and files:

├── Cargo.lock
├── Cargo.toml
├── add_one
│   ├── Cargo.toml
│   └── src
│       └── lib.rs
├── adder
│   ├── Cargo.toml
│   └── src
│       └── main.rs
└── target

Requirements

Before submitting your PR, please make sure you addressed the following requirements:

epilys commented 10 months ago

Rebased against main.

epilys commented 10 months ago

Rebased against main.

andreeaflorescu commented 10 months ago

Looks like the pipeline also needs to be updated as the fuzz tests are now failing. Same for the coverage test.

epilys commented 10 months ago

Got to make sure CI works first...

epilys commented 10 months ago

@andreeaflorescu fixed the CI pipelines now, ready for review.

stefano-garzarella commented 10 months ago

Should we also update the following lines?

virtio-bindings/CONTRIBUTING.md:56:cp linux/v5_0_headers/*.rs vm-virtio/crates/virtio-bindings/src
virtio-bindings/CONTRIBUTING.md:57:mv vm-virtio/crates/virtio-bindings/src/virtio_net.rs vm-virtio/crates/virtio-bindings/src/virtio_net/generated.rs
virtio-queue/README.md:108:![queue](https://raw.githubusercontent.com/rust-vmm/vm-virtio/main/crates/virtio-queue/docs/images/queue.png)
virtio-queue/README.md:117:![descriptor](https://raw.githubusercontent.com/rust-vmm/vm-virtio/main/crates/virtio-queue/docs/images/descriptor.png)
epilys commented 10 months ago

@stefano-garzarella thanks, fixed! :)

stefano-garzarella commented 10 months ago

LGTM!

epilys commented 9 months ago

Rebased against main.

epilys commented 9 months ago

Ping

@andreeaflorescu @alexandruag @jiangliu @slp @stsquad