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

Automatically discover location of libclang #78

Closed
edsko opened this issue Aug 6, 2024 · 2 comments · Fixed by #100
Closed

Automatically discover location of libclang #78

edsko opened this issue Aug 6, 2024 · 2 comments · Fixed by #100

Comments

@edsko
Copy link
Collaborator

edsko commented Aug 6, 2024

Unfortunately, libclang does not support pkg-config (llvm/llvm-project#9777). clang-pure uses a custom setup script which calls llvm-config, we might consider doing something similar. For now, we simply depend on something like this in cabal.project:

package hs-bindgen
  extra-lib-dirs:
    /usr/lib/llvm-18/lib
  extra-include-dirs:
    /usr/lib/llvm-18/include
@edsko edsko added this to the 1: `Storable` instances milestone Aug 6, 2024
@edsko
Copy link
Collaborator Author

edsko commented Aug 6, 2024

Not sure if we should use a custom Setup.hs script here, or make use of the new Hooks API (only available from cabal 3.14 and higher). Migration from the custom setup script to hooks later should not be too difficult, fortunately.

For more information on the new Hooks API, see @sheaf 's talk and the corresponding examples.

@phadej
Copy link
Collaborator

phadej commented Aug 19, 2024

build-type: Configure.

@phadej phadej mentioned this issue Aug 21, 2024
@sheaf sheaf removed their assignment Aug 21, 2024
phadej added a commit that referenced this issue Aug 21, 2024
Resolves #78.

Having C-dependencies in a separate package work-around unclear
behavior of `build-type: Configure` which seems to add extra definitions
to the main library only (`a-lib.buildinfo`; possibly we can have extra
buildinfos for other components too, but the file naming scheme is
mysterious).

On the other hand, separate package for `libclang` bindings might be a
good idea anyway. It's a separate self-contained functionality,
and e.g. `clang-tutorial` depends on that only (and could be pulled into
separate package as well, not to pollute the main thing).
phadej added a commit that referenced this issue Aug 21, 2024
Resolves #78.

Having C-dependencies in a separate package work-around unclear
behavior of `build-type: Configure` which seems to add extra definitions
to the main library only (`a-lib.buildinfo`; possibly we can have extra
buildinfos for other components too, but the file naming scheme is
mysterious).

On the other hand, separate package for `libclang` bindings might be a
good idea anyway. It's a separate self-contained functionality,
and e.g. `clang-tutorial` depends on that only (and could be pulled into
separate package as well, not to pollute the main thing).
phadej added a commit that referenced this issue Aug 21, 2024
Resolves #78.

Having C-dependencies in a separate package work-around unclear
behavior of `build-type: Configure` which seems to add extra definitions
to the main library only (`a-lib.buildinfo`; possibly we can have extra
buildinfos for other components too, but the file naming scheme is
mysterious).

On the other hand, separate package for `libclang` bindings might be a
good idea anyway. It's a separate self-contained functionality,
and e.g. `clang-tutorial` depends on that only (and could be pulled into
separate package as well, not to pollute the main thing).
phadej added a commit that referenced this issue Aug 21, 2024
Resolves #78.

Having C-dependencies in a separate package work-around unclear
behavior of `build-type: Configure` which seems to add extra definitions
to the main library only (`a-lib.buildinfo`; possibly we can have extra
buildinfos for other components too, but the file naming scheme is
mysterious).

On the other hand, separate package for `libclang` bindings might be a
good idea anyway. It's a separate self-contained functionality,
and e.g. `clang-tutorial` depends on that only (and could be pulled into
separate package as well, not to pollute the main thing).
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

Successfully merging a pull request may close this issue.

3 participants