[libnbd PATCH] rust: Avoid compiler warning about unused import
On Fedora 39, cargo 1.75.0 complained: Compiling libnbd v0.1.0 (/home/eblake/libnbd/rust) error: unused import: `async_bindings::*` --> src/lib.rs:31:9 | 31 | pub use async_bindings::*; | ^^^^^^^^^^^^^^^^^ | note: the lint level is defined here --> src/lib.rs:18:9 | 18 | #![deny(warnings)] | ^^^^^^^^ = note: `#[deny(unused_imports)]` implied by `#[deny(warnings)]` error: could not compile `libnbd` (lib) due to previous error Since the presence of async_bindings is itself conditional on tokio, it doesn't hurt to silence that particular warning. Signed-off-by: Eric Blake <eblake@redhat.com> --- I don't know enough Rust to know if it would instead be better to just delete the problematic 'pub use async_bindings::*;' line altogether; when I did that locally, things still built and passed 'make check' for me, but I don't know if that's because I don't have tokio installed correctly. Hence, I have not pushed this yet, but will wait for a review. rust/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 1e1ca2ed..6904ddad 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -27,6 +27,7 @@ mod handle; pub mod types; #[allow(unused)] mod utils; +#[allow(unused)] #[cfg(feature = "tokio")] pub use async_bindings::*; #[cfg(feature = "tokio")] -- 2.43.0
On Fri, Jan 05, 2024 at 03:26:21PM -0600, Eric Blake wrote:
On Fedora 39, cargo 1.75.0 complained:
Compiling libnbd v0.1.0 (/home/eblake/libnbd/rust) error: unused import: `async_bindings::*` --> src/lib.rs:31:9 | 31 | pub use async_bindings::*; | ^^^^^^^^^^^^^^^^^ | note: the lint level is defined here --> src/lib.rs:18:9 | 18 | #![deny(warnings)] | ^^^^^^^^ = note: `#[deny(unused_imports)]` implied by `#[deny(warnings)]`
error: could not compile `libnbd` (lib) due to previous error
Can confirm I'm able to reproduce this after updating cargo from 1.71.0 to 1.75.0.
Since the presence of async_bindings is itself conditional on tokio, it doesn't hurt to silence that particular warning.
Signed-off-by: Eric Blake <eblake@redhat.com> ---
I don't know enough Rust to know if it would instead be better to just delete the problematic 'pub use async_bindings::*;' line altogether; when I did that locally, things still built and passed 'make check' for me, but I don't know if that's because I don't have tokio installed correctly.
Hence, I have not pushed this yet, but will wait for a review.
rust/src/lib.rs | 1 + 1 file changed, 1 insertion(+)
diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 1e1ca2ed..6904ddad 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -27,6 +27,7 @@ mod handle; pub mod types; #[allow(unused)] mod utils; +#[allow(unused)] #[cfg(feature = "tokio")] pub use async_bindings::*; #[cfg(feature = "tokio")] -- 2.43.0
Looks good to me, so: Reviewed-by: Richard W.M. Jones <rjones@redhat.com> -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com nbdkit - Flexible, fast NBD server with plugins https://gitlab.com/nbdkit/nbdkit
On Tue, Jan 09, 2024 at 04:32:25PM +0000, Richard W.M. Jones wrote:
On Fri, Jan 05, 2024 at 03:26:21PM -0600, Eric Blake wrote:
Can confirm I'm able to reproduce this after updating cargo from 1.71.0 to 1.75.0.
Since the presence of async_bindings is itself conditional on tokio, it doesn't hurt to silence that particular warning.
Signed-off-by: Eric Blake <eblake@redhat.com> ---
I don't know enough Rust to know if it would instead be better to just delete the problematic 'pub use async_bindings::*;' line altogether; when I did that locally, things still built and passed 'make check' for me, but I don't know if that's because I don't have tokio installed correctly.
Hence, I have not pushed this yet, but will wait for a review.
rust/src/lib.rs | 1 + 1 file changed, 1 insertion(+)
diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 1e1ca2ed..6904ddad 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -27,6 +27,7 @@ mod handle; pub mod types; #[allow(unused)] mod utils; +#[allow(unused)] #[cfg(feature = "tokio")] pub use async_bindings::*; #[cfg(feature = "tokio")] -- 2.43.0
Looks good to me, so:
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Pushed as bd44b763 -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org
On Tue, Jan 09, 2024 at 03:46:56PM -0600, Eric Blake wrote:
On Tue, Jan 09, 2024 at 04:32:25PM +0000, Richard W.M. Jones wrote:
On Fri, Jan 05, 2024 at 03:26:21PM -0600, Eric Blake wrote:
Can confirm I'm able to reproduce this after updating cargo from 1.71.0 to 1.75.0.
Since the presence of async_bindings is itself conditional on tokio, it doesn't hurt to silence that particular warning.
Signed-off-by: Eric Blake <eblake@redhat.com> ---
I don't know enough Rust to know if it would instead be better to just delete the problematic 'pub use async_bindings::*;' line altogether; when I did that locally, things still built and passed 'make check' for me, but I don't know if that's because I don't have tokio installed correctly.
Hence, I have not pushed this yet, but will wait for a review.
rust/src/lib.rs | 1 + 1 file changed, 1 insertion(+)
diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 1e1ca2ed..6904ddad 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -27,6 +27,7 @@ mod handle; pub mod types; #[allow(unused)] mod utils; +#[allow(unused)] #[cfg(feature = "tokio")] pub use async_bindings::*; #[cfg(feature = "tokio")] -- 2.43.0
Looks good to me, so:
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Pushed as bd44b763
There's a FreeBSD CI failure but it seems unrelated: https://gitlab.com/nbdkit/libnbd/-/jobs/5896216156 It looks like the FreeBSD 12 container that we used has gone. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com nbdkit - Flexible, fast NBD server with plugins https://gitlab.com/nbdkit/nbdkit
On Wed, Jan 10, 2024 at 10:37:03AM +0000, Richard W.M. Jones wrote:
On Tue, Jan 09, 2024 at 03:46:56PM -0600, Eric Blake wrote:
On Tue, Jan 09, 2024 at 04:32:25PM +0000, Richard W.M. Jones wrote:
On Fri, Jan 05, 2024 at 03:26:21PM -0600, Eric Blake wrote:
Can confirm I'm able to reproduce this after updating cargo from 1.71.0 to 1.75.0.
Since the presence of async_bindings is itself conditional on tokio, it doesn't hurt to silence that particular warning.
Signed-off-by: Eric Blake <eblake@redhat.com> ---
I don't know enough Rust to know if it would instead be better to just delete the problematic 'pub use async_bindings::*;' line altogether; when I did that locally, things still built and passed 'make check' for me, but I don't know if that's because I don't have tokio installed correctly.
Hence, I have not pushed this yet, but will wait for a review.
rust/src/lib.rs | 1 + 1 file changed, 1 insertion(+)
diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 1e1ca2ed..6904ddad 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -27,6 +27,7 @@ mod handle; pub mod types; #[allow(unused)] mod utils; +#[allow(unused)] #[cfg(feature = "tokio")] pub use async_bindings::*; #[cfg(feature = "tokio")] -- 2.43.0
Looks good to me, so:
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Pushed as bd44b763
There's a FreeBSD CI failure but it seems unrelated:
https://gitlab.com/nbdkit/libnbd/-/jobs/5896216156
It looks like the FreeBSD 12 container that we used has gone.
Yes, 12 is EOL by FreeBSD and they purged their ports packages at end of Dec. lcitool supports FreeBSD 13 and 14 now. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
On Wed, Jan 10, 2024 at 10:55:07AM +0000, Daniel P. Berrangé wrote:
There's a FreeBSD CI failure but it seems unrelated:
https://gitlab.com/nbdkit/libnbd/-/jobs/5896216156
It looks like the FreeBSD 12 container that we used has gone.
Yes, 12 is EOL by FreeBSD and they purged their ports packages at end of Dec.
lcitool supports FreeBSD 13 and 14 now.
I've updated the ci/manifest.yml for libnbd and nbdkit to take this into account. FreeBSD 14 passed, but at the time of this email, it looks like Alpine 3.19 may be hung inside the interop/ tests. -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org
participants (3)
-
Daniel P. Berrangé -
Eric Blake -
Richard W.M. Jones