Code Monkey home page Code Monkey logo

Comments (6)

drahnr avatar drahnr commented on May 29, 2024

The difference here is, that you will create dynamically linked binary, which is not the preferred way of shipping hunspell, since different versions of hunspell exhibit different bugs. A defined version is much easier to handle.

Hence, the main question to me is, where is you clang.so?

I have a few:

# fd clang.so /usr
/usr/lib64/llvm13/lib/libclang.so.13.0.1
/usr/lib64/llvm13/lib/libclang.so.13
/usr/lib64/libclang.so.13
/usr/lib64/libclang.so.14.0.5
/usr/lib64/libclang.so
/usr/lib64/llvm12/lib/libclang.so.12
/usr/lib64/llvm11/lib/libclang.so.11.1
/usr/lib64/llvm6.0/lib/libclang.so
/usr/lib64/llvm6.0/lib/libclang.so.6.0
/usr/lib64/llvm5.0/lib/libclang.so.5
/usr/lib64/llvm5.0/lib/libclang.so
/usr/lib64/llvm5.0/lib/libclang.so.5.0
/usr/lib64/llvm6.0/lib/libclang.so.6

from cargo-spellcheck.

ehuss avatar ehuss commented on May 29, 2024

The difference here is, that you will create dynamically linked binary

Can you say why that would be? From the binaries I created, I only see the standard system shared libraries. The bundled feature of hunspell should ensure that hunspell is linked statically.

Hence, the main question to me is, where is you clang.so?

On my Linux system I have:

/usr/lib/llvm-6.0/lib/libclang.so.1
/usr/lib/llvm-10/lib/libclang.so.1

on macOS I happen to have:

/usr/local/Cellar/llvm/15.0.6/lib/libclang.dylib

from cargo-spellcheck.

drahnr avatar drahnr commented on May 29, 2024

By adding hunspell-sys with default features you enable bindgens runtime feature and enables dynamic linkage of clang.so - so while it links all other libs statically, libclang.so becomes dynamically linked.

So to me, the behavior should be inverted to what you see.

Did you try to follow the suggestion to set an env LIBCLANG_PATH to give the clang-sys dependency a hint?

On fedora, this is not reproducible, I run cargo install --path ./cargo-spellcheck every other week, and fedora based CI is happy too.

I'd be happy to review a PR with a sound explanation to your observations, I currently can't make sense of them.

A good startingpoint are Cargo.lock, Cargo.toml and build.rs (where it exists) of hunspell-rs, hunspell-sys, clang-sys, bindgen.

from cargo-spellcheck.

drahnr avatar drahnr commented on May 29, 2024

I am closing for the time being, please use the pre compiled artifacts if there are issues with your distribution. I don't have capacity to test them all, I am very happy to merge PRs that would solve the issue for you.

from cargo-spellcheck.

zoechi avatar zoechi commented on May 29, 2024

I had to sudo apt install libclang-dev on Debian to get rid of this error

from cargo-spellcheck.

dandanlen avatar dandanlen commented on May 29, 2024

Did you try to follow the suggestion to set an env LIBCLANG_PATH to give the clang-sys dependency a hint?

This worked for me on MacOS.

In my case:

export LIBCLANG_PATH=/opt/homebrew/opt/llvm/lib
cargo install --locked cargo-spellcheck

from cargo-spellcheck.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.