-
Notifications
You must be signed in to change notification settings - Fork 64
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
vhost: Always enable vm-memory/backend-mmap #175
Conversation
We should probably also do a quick 0.8.1 release after merging this one. |
@vireshk can you take a look? Should we enable that feature depending on our |
@slp I am not sure why this change is required though. If I tried Just wondering what am I missing here .. |
@slp sorry, I can't understand the problem. What error do you see without this patch? Maybe it's my limited knowledge of cargo, but in vm-memory/Cargo.toml the So IIUC, when we enable |
According to the cargo documentation:
This means imports from dev-dependencies should be gated behind vhost/crates/vhost/src/backend.rs Line 17 in 900b9a5
This implies
Even if one of your dependencies enables a feature, that feature doesn't appear in your namespace unless you also enable it in your own crate. You can reproduce the issue by passing the
|
Sure, of course I missed that we are now using @slp can you include in the commit description that the feature is needed because of Maybe we should add a test in rust-vmm-ci to cover this scenario. |
Done :-) |
Since 4029089 ('vhost: Add support for Xen memory mappings') the feature backend-mmap of the vm-memory crate is no longer just a dev-dependency, as we're unconditionally importing GuestMemoryMmap from 'src/backend.rs'. Make it a general build dependency. Signed-off-by: Sergio Lopez <slp@redhat.com>
Hi, I am somehow not able to reproduce it on commit
|
@vireshk I can reproduce adding cargo +nightly build -Z avoid-dev-deps -p vhost
Compiling proc-macro2 v1.0.63
Compiling quote v1.0.29
Compiling unicode-ident v1.0.10
Compiling libc v0.2.147
Compiling thiserror v1.0.41
Compiling bitflags v1.3.2
Compiling syn v2.0.23
Compiling vmm-sys-util v0.11.1
Compiling thiserror-impl v1.0.41
Compiling vm-memory v0.12.0
Compiling vhost v0.8.0 (/home/stefano/repos/vhost/crates/vhost)
error[E0432]: unresolved import `vm_memory::GuestRegionMmap`
--> crates/vhost/src/backend.rs:17:61
|
17 | use vm_memory::{bitmap::Bitmap, Address, GuestMemoryRegion, GuestRegionMmap};
| ^^^^^^^^^^^^^^^ no `GuestRegionMmap` in the root
|
note: found an item that was configured out
--> /home/stefano/.cargo/registry/src/index.crates.io-6f17d22bba15001f/vm-memory-0.12.0/src/lib.rs:60:40
|
60 | pub use mmap::{Error, GuestMemoryMmap, GuestRegionMmap, MmapRegion};
| ^^^^^^^^^^^^^^^
= note: the item is gated behind the `backend-mmap` feature
warning: unused import: `GuestMemoryRegion`
--> crates/vhost/src/backend.rs:17:42
|
17 | use vm_memory::{bitmap::Bitmap, Address, GuestMemoryRegion, GuestRegionMmap};
| ^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `Address`
--> crates/vhost/src/backend.rs:17:33
|
17 | use vm_memory::{bitmap::Bitmap, Address, GuestMemoryRegion, GuestRegionMmap};
| ^^^^^^^
warning: unused import: `std::os::unix::io::AsRawFd`
--> crates/vhost/src/backend.rs:13:5
|
13 | use std::os::unix::io::AsRawFd;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0432`.
warning: `vhost` (lib) generated 3 warnings
error: could not compile `vhost` (lib) due to previous error; 3 warnings emitted Maybe it doesn't show you because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't get much on this. Just get this merged :) |
This version fixes an issue on how a dependency is defined in Cargo.toml. We need to include it to prevent build failure during packaging. rust-vmm/vhost#175 Signed-off-by: German Maglione <gmaglione@redhat.com>
Since 4029089 ('vhost: Add support for Xen memory mappings') the feature backend-mmap of the vm-memory crate is no longer just a dev-dependency. Make it a formal dependency.