You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks for the nice crate! I was able to get anndata support working for our rust single-cell tool fairly easily!
I'm posting because I discovered a strange conflict when I include this crate along with flate2 (with my preferred cloudflare-zlib implementation)
I posted the issue in more detail in the flate2 repository. However, essentially, the following Cargo.toml is sufficient to trigger the problem:
[package]
name = "test_flate2"
version = "0.1.0"
edition = "2021"
[dependencies]
anndata = "0.6.1"
flate2 = { version = "1.0.35", features = ["cloudflare_zlib"] }
This results in the following compiler error:
error[E0308]: mismatched types
--> /home/rob/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flate2-1.0.35/src/ffi/c.rs:65:25
|
65 | zalloc: Some(allocator::zalloc),
| ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found `Option<extern "C" fn(..., ..., ...) -> ... {z
alloc}>`
|
= note: expected fn pointer `unsafe extern "C" fn(*mut c_void, u32, u32) -> *mut c_void`
found enum `Option<extern "C" fn(*mut c_void, u32, u32) -> *mut c_void {zalloc}>`
error[E0308]: mismatched types
--> /home/rob/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flate2-1.0.35/src/ffi/c.rs:67:24
|
67 | zfree: Some(allocator::zfree),
| ^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found `Option<extern "C" fn(..., ...) {zfree}>`
|
= note: expected fn pointer `unsafe extern "C" fn(*mut c_void, *mut c_void)`
found enum `Option<extern "C" fn(*mut c_void, *mut c_void) {zfree}>`
For more information about this error, try `rustc --explain E0308`.
error: could not compile `flate2` (lib) due to 2 previous errors
So it seems there is some conflicting / improper definition or it is somehow being included in the wrong place? Hopefully we can figure out what's triggering this so that this crate can be used successfully with flate2 with any of the zlib backends.
The text was updated successfully, but these errors were encountered:
I think the gz stuff is being pulled in by polars, but setting flags that break stuff. The error shows up when I include the niffler crate (for transparently detecting compression) in the project later. But both polars and flate2 are fine by themselves. It feels like the upstream package should maybe set some different options or flate2 should figure out what to do if different crates are included with different options? However, I think right now there is potential trouble for anyone wanting to use anndata (or polars) with a separate compression crate in their project, which would seem pretty common.
Hi @kaizhang,
First, thanks for the nice crate! I was able to get anndata support working for our rust single-cell tool fairly easily!
I'm posting because I discovered a strange conflict when I include this crate along with flate2 (with my preferred
cloudflare-zlib
implementation)I posted the issue in more detail in the flate2 repository. However, essentially, the following
Cargo.toml
is sufficient to trigger the problem:This results in the following compiler error:
So it seems there is some conflicting / improper definition or it is somehow being included in the wrong place? Hopefully we can figure out what's triggering this so that this crate can be used successfully with
flate2
with any of the zlib backends.The text was updated successfully, but these errors were encountered: