flier / rust-fasthash

A suite of non-cryptographic hash functions for Rust.
Apache License 2.0
138 stars 28 forks source link

Build fails on x86_64-pc-windows-gnu #11

Open BionicRabbit3 opened 5 years ago

BionicRabbit3 commented 5 years ago

cargo:warning=src/smhasher/City.cpp:67:10: fatal error: byteswap.h: No such file or directory
cargo:warning= 67 | #include
cargo:warning= | ^~~~
cargo:warning=compilation terminated.

To my (extremely uneducated) understanding this is because mingw doesn't have glibc, right?

flier commented 5 years ago

Yes, some hash implementation don't support Windows/Mingw, we may need a subset for windows :(

That3Percent commented 4 years ago

Is there something that can be done in the meantime to use the library on Windows? Feature flags for disabling offending hashers?

da-x commented 4 years ago

I've made a Windows (x86_64-pc-windows-gnu) build based on a fairly recent version 1a00c1a1 here.

I had to do this quick, and so I had to disable CityHash, and inline the xxhash submodule to rename symbols in the xxhash because it collided on symbols with the lz4 crate which takes in the same library under FFI (we should probably have an sys-xxhash crate as a dependency for crates both instead!). Also, I don't have the time right now to prepare a PR. If anyone wants to take it from there and finish it up - I'd be glad.

da-x commented 4 years ago

BTW I've built and tested it with a cross compiler. This can be done with cargo-cross installed (which uses containers), or directly, with cargo test --target x86_64-pc-windows-gnu. Having wine installed is helpful so that the unit test can be executed.

blarfoon commented 4 years ago

Any update on this?

esseswann commented 3 years ago

Bumping as build still fails on Windows using latest master

WilliamVenner commented 3 years ago

Getting this too.

Is it not possible to feature flag or conditionally compile away non-cross-platform hashing functions?

MizardX commented 10 months ago

The published create for fasthash-sys (which fasthash depends on) seems to be using a very old build script (This one, from 2018-08-06: https://github.com/flier/rust-fasthash/blob/f44d81ac03478f218f5721db40b3e38cec1bbcd3/fasthash-sys/build.rs). The script has been extended much since then.