Skip to content

Commit

Permalink
As in haskell#3974 and haskell#4105, but also dedupe PD.includeDirs
Browse files Browse the repository at this point in the history
… and `PD.extraLibDirs`.

Should help with big invocations as found in
NixOS/nixpkgs#41340.
  • Loading branch information
nh2 authored and colonelpanic8 committed Jun 4, 2018
1 parent 987570d commit 52cfe19
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 7 deletions.
40 changes: 37 additions & 3 deletions Cabal/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
### 2.2.0.1 [Mikhail Glushenkov](mailto:mikhail.glushenkov@gmail.com) March 2018
# 2.4.0.0 (current development version)

* Added `BlockArguments` to `KnownExtension` (#5101).
* Added `NumericUnderscores` to `KnownExtension` (#5130).
* `buildDepends` is removed from `PackageDescription`. It had long been
uselessly hanging about as top-level build-depends already got put
into per-component condition trees anyway. Now it's finally been put
out of its misery (#4383).
* Added `Eta` to `CompilerFlavor` and to known compilers.
* `cabal haddock` now generates per-component documentation (#5226).
* Allow `**` wildcards in `data-files`, `extra-source-files` and
`extra-doc-files`. These allow a limited form of recursive
matching, and require `cabal-version: 3.0`.

Wildcard syntax errors (misplaced `*`, etc) are also now detected
by `cabal check`.

`FileGlob`, `parseFileGlob`, `matchFileGlob` and `matchDirFileGlob`
have beem moved from `Distribution.Simple.Utils` to a new file,
`Distribution.Simple.Glob` and `FileGlob` has been made abstract.

(#5284, #3178, et al.)
* Fixed `cxx-options` and `cxx-sources` buildinfo fields for
separate compilation of C++ source files to correctly build and link
non-library components (#5309).
* Reduced warnings generated by hsc2hs and c2hs when `cxx-options` field
is present in a component.
* `cabal check` now warns if `-j` is used in `ghc-options` in a Cabal
file. (#5277)
* Cabal now dedupliates more `-I` and `-L` and flags to avoid `E2BIG`
(#5356)

----

## 2.2.0.1 (current 2.2 development version)

* Fix `checkPackageFiles` for relative directories ([#5206](https://github.com/haskell/cabal/issues/5206))

* Fix `checkPackageFiles` for relative directories
([#5206](https://github.com/haskell/cabal/issues/5206)).

# 2.2.0.0 [Mikhail Glushenkov](mailto:mikhail.glushenkov@gmail.com) March 2018

Expand Down
8 changes: 4 additions & 4 deletions Cabal/Distribution/Simple/Configure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1726,12 +1726,12 @@ checkForeignDeps pkg lbi verbosity =
-- should NOT be glomming everything together.)
++ [ "-I" ++ buildDir lbi </> "autogen" ]
-- `configure' may generate headers in the build directory
++ [ "-I" ++ buildDir lbi </> dir | dir <- collectField PD.includeDirs
++ [ "-I" ++ buildDir lbi </> dir | dir <- ordNub (collectField PD.includeDirs)
, not (isAbsolute dir)]
-- we might also reference headers from the packages directory.
++ [ "-I" ++ baseDir lbi </> dir | dir <- collectField PD.includeDirs
++ [ "-I" ++ baseDir lbi </> dir | dir <- ordNub (collectField PD.includeDirs)
, not (isAbsolute dir)]
++ [ "-I" ++ dir | dir <- collectField PD.includeDirs
++ [ "-I" ++ dir | dir <- ordNub (collectField PD.includeDirs)
, isAbsolute dir]
++ ["-I" ++ baseDir lbi]
++ collectField PD.cppOptions
Expand All @@ -1753,7 +1753,7 @@ checkForeignDeps pkg lbi verbosity =
| dep <- deps
, opt <- Installed.ccOptions dep ]

commonLdArgs = [ "-L" ++ dir | dir <- collectField PD.extraLibDirs ]
commonLdArgs = [ "-L" ++ dir | dir <- ordNub (collectField PD.extraLibDirs) ]
++ collectField PD.ldOptions
++ [ "-L" ++ dir
| dir <- ordNub [ dir
Expand Down

0 comments on commit 52cfe19

Please sign in to comment.