Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: could not compile minimap2 (lib) due to 3 previous errors #61

Closed
zaka-edd opened this issue Jul 19, 2024 · 4 comments
Closed

error: could not compile minimap2 (lib) due to 3 previous errors #61

zaka-edd opened this issue Jul 19, 2024 · 4 comments

Comments

@zaka-edd
Copy link

Hi,
I encountered errors when trying to compile my code using the latest version of minimap2 (v0.1.19+minimap2.2.28).

cargo build --release
    Updating crates.io index
  Downloaded minimap2 v0.1.19+minimap2.2.28
  Downloaded 1 crate (55.0 KB) in 13.28s
   Compiling minimap2 v0.1.19+minimap2.2.28
error[E0606]: casting `&*mut minimap2_sys::mm_idx_t` as `*const minimap2_sys::mm_idx_t` is invalid
   --> /home/zeddafir/.cargo/registry/src/index.crates.io-6f17d22bba15001f/minimap2-0.1.19+minimap2.2.28/src/htslib.rs:167:21
    |
167 |                     self.idx.as_ref().unwrap() as *const mm_ffi::mm_idx_t,
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0606]: casting `&*mut minimap2_sys::mm_idx_t` as `*const minimap2_sys::mm_idx_t` is invalid
   --> /home/zeddafir/.cargo/registry/src/index.crates.io-6f17d22bba15001f/minimap2-0.1.19+minimap2.2.28/src/htslib.rs:194:25
    |
194 |                         self.idx.as_ref().unwrap() as *const mm_ffi::mm_idx_t,
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
   --> /home/zeddafir/.cargo/registry/src/index.crates.io-6f17d22bba15001f/minimap2-0.1.19+minimap2.2.28/src/htslib.rs:346:20
    |
346 |             inner: aligner.idx.unwrap(),
    |                    ^^^^^^^^^^^^^^^^^^^^ expected `mm_idx_t`, found `*mut mm_idx_t`
    |
    = note:   expected struct `minimap2_sys::mm_idx_t`
            found raw pointer `*mut minimap2_sys::mm_idx_t`

Some errors have detailed explanations: E0308, E0606.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `minimap2` (lib) due to 3 previous errors

I have tried updating dependencies for potential fixes, but the issues persist. Any help in resolving these errors would be greatly appreciated. Thank you!

I am running:
rustc 1.78.0
cargo 1.78.0

@jguhlin
Copy link
Owner

jguhlin commented Jul 21, 2024

@zaka-edd Ah, it's some old code that needs to be updated with the htslib stuff. Sorry about that!
Revert to the previous version, as that won't change the API, and it should work. I'll get this fixed up tomorrow.

@jguhlin
Copy link
Owner

jguhlin commented Jul 22, 2024

Should be hitting crates.io very soon. Fixed, but reopen if there are any more issues! Sorry about that. I had CI set up but it all degraded and doesn't run anymore.

@martin-g
Copy link

Which version contains the fix ?
I am trying to build minimap2-0.1.20+minimap2.2.28 on Linux ARM64 here (as a dependency) but it fails with these 3 errors.

07:07:52 �[32mBIOCONDA INFO�[0m (OUT) error[E0606]: casting `&*mut minimap2_sys::mm_idx_t` as `*const minimap2_sys::mm_idx_t` is invalid�[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT)    --> /opt/conda/conda-bld/chopper_1724137504584/_build_env/.cargo/registry/src/index.crates.io-6f17d22bba15001f/minimap2-0.1.20+minimap2.2.28/src/lib.rs:834:25�[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT)     |�[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT) 834 |                         self.idx.as_ref().unwrap() as *const mm_idx_t,�[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT)     |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT) �[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT) error[E0606]: casting `&*mut minimap2_sys::mm_idx_t` as `*const minimap2_sys::mm_idx_t` is invalid�[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT)    --> /opt/conda/conda-bld/chopper_1724137504584/_build_env/.cargo/registry/src/index.crates.io-6f17d22bba15001f/minimap2-0.1.20+minimap2.2.28/src/lib.rs:974:41�[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT)     |�[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT) 974 | ...                   &self.idx.unwrap() as *const mm_idx_t,�[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT)     |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT) �[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT) error[E0606]: casting `&*mut minimap2_sys::mm_idx_t` as `*const minimap2_sys::mm_idx_t` is invalid�[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT)     --> /opt/conda/conda-bld/chopper_1724137504584/_build_env/.cargo/registry/src/index.crates.io-6f17d22bba15001f/minimap2-0.1.20+minimap2.2.28/src/lib.rs:1021:41�[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT)      |�[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT) 1021 | ...                   &self.idx.unwrap() as *const mm_idx_t,�[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT)      |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT) �[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT) For more information about this error, try `rustc --explain E0606`.�[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT) error: could not compile `minimap2` (lib) due to 3 previous errors�[0m
07:07:52 �[32mBIOCONDA INFO�[0m (OUT) �[0m

https://crates.io/crates/minimap2 says that v0.1.20+minimap2.2.28 is the latest.

@jguhlin
Copy link
Owner

jguhlin commented Aug 20, 2024

@martin-g Should be fixed even before 0.1.20, hmmm. Thanks for the logs! They helped.

When I download that version I can't run cross, but I can with the main branch

 cross test --target aarch64-unknown-linux-gnu

I'll do some tests and get it pushed out tomorrow then, and hopefully that resolves it for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants