haskell / haskell/cabal

--extra-lib-dirs and --extra-include-dirs ignored?

Open
#2,997 44 comments 2 reactions 1 assignee Claimed by @alt-romes View on GitHub
cabal-install: cmd/install cabal-install: v2-build system
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I tried compiling `hackage-server` with `new-build`, and `hackage-server` relies on `text-icu`, which in my case is installed in the brew `Cellar` and hence needs additional lib and include paths. However, doing

```
cabal-nix new-build \
--extra-include-dirs=/Users/e/homebrew/Cellar/icu4c/54.1/include \
--extra-lib-dirs=/Users/e/homebrew/Cellar/icu4c/54.1/lib
```

had no effect, nor had setting the `extra-include-dirs` and `extra-lib-dirs` flags in the global section of the `cabal.project` file. This worked though:

```
packages: hackage-server.cabal

package text-icu
extra-include-dirs: /Users/e/homebrew/Cellar/icu4c/54.1/include
extra-lib-dirs: /Users/e/homebrew/Cellar/icu4c/54.1/lib

package hackage-server
tests: True
```

(which arguably is the most logical way to configure this anyway, so perhaps this is merely a matter of warning the user that global lib/include flags are not taken into account for subpackages?).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.