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

Add mmap feature to fst-regex Cargo.toml and forward it to its fst dependency #70

Closed
fulmicoton opened this issue Oct 3, 2018 · 2 comments

Comments

@fulmicoton
Copy link
Contributor

Tantivy depends on both fst and fst-regex.

I am trying to compile tantivy to web assembly.
In order to remove the dependency to memmap, I added a mmap default feature.
The same strategy is used in the fst crate, so I forward the feature to the fst crate.

Unfortunately, fst-regex also depends on the fst crate and does not have any such feature, so tantivy
ends up depending on memmap either way.

Could we add a mmap default feature in the fst-regex crate too?
Is there another solution?

@BurntSushi
Copy link
Owner

Interesting. So even if you depend on fst and fst-regex where you disable the mmap feature for fst, the fst-regex dependency overrules that and includes memmap anyway?

If so, I'm OK with adding an mmap feature to fst-regex.

Is there another solution?

Another possibility is to make the memmap crate compile on wasm, but always produce an error when attempting to create a memory map. I don't know whether that's the right solution or not though.

fulmicoton added a commit to fulmicoton/fst that referenced this issue Oct 7, 2018
The feature is there by default and just enables the `mmap` feature
in the fst crate when unabled.

Closes BurntSushi#70
fulmicoton added a commit to fulmicoton/fst that referenced this issue Oct 7, 2018
The feature is there by default and just enables the `mmap` feature
in the fst crate when unabled.

Closes BurntSushi#70
fulmicoton added a commit to fulmicoton/fst that referenced this issue Oct 7, 2018
The feature is there by default and just enables the `mmap` feature
in the fst crate when unabled.

Closes BurntSushi#70
@fulmicoton
Copy link
Contributor Author

@BurntSushi Yes.

I sent you a PR and verified the fix addressed the problem.

BurntSushi pushed a commit that referenced this issue Nov 5, 2018
The feature is there by default and just enables the `mmap` feature
in the fst crate when enabled.

Closes #70
bors bot added a commit to rust-lang/rust-analyzer that referenced this issue Mar 22, 2019
1021: Wasm dependencies r=matklad a=detrumi

As a first step towards running RA on WASM (see #1007), this tweaks the dependencies somewhat so that projects built using `wasm-pack` can use `ra_ide_api` as a dependency.

There were two problems:
- use of undeclared type or module `MmapInner`
This error occurred because of the `memmap` crate, as a dependency of `fst`
Solution: specify `default-features = false` for the `fst` package (see BurntSushi/fst#70)

- use of undeclared type or module `imp`
This happened in the `wait-timeout` crate ([which uses `Command` under the hood](alexcrichton/wait-timeout#18)), a dependency of `rusty-fork` which is a dependency of `proptest`.
Solution: move `proptest` to dev-dependencies and add `#[cfg(test)]` to the `test_utils` crate.
**Edit:** Oh, that causes trouble with resolving the import when running the tests. Hmm...

Co-authored-by: Wilco Kusee <wilcokusee@gmail.com>
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

2 participants