--extra-include-dirs and --extra-lib-dirs not respected when building Setup itself
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
As you may be aware, the first thing that Cabal does upon configure is, if there is a Setup.hs script, attempt to compile it. This compilation does not appear to respect the usual options that apply to every other compilation, including the two named above: --extra-include-dirs and --extra-lib-dirs.
This is a problem, because some systems do not have global /usr and /lib directories, but rather put these things elsewhere. In particular, it has always been the case on the Mac really that one is _supposed_ to be using paths within the SDK directory rather than global paths, to allow for compilation to target other versions of OS X than the one currently running. Now in this year's 10.NDA release, the global paths are removed entirely.
This problem appears to apply regardless of whether the paths are specified in ~/.cabal/config, or on the command line.
Things have gotten to this point without totally breaking because not every package uses a custom Setup.hs, so this build step doesn't always need to be done.
Tested on:
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library
I'll have a pull request shortly for everyone to ignore. You're welcome.
Contributor guide
Research direction
Start by reproducing the configure step with a package that uses a custom Setup.hs, passing --extra-include-dirs and --extra-lib-dirs both on the command line and through ~/.cabal/config. Trace the initial Setup.hs compilation and verify that both options are applied there, including on systems without global /usr and /lib paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100