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

cargo install fails under Windows #14

Closed
msuesskraut opened this issue Jun 11, 2020 · 6 comments · Fixed by #71
Closed

cargo install fails under Windows #14

msuesskraut opened this issue Jun 11, 2020 · 6 comments · Fixed by #71
Labels
documentation 📚 Improvements or additions to documentation help wanted 🤝 Extra attention is needed

Comments

@msuesskraut
Copy link

Installing cargo-spellcheck fails under Windows 10:

cargo install cargo-spellcheck
Updating crates.io index
Installing cargo-spellcheck v0.1.0
...
Compiling hunspell-sys v0.1.3
error: failed to run custom build command for hunspell-sys v0.1.3

Caused by:
process didn't exit successfully: C:\Users\<...>\AppData\Local\Temp\cargo-install3YNVZA\release\build\hunspell-sys-9a099962c3dfc468\build-script-build (exit code: 101)
--- stdout
running: "autoreconf" "-ivf"

--- stderr
thread 'main' panicked at '
failed to execute command: Das System kann die angegebene Datei nicht finden. (os error 2)
is autoreconf not installed?

build script failed, must exit now', C:\Users<...>.cargo\registry\src\jackfan.us.kg-1ecc6299db9ec823\autotools-0.2.1\src\lib.rs:449:5
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

warning: build failed, waiting for other jobs to finish...
error: failed to compile cargo-spellcheck v0.1.0, intermediate artifacts can be found at C:\Users\<...>\AppData\Local\Temp\cargo-install3YNVZA

Caused by:
build failed

I have installed hunspell with chocolatey. But it does not help. Chocolatey does not install any libs and it seams that hunspell-sys contains the hunspell code and tries to build it with the autotools, which just are not available under Windows.

I recognize, that the error is not in cargo-spellcheck itself but in its dependencies. Has someone expirence to install cargo-spellcheck under Windows? If yes, it would be nice to document, how to do this.

@drahnr
Copy link
Owner

drahnr commented Jun 11, 2020

https://github.com/euclio/hunspell-sys/blob/master/build.rs#L18-L22 shows that if there is no hunspell library picked up by pkg-config, it tries to build one with autotools - so either you make pkg-config (usually via providing an extra search path PKG_CONFIG_PATH, ; delimited iirc and in addition to the default search paths) aware of your installation, or you install autotools too (caveat: I have very limited experience with windows)

@drahnr drahnr added documentation 📚 Improvements or additions to documentation help wanted 🤝 Extra attention is needed labels Jun 12, 2020
@drahnr
Copy link
Owner

drahnr commented Jun 12, 2020

It would be awesome if you could provide some more detail or if you already made it work, provide the steps to get there so I can add it to the README file :) thanks!

@msuesskraut
Copy link
Author

msuesskraut commented Jun 12, 2020 via email

@drahnr
Copy link
Owner

drahnr commented Jun 12, 2020

I could potentially provide binaries as part of the releases, which would contain cross compiled windows binaries - fedora provides mingw64 precompiled hunspell libs, but that really would be more of a band-aid solution.
cargo install cargo-spellcheck is supposed to be the primary install path and that must work in any case, I'd rather fix hunspell than requiring users to deal with msys / mingw.

Please keep me updated on your findings!

@msuesskraut
Copy link
Author

What I found out: hunspell-sys does not compile with the msvc build chain. hunspell itself contains a msvc project, but that failed with Visual Studio 2017 for me.

However, it is possible to compile hunspell with msvc in the build.rs of hunspell-sys. Tests of hunspell-sys pass.

I submitted a pull-request to hunspell-sys: euclio/hunspell-sys#2 with that hopefully hunspell-sys becomes also usable under Windows with x86_64-pc-windows-msvc rust. And, hence, cargo-spellcheck should become installable by cargo install cargo-spellcheck.

Btw. using msys2 with my msvc based rust installation did not work.

@drahnr
Copy link
Owner

drahnr commented Jun 23, 2020

At this point it might make sense to fork hunspell-sys and use that until the details are hashed out with "upstream"

drahnr added a commit that referenced this issue Jul 10, 2020
drahnr added a commit that referenced this issue Jul 10, 2020
drahnr added a commit that referenced this issue Jul 10, 2020
drahnr added a commit that referenced this issue Jul 16, 2020
To fully function, requres impl of #25 to not assert.

Closes #14
drahnr added a commit that referenced this issue Jul 23, 2020
To fully function, requres impl of #25 to not assert.

Closes #14
drahnr added a commit that referenced this issue Aug 19, 2020
To fully function, requres impl of #25 to not assert.

Closes #14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation 📚 Improvements or additions to documentation help wanted 🤝 Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants