Closed brainstorm closed 4 years ago
I think there are issues even before you get to rust-htslib
:
cargo build --release --target x86_64-unknown-linux-musl
worked on Linux for me, so I don't think that is the issue.musl-cross
with homebrew, but serverless
is running the build commands inside Docker...musl
at all. It is showing 1.39.0-x86_64-unknown-linux-gnu
as rust version and target in your logs, and it's also what I see in my machine.True to all you said. I'll be digging on the serverless-rust
and docker container innards soon, closing as INVALID ;)
Back to this after a while... that was a not-so-INVALID issue, the path for MUSL + C bindings in Rust is pretty tortuous these days, see:
I'm planning to file an idea/pre-RFC to Rust internals, inquiring why *-sys
crates objects and headers are not properly reused... in my view that'll solve a lot of problems and even get rid of the need to use Cross/Docker at all, but I might be missing several intricacies of Cargo, we'll see. Track this PR https://github.com/rust-bio/rust-htslib/pull/193 if anybody requires more gory details.
Thanks @luizirber for reviewing this back in January ;)
Hello rust-htslib,
I'm currently using this crate to simply read a BAM header. My crate builds fine on my machine (running OSX Catalina, also tested on a regular Linux machine):
The problem comes when I try to cross-compile it to run on AWS Lambda... it looks like the linking phase fails for the few rust-htslib functions I need to parse that BAM header:
Here's the full output while using serverless.com (lambda) deployment tool:
I don't have much experience with the rust-htslib approach to cbindgen & co, but if you could provide some pointers on what you think could be wrong here, I'd be happy to investigate further.
In order to reproduce this issue, assuming you are on Linux:
If something fails on your machine, please take a look at this blogpost which contains additional directions should you encounter some difficulty with the cross-compiling toolchain.
I would like to fix this before jumping into another rust implementation to just read the first BGZF block of a BAM file to get the header :-S