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

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

Open
BionicRabbit3 opened this issue Sep 24, 2019 · 8 comments
Open

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

BionicRabbit3 opened this issue Sep 24, 2019 · 8 comments

Comments

@BionicRabbit3
Copy link

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

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

@flier
Copy link
Owner

flier commented Sep 26, 2019

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

@That3Percent
Copy link

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

@da-x
Copy link

da-x commented Feb 5, 2020

I've made a Windows (x86_64-pc-windows-gnu) build based on a fairly recent version 1a00c1a 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
Copy link

da-x commented Feb 5, 2020

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
Copy link

Any update on this?

est31 added a commit to est31/mimas that referenced this issue Sep 3, 2020
This commit has a non-zero impact as it breaks all maps.
However, I think other commits since the 0.3 already messed
with the mapgen's elevation info.

We mostly do this to get rid of the fasthash dependency.
It is broken on some windows targets [1], and also
requires rand 0.4. This commit rids us of these problems
in place of the twox-hash crate which seems to have better
maintenance.

[1]: flier/rust-fasthash#11
@esseswann
Copy link

Bumping as build still fails on Windows using latest master

@WilliamVenner
Copy link

Getting this too.

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

@MizardX
Copy link

MizardX commented Jan 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants