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[E0308]: mismatched types - expected raw pointer *mut u8 during cross compilation #412

Closed
Adoni5 opened this issue Nov 28, 2023 · 0 comments · Fixed by #415
Closed

Comments

@Adoni5
Copy link

Adoni5 commented Nov 28, 2023

Hey guys - I'm trying cross compile into aarch64-unknown-linux. The problem is the bindings seem to expect *mut u8, and are receiving an i8 reference.

 error[E0308]: mismatched types
    --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rust-htslib-0.44.1/src/bam/record.rs:2324:17
     |
2319 |             let ret = hts_sys::bam_mods_query_type(
     |                       ---------------------------- arguments to this function are incorrect
...
2324 |                 &mut canonical,
     |                 ^^^^^^^^^^^^^^ expected `*mut u8`, found `&mut i8`
     |
     = note:    expected raw pointer `*mut u8`
             found mutable reference `&mut i8`
note: function defined here
    --> /home/runner/work/cnv_from_bam/cnv_from_bam/target/aarch64-unknown-linux-gnu/release/build/hts-sys-f85a33d3986fc8a3/out/bindings.rs:9439:12
     |
9439 |     pub fn bam_mods_query_type(
     |            ^^^^^^^^^^^^^^^^^^^

Specifically the issue seems to be here in the modified base metadata.

rust-htslib/src/bam/record.rs

Lines 2317 to 2325 in 3008a13

let mut canonical: i8 = 0;
let ret = hts_sys::bam_mods_query_type(
self.state,
code,
&mut strand,
&mut implicit,
&mut canonical,
);

Am I doing something obviously wrong? I'm cross compiling using an altered version of docker/cross

https://github.com/rust-cross/manylinux-cross/pkgs/container/manylinux_2_28-cross. I'm creating a .so to use with a PyO3 package.

Many Thanks
Rory

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

Successfully merging a pull request may close this issue.

1 participant