Skip to content

Bioconductor build fails due to htslib version problems #508

Description

@stela2502

Hi developer,

I have built a bamCoverage replacement that is significantly faster than the Python implementation using your rust-htslib interface.
https://github.com/stela2502/bam_tide
This builds fine with htslib 1.19 (Ubuntu's default), but breaks with bioconductor's version 1.21.
The error is that the Rust library tries to access not existing fields in the C++ library:
And ChatGPT told me that one should not access data that is not in the official interface definition.
Is there a rust-htslib version that can interact with htslib 1.21? Or would it be possible to get a stripped down version that only reads data and not modifies it?

Thank you for your help and this really nice interface!

12:13:36 BIOCONDA INFO (ERR) error[E0609]: no field `block_address` on type `hts_sys::BGZF`
12:13:36 BIOCONDA INFO (ERR)    --> /home/med-sal/micromamba/envs/bc/conda-bld/bam-tide_1772795386353/_build_env/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rust-htslib-1.0.0/src/bam/mod.rs:199:15
12:13:36 BIOCONDA INFO (ERR)     |
12:13:36 BIOCONDA INFO (ERR) 199 |         (bgzf.block_address << 16) | (i64::from(bgzf.block_offset) & 0xFFFF)
12:13:36 BIOCONDA INFO (ERR)     |               ^^^^^^^^^^^^^ unknown field
12:13:36 BIOCONDA INFO (ERR)     |
12:13:36 BIOCONDA INFO (ERR)     = note: available field is: `_address`
12:13:36 BIOCONDA INFO (ERR) 
12:13:36 BIOCONDA INFO (ERR) error[E0609]: no field `block_offset` on type `hts_sys::BGZF`
12:13:36 BIOCONDA INFO (ERR)    --> /home/med-sal/micromamba/envs/bc/conda-bld/bam-tide_1772795386353/_build_env/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rust-htslib-1.0.0/src/bam/mod.rs:199:54
12:13:36 BIOCONDA INFO (ERR)     |
12:13:36 BIOCONDA INFO (ERR) 199 |         (bgzf.block_address << 16) | (i64::from(bgzf.block_offset) & 0xFFFF)
12:13:36 BIOCONDA INFO (ERR)     |                                                      ^^^^^^^^^^^^ unknown field
12:13:36 BIOCONDA INFO (ERR)     |
12:13:36 BIOCONDA INFO (ERR)     = note: available field is: `_address`
12:13:36 BIOCONDA INFO (ERR) 
12:13:36 BIOCONDA INFO (ERR) error[E0609]: no field `text` on type `sam_hdr_t`
12:13:36 BIOCONDA INFO (ERR)     --> /home/med-sal/micromamba/envs/bc/conda-bld/bam-tide_1772795386353/_build_env/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rust-htslib-1.0.0/src/bam/mod.rs:1124:20
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR) 1124 |             (*rec).text = text as *mut c_char;
12:13:36 BIOCONDA INFO (ERR)      |                    ^^^^ unknown field
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR)      = note: available field is: `_address`
12:13:36 BIOCONDA INFO (ERR) 
12:13:36 BIOCONDA INFO (ERR) error[E0609]: no field `l_text` on type `sam_hdr_t`
12:13:36 BIOCONDA INFO (ERR)     --> /home/med-sal/micromamba/envs/bc/conda-bld/bam-tide_1772795386353/_build_env/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rust-htslib-1.0.0/src/bam/mod.rs:1125:20
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR) 1125 |             (*rec).l_text = l_text;
12:13:36 BIOCONDA INFO (ERR)      |                    ^^^^^^ unknown field
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR)      = note: available field is: `_address`
12:13:36 BIOCONDA INFO (ERR) 
12:13:36 BIOCONDA INFO (ERR) error[E0609]: no field `text` on type `sam_hdr_t`
12:13:36 BIOCONDA INFO (ERR)     --> /home/med-sal/micromamba/envs/bc/conda-bld/bam-tide_1772795386353/_build_env/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rust-htslib-1.0.0/src/bam/mod.rs:1393:20
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR) 1393 |             (*rec).text = text as *mut c_char;
12:13:36 BIOCONDA INFO (ERR)      |                    ^^^^ unknown field
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR)      = note: available field is: `_address`
12:13:36 BIOCONDA INFO (ERR) 
12:13:36 BIOCONDA INFO (ERR) error[E0609]: no field `l_text` on type `sam_hdr_t`
12:13:36 BIOCONDA INFO (ERR)     --> /home/med-sal/micromamba/envs/bc/conda-bld/bam-tide_1772795386353/_build_env/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rust-htslib-1.0.0/src/bam/mod.rs:1394:20
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR) 1394 |             (*rec).l_text = l_text;
12:13:36 BIOCONDA INFO (ERR)      |                    ^^^^^^ unknown field
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR)      = note: available field is: `_address`
12:13:36 BIOCONDA INFO (ERR) 
12:13:36 BIOCONDA INFO (ERR) error[E0609]: no field `n_targets` on type `&sam_hdr_t`
12:13:36 BIOCONDA INFO (ERR)     --> /home/med-sal/micromamba/envs/bc/conda-bld/bam-tide_1772795386353/_build_env/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rust-htslib-1.0.0/src/bam/mod.rs:1443:22
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR) 1443 |         self.inner().n_targets as u32
12:13:36 BIOCONDA INFO (ERR)      |                      ^^^^^^^^^ unknown field
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR)      = note: available field is: `_address`
12:13:36 BIOCONDA INFO (ERR) 
12:13:36 BIOCONDA INFO (ERR) error[E0609]: no field `target_name` on type `&sam_hdr_t`
12:13:36 BIOCONDA INFO (ERR)     --> /home/med-sal/micromamba/envs/bc/conda-bld/bam-tide_1772795386353/_build_env/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rust-htslib-1.0.0/src/bam/mod.rs:1448:48
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR) 1448 |             slice::from_raw_parts(self.inner().target_name, self.target_count() as usize)
12:13:36 BIOCONDA INFO (ERR)      |                                                ^^^^^^^^^^^ unknown field
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR)      = note: available field is: `_address`
12:13:36 BIOCONDA INFO (ERR) 
12:13:36 BIOCONDA INFO (ERR) error[E0609]: no field `n_targets` on type `sam_hdr_t`
12:13:36 BIOCONDA INFO (ERR)     --> /home/med-sal/micromamba/envs/bc/conda-bld/bam-tide_1772795386353/_build_env/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rust-htslib-1.0.0/src/bam/mod.rs:1458:33
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR) 1458 |         if (tid as i32) < inner.n_targets {
12:13:36 BIOCONDA INFO (ERR)      |                                 ^^^^^^^^^ unknown field
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR)      = note: available field is: `_address`
12:13:36 BIOCONDA INFO (ERR) 
12:13:36 BIOCONDA INFO (ERR) error[E0609]: no field `target_len` on type `sam_hdr_t`
12:13:36 BIOCONDA INFO (ERR)     --> /home/med-sal/micromamba/envs/bc/conda-bld/bam-tide_1772795386353/_build_env/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rust-htslib-1.0.0/src/bam/mod.rs:1460:54
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR) 1460 |                 unsafe { slice::from_raw_parts(inner.target_len, inner.n_targets as usize) };
12:13:36 BIOCONDA INFO (ERR)      |                                                      ^^^^^^^^^^ unknown field
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR)      = note: available field is: `_address`
12:13:36 BIOCONDA INFO (ERR) 
12:13:36 BIOCONDA INFO (ERR) error[E0609]: no field `n_targets` on type `sam_hdr_t`
12:13:36 BIOCONDA INFO (ERR)     --> /home/med-sal/micromamba/envs/bc/conda-bld/bam-tide_1772795386353/_build_env/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rust-htslib-1.0.0/src/bam/mod.rs:1460:72
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR) 1460 |                 unsafe { slice::from_raw_parts(inner.target_len, inner.n_targets as usize) };
12:13:36 BIOCONDA INFO (ERR)      |                                                                        ^^^^^^^^^ unknown field
12:13:36 BIOCONDA INFO (ERR)      |
12:13:36 BIOCONDA INFO (ERR)      = note: available field is: `_address`
12:13:36 BIOCONDA INFO (ERR) 
12:13:37 BIOCONDA INFO (ERR) For more information about this error, try `rustc --explain E0609`.
12:13:37 BIOCONDA INFO (ERR) error: could not compile `rust-htslib` (lib) due to 11 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions