Skip to content

target_family condition not met #66

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

Closed
hunterlester opened this issue Mar 11, 2018 · 4 comments
Closed

target_family condition not met #66

hunterlester opened this issue Mar 11, 2018 · 4 comments

Comments

@hunterlester
Copy link

Hi @alexcrichton! It's quite exciting to be writing someone who is so prolific in the Rust community.
Thank you so much for wasm-bindgen and thank you for your time.

Laying out my issue:

Host: nightly-x86_64-pc-windows-gnu
Version: rustc 1.26.0-nightly

Attempting to compile this library with cargo build --release --target wasm32-unknown-unknown.
Receiving long error output all having to do with undeclared modules:

sys::try_lock_exclusive(self)
    |         ^^^ Use of undeclared type or module `sys`

error[E0433]: failed to resolve. Use of undeclared type or module `MmapInner`
   --> C:\Users\guilf\.cargo\registry\src\github.1485827954.workers.dev-1ecc6299db9ec823\memmap-0.5.2\src\lib.rs:130:9
    |
130 |         MmapInner::open(&file, prot, 0, len as usize).map(|inner| Mmap { inner: inner })
    |         ^^^^^^^^^ Use of undeclared type or module `MmapInner`
error[E0433]

Looking at memmap v0.5.2, I see the MmapInner module declared here if Windows target family and also on line 12 if Linux target family condition is met.

Is this occurring because wasm32-unknown-unknown is neither Windows nor Linux target family?

@alexcrichton
Copy link
Contributor

Ah yeah I believe this is an instance of a crate that isn't currently ported to wasm so the compilation error is coming out. The target_family for wasm32-unknown-unknown I think isn't set at all right now!

@hunterlester
Copy link
Author

Thank you. Is that what this issue and this as well are covering?

@alexcrichton
Copy link
Contributor

Sort of! In general though I'd guess that the memmap crate is going to need an entirely custom implementation for wasm in that we can't transparently use either of the existing Unix/Windows implementations. In that sense it's also a bug for memmap itself :(

@RReverser
Copy link
Member

I don't think real memmap is even possible for WASM currently unless it means shimming it to simply copy data for read-only mode.

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

No branches or pull requests

3 participants