jguhlin / minimap2-rs

Rust bindings to minimap2 library
Other
60 stars 13 forks source link

Invalid cast (on arm64?) #82

Open rob-p opened 2 weeks ago

rob-p commented 2 weeks ago

Within minimap2-rs, I'm getting the following error when building on bioconda for an arm64 linux machine:

19:11:58 BIOCONDA INFO (OUT)     |
19:11:58 BIOCONDA INFO (OUT) 856 |                         self.idx.as_ref().unwrap() as *const mm_idx_t,
19:11:58 BIOCONDA INFO (OUT)     |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19:11:58 BIOCONDA INFO (OUT) 
19:11:58 BIOCONDA INFO (OUT) error[E0606]: casting `&*mut minimap2_sys::mm_idx_t` as `*const minimap2_sys::mm_idx_t` is invalid
19:11:58 BIOCONDA INFO (OUT)    --> /opt/conda/conda-bld/oarfish_1724699349146/_build_env/.cargo/registry/src/index.crates.io-6f17d22bba15001f/minimap2-temp-0.1.30+minimap2.2.28/src/lib.rs:998:41

I'm looking into why this is not valid and what the alternative should be.

rob-p commented 2 weeks ago

I made the code for these casts in these branches match those in the other cfg branches and this solved the issue (it compiles at least). I’ll update my pending PR accordingly.

jguhlin commented 2 weeks ago

Awesome. Sorry I've been hit with some bad migrane or something so am really slow right now.