Skip to content

Build failure: haskellPackages.llvm-ffi #227412

@thielema

Description

@thielema

haskellPackages.llvm-ffi cannot be built because it cannot find the path of libLLVM-13.so.

Steps To Reproduce

nixpkgs$ nix-build --no-out-link -A haskellPackages.llvm-ffi --arg config '{ allowBroken = true; }'
...
Setup: Missing dependency on a foreign library:
* Missing (or bad) C library: LLVM-13
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.

builder for '/nix/store/nkqrqsabj1s309abk5mld46vg0w802bk-llvm-ffi-13.0.drv' failed with exit code 1
error: build of '/nix/store/nkqrqsabj1s309abk5mld46vg0w802bk-llvm-ffi-13.0.drv' failed

Idea for solution

When working with Cabal I would solve this problem by adding the options

--extra-include-dirs=$(llvm-config-13 --includedir) --extra-lib-dirs=$(llvm-config-13 --libdir)

or adding equivalent lines to a cabal.project.local file.
How can I achieve this in Nix?
What do I have to add to haskell-modules/configuration-common.nix?

Notify maintainers

@maralorn @sternenseemann

I have already asked about the problem at Discourse:
https://discourse.nixos.org/t/manually-setting-extra-include-dirs-and-extra-lib-dirs-for-haskell-cabal-packages/16222

Metadata

$ nix-channel --list
nixos https://nixos.org/channels/nixos-21.05
nixpkgs https://nixos.org/channels/nixos-21.05

But the problem still occurs in the current release (22.11).

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: build failureA package fails to build6.topic: haskellGeneral-purpose, statically typed, purely functional programming language
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions