On Tue, Apr 4, 2023 at 1:47 PM Sandro Mani <manisandro(a)gmail.com> wrote:
Hi
I'm trying to update mingw-librsvg2 to version 2.56.0 [1], and am stuck at the
following issue:
error[E0433]: failed to resolve: use of undeclared crate or module `winapi`
--> /usr/share/cargo/registry/gio-sys-0.17.4/src/manual.rs:13:63
|
13 | pub const G_SOCKET_FAMILY_INVALID: super::GSocketFamily =
winapi::shared::ws2def::AF_UNSPEC;
| ^^^^^^ use of
undeclared crate or module `winapi`
I've build rust-winapi and manually added the BR rust-winapi-devel to
mingw-librsvg2.spec, but this did not help.
I suspect that here gio-sys is a "native" build which cannot be used for
cross-compiling to Windows? Do I have to build a "mingw-rust-gio-sys"?
I'm not really familiar with rust so any pointers are appreciated.
The problem is that we don't package any Windows-specific Rust
libraries, and due to the way dependency resolution works during Rust
builds, these dependencies need to be removed from crate metadata, as
well. So the issue you're seeing is caused by this patch:
https://src.fedoraproject.org/rpms/rust-gio-sys/blob/rawhide/f/gio-sys-fi...
And I'm pretty sure the rust-gio-sys package is not the only instance
of where this happens, it's just the first one that causes the build
to fail.
Long story short: Because we don't (or can't) package non-Linux
dependencies, Rust libraries we package for Fedora can't be used for
cross compilation if they have Windows-specific dependencies removed.
I'm not sure what the best solution would be for this use case, since
I don't really want to start packaging Windows-specific Rust crates
...
For now, the easiest solution for mingw-librsvg2 is probably to switch
back to building with bundled/vendored dependencies (i.e. the way it
was built until Fedora < 38), which should include all the necessary
dependencies for Windows builds.
Fabio