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

Installing the crate in a macbook machine #320

Closed
Owen-CH-Leung opened this issue Jan 17, 2024 · 8 comments · Fixed by #331
Closed

Installing the crate in a macbook machine #320

Owen-CH-Leung opened this issue Jan 17, 2024 · 8 comments · Fixed by #331
Assignees

Comments

@Owen-CH-Leung
Copy link
Contributor

I tried to install this crate into my macbook machine following the documentation. So I run:

cargo install --locked cargo-spellcheck

which returned the following error when compiling:

error: failed to run custom build command for `hunspell-sys v0.3.1`

Caused by:
  process didn't exit successfully: `/var/folders/0n/fkgm548x15q996h51xlpc2rh0000gn/T/cargo-installS4VX2v/release/build/hunspell-sys-2aba3f0e9baf644a/build-script-build` (signal: 6, SIGABRT: process abort signal)
  --- stderr
  dyld[28610]: Library not loaded: @rpath/libclang.dylib
    Referenced from: <4E7CEE65-E915-386C-83A4-83815EA2231B> /private/var/folders/0n/fkgm548x15q996h51xlpc2rh0000gn/T/cargo-installS4VX2v/release/build/hunspell-sys-2aba3f0e9baf644a/build-script-build
    Reason: tried: '/var/folders/0n/fkgm548x15q996h51xlpc2rh0000gn/T/cargo-installS4VX2v/release/deps/libclang.dylib' (no such file), '/var/folders/0n/fkgm548x15q996h51xlpc2rh0000gn/T/cargo-installS4VX2v/release/libclang.dylib' (no such file)

It's complaining that the dynamic linker is unable to locate the libclang.dylib library on the machine. After some googling, I managed to resolve the issue with the following command

export DYLD_FALLBACK_LIBRARY_PATH="$(xcode-select --print-path)/Toolchains/XcodeDefault.xctoolchain/usr/lib/" && cargo install --locked cargo-spellcheck

I believe we can enrich the installation guide a bit to specify the necessary env variable that needs to be present in order to install the crate successfully (for all the 3 OS: Windows, Linux & Mac).

@drahnr
Copy link
Owner

drahnr commented Jan 19, 2024

I'd be happy to include this as part of the README.md, could you create such a PR?

@jgrund
Copy link

jgrund commented Mar 6, 2024

On MacOS 14.2, I needed to do the following:

export DYLD_FALLBACK_LIBRARY_PATH="$(xcode-select --print-path)/usr/lib" && cargo install --locked cargo-spellcheck

@drahnr
Copy link
Owner

drahnr commented Mar 7, 2024

@Owen-CH-Leung which OS X version did you test your instructions with?
@jgrund I am curious how your setup differs from @Owen-CH-Leung 's

@Owen-CH-Leung
Copy link
Contributor Author

I tested the instructions with macOs Sonoma 14.1.1

@drahnr
Copy link
Owner

drahnr commented Mar 7, 2024

I tested the instructions with macOs Sonoma 14.1.1

Do @jgrund's instruction work there too?

@Owen-CH-Leung
Copy link
Contributor Author

No it errors out:

error: failed to run custom build command for `hunspell-sys v0.3.1`

Caused by:
  process didn't exit successfully: `/var/folders/0n/fkgm548x15q996h51xlpc2rh0000gn/T/cargo-install78RxcC/release/build/hunspell-sys-577c44aadb168bc2/build-script-build` (signal: 6, SIGABRT: process abort signal)
  --- stderr
  dyld[74671]: Library not loaded: @rpath/libclang.dylib
    Referenced from: <0A527F70-81F5-3FEF-B909-A98787A7F277> /private/var/folders/0n/fkgm548x15q996h51xlpc2rh0000gn/T/cargo-install78RxcC/release/build/hunspell-sys-577c44aadb168bc2/build-script-build
    Reason: tried: '/var/folders/0n/fkgm548x15q996h51xlpc2rh0000gn/T/cargo-install78RxcC/release/deps/libclang.dylib' (no such file), '/var/folders/0n/fkgm548x15q996h51xlpc2rh0000gn/T/cargo-install78RxcC/release/libclang.dylib' (no such file), '/opt/homebrew/Cellar/rust/1.76.0/lib/rustlib/aarch64-apple-darwin/lib/libclang.dylib' (no such file), '/Applications/Xcode.app/Contents/Developer/usr/lib/libclang.dylib' (no such file)
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-spellcheck v0.13.2`, intermediate artifacts can be found at `/var/folders/0n/fkgm548x15q996h51xlpc2rh0000gn/T/cargo-install78RxcC`.

@drahnr
Copy link
Owner

drahnr commented Mar 7, 2024

@jgrund could you create PR making it per OS X version?

@johnsonw
Copy link

I'm on OS X Ventura (13.4) and setting the following environment variable as @jgrund stated worked for me:

export DYLD_FALLBACK_LIBRARY_PATH="$(xcode-select --print-path)/usr/lib"

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