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

target_family condition not met #66

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

Comments

Projects
None yet
3 participants
@hunterlester
Copy link

hunterlester commented Mar 11, 2018

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.com-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

This comment has been minimized.

Copy link
Collaborator

alexcrichton commented Mar 12, 2018

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

This comment has been minimized.

Copy link

hunterlester commented Mar 12, 2018

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

@alexcrichton

This comment has been minimized.

Copy link
Collaborator

alexcrichton commented Mar 12, 2018

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 :(

@hunterlester hunterlester referenced this issue Mar 12, 2018

Open

blocking #1

@RReverser

This comment has been minimized.

Copy link
Member

RReverser commented Mar 12, 2018

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