Closed jamessan closed 2 years ago
Why you guys need such a new version of nix. just curious. Knowing usecases of our users will make the project better.
In Android we vendor in all third-party dependencies, including Rust crates, and build with Soong (not cargo). This means that we can only have one version of each crate in the tree. We will need to update nix at some point for other users, and so we need the vsock crate to build with the latest version.
And even in the cargo ecosystem, it's generally desirable to avoid having multiple versions of the same crate where possible, to reduce build time and binary size.
I'm in a similar situation as qwandor. Debian packages crates, primarily to serve building bin crates. It's possible for us to have multiple, versioned crates for a single project in Debian, but we try to avoid it if at all possible.
We recently bumped nix to 0.24 without realizing that a couple of the dependent packages, vsock included, would be affected by the breaking changes in 0.24.
https://github.com/nix-rust/nix/pull/1614
vsock won't build with nix >= 0.24.
Build log
``` error[E0423]: cannot initialize a tuple struct which contains private fields --> /tmp/tmp.xk1r9Xh1Kg/registry/vsock-0.2.4/src/lib.rs:117:32 | 117 | Ok(SockAddr::Vsock(VsockAddr(vsock_addr))) | ^^^^^^^^^ help: a local variable with a similar name exists: `vsock_addr` | note: constructor is not visible here due to private fields --> /tmp/tmp.xk1r9Xh1Kg/registry/nix-0.24.1/src/sys/socket/addr.rs:2518:26 | 2518 | pub struct VsockAddr(pub(in super::super) sockaddr_vm); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private field error[E0423]: cannot initialize a tuple struct which contains private fields --> /tmp/tmp.xk1r9Xh1Kg/registry/vsock-0.2.4/src/lib.rs:281:32 | 281 | Ok(SockAddr::Vsock(VsockAddr(vsock_addr))) | ^^^^^^^^^ help: a local variable with a similar name exists: `vsock_addr` | note: constructor is not visible here due to private fields --> /tmp/tmp.xk1r9Xh1Kg/registry/nix-0.24.1/src/sys/socket/addr.rs:2518:26 | 2518 | pub struct VsockAddr(pub(in super::super) sockaddr_vm); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private field error[E0423]: cannot initialize a tuple struct which contains private fields --> /tmp/tmp.xk1r9Xh1Kg/registry/vsock-0.2.4/src/lib.rs:305:32 | 305 | Ok(SockAddr::Vsock(VsockAddr(vsock_addr))) | ^^^^^^^^^ help: a local variable with a similar name exists: `vsock_addr` | note: constructor is not visible here due to private fields --> /tmp/tmp.xk1r9Xh1Kg/registry/nix-0.24.1/src/sys/socket/addr.rs:2518:26 | 2518 | pub struct VsockAddr(pub(in super::super) sockaddr_vm); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private field warning: use of deprecated enum `nix::sys::socket::SockAddr`: use SockaddrLike or SockaddrStorage instead --> /tmp/tmp.xk1r9Xh1Kg/registry/vsock-0.2.4/src/lib.rs:29:28 | 29 | pub use nix::sys::socket::{SockAddr, VsockAddr}; | ^^^^^^^^ | = note: `#[warn(deprecated)]` on by default warning: use of deprecated enum `nix::sys::socket::SockAddr`: use SockaddrLike or SockaddrStorage instead --> /tmp/tmp.xk1r9Xh1Kg/registry/vsock-0.2.4/src/lib.rs:57:24 | 57 | pub fn bind(addr: &SockAddr) -> Result