I’ve been trying to give anu a test run, but am running into some issues building it so far. I hope it’s fine to post this here; I was going to start a “discussion” in https://nest.anu.dev/anu/zstd-seekable/, but failed.
I’m building on macos, with dependencies installed via nix. I’ve made it to a point where I get the following error:
error[E0412]: cannot find type `_IO_FILE` in this scope
--> /Users/rob/.cargo/registry/src/github.com-1ecc6299db9ec823/zstd-seekable-0.1.0/src/lib.rs:383:62
|
383 | let result = ZSTD_seekable_initFile(p, f as *mut _IO_FILE);
| ^^^^^^^^ not found in this scope
I got it working by downloading the source code from https://static.crates.io/crates/anu/anu-1.0.0-alpha.crate, then running cargo vendor, and editing the relevant line in zstd-seekable. I think there was also a checksum that needed to be deleted.
The diff (besides editing the vendored checksum file):
--- zstd-seekable/src/lib.rs.orig 2020-11-07 23:18:45.000000000 +0100
+++ zstd-seekable/src/lib.rs 2020-11-07 23:18:14.000000000 +0100
@@ -380,7 +380,7 @@
if p.is_null() {
return Err(Error::Null);
}
- let result = ZSTD_seekable_initFile(p, f as *mut _IO_FILE);
+ let result = ZSTD_seekable_initFile(p, f as *mut FILE);
if ZSTD_isError(result) != 0 {
return Err(Error::ZSTD(result));
}
My understanding is that _IO_FILE is an internal generated struct name due to bindgen, while FILE is the stable type alias, so the diff might be safe to apply (but unsure).
I had to extend my nix-shell a bit, too, here’s what worked: