Closed wdecoster closed 1 year ago
Definitely a conundrum.
For your immediate problem, you need PKG_CONFIG_ALLOW_CROSS=1, but then it gives a zlib error (zlib is not part of musl's default libraries).
I've added it through cargo and the build.rs script, so this command gets further:
PKG_CONFIG_ALLOW_CROSS=1 cargo build --release --target=x86_64-un
known-linux-musl
But now we have a weird error,
cargo:warning=In file included from /usr/include/assert.h:35,
cargo:warning= from minimap2/align.c:1:
cargo:warning=/usr/include/features.h:461:12: fatal error: sys/cdefs.h: No such file or directory
cargo:warning= 461 | # include <sys/cdefs.h>
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=compilation terminated.
exit status: 1
It's weird because musl-gcc should overwrite -I /usr/include to point to musl's version of the header, which would not have that error. And musl-gcc is being used:
running: "musl-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "/usr/include" "-I" "min
imap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lpthread" "-o" "/mnt/c/Development/minimap2-rs/minimap2-sys/target/x86_64-unknown-lin
ux-musl/release/build/minimap2-sys-563afacb72323465/out/minimap2/align.o" "-c" "minimap2/align.c"
If you could pull from GitHub and try running that commands in the minimap2-sys directory and let me know what you get, that could help (I'm on wsl2 b/c at home today, which adds an extra layer of configuration problems).
Wondering if this container would work for you?
https://github.com/messense/rust-musl-cross#prebuilt-images
You download the container and create an alias, then run this:
rust-musl-builder cargo build --release
It worked on my WSL2. If you can build minimap2-sys with it, I'll push the changes for the main crate to work (it needs that libz stuff I added still)
Hi,
For my project that uses minimap2 I am trying to make musl binaries (
cargo build --release --target=x86_64-unknown-linux-musl
) to support older hardware too. I don't know if the solution to the error below is obvious, but do you have any suggestions?