diff options
author | Moritz Angermann <moritz.angermann@gmail.com> | 2018-03-03 16:16:41 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-03-03 21:50:31 -0500 |
commit | 8f0b2f5eadf0fcb47c581907205a9db686214a69 (patch) | |
tree | 63e503e73e17c1ac7d9439be27392bbad05652c6 | |
parent | 4631ceb261cb08756b955c6b495d5e719d35ab62 (diff) | |
download | haskell-8f0b2f5eadf0fcb47c581907205a9db686214a69.tar.gz |
Bump Cabal submodule to 2.2
Requires some ghc-cabal changes as well.
Test Plan: ./validate
Reviewers: hvr, bgamari
Reviewed By: bgamari
Subscribers: hsyl20, erikd, alpmestan, rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4453
m--------- | libraries/Cabal | 0 | ||||
-rw-r--r-- | libraries/base/configure.ac | 4 | ||||
-rw-r--r-- | rules/build-package.mk | 2 | ||||
-rw-r--r-- | testsuite/tests/driver/T4437.hs | 1 | ||||
-rw-r--r-- | utils/check-api-annotations/check-api-annotations.cabal | 2 | ||||
-rw-r--r-- | utils/check-ppr/check-ppr.cabal | 2 | ||||
-rw-r--r-- | utils/ghc-cabal/Main.hs | 31 | ||||
-rw-r--r-- | utils/ghc-cabal/ghc-cabal.cabal | 2 | ||||
-rw-r--r-- | utils/ghctags/ghctags.cabal | 2 |
9 files changed, 34 insertions, 12 deletions
diff --git a/libraries/Cabal b/libraries/Cabal -Subproject 578d3a50db818223017b8891df268d4200b8ffd +Subproject 98a72c9da6f56a9917b66d7532df755719ec7a2 diff --git a/libraries/base/configure.ac b/libraries/base/configure.ac index f472319a7e..a141a25a90 100644 --- a/libraries/base/configure.ac +++ b/libraries/base/configure.ac @@ -234,10 +234,10 @@ AS_IF([test "x$with_libcharset" != xno], fi # Hack - md5.h needs HsFFI.h. Is there a better way to do this? -CFLAGS="-I../../includes $CFLAGS" +CFLAGS="-I../.. -I../../../../includes $CFLAGS" dnl Calling AC_CHECK_TYPE(T) makes AC_CHECK_SIZEOF(T) abort on failure dnl instead of considering sizeof(T) as 0. -AC_CHECK_TYPE([struct MD5Context], [], [], [#include "include/md5.h"]) +AC_CHECK_TYPE([struct MD5Context], [], [AC_MSG_ERROR([internal error])], [#include "include/md5.h"]) AC_CHECK_SIZEOF([struct MD5Context], [], [#include "include/md5.h"]) AC_SUBST(EXTRA_LIBS) diff --git a/rules/build-package.mk b/rules/build-package.mk index fb04f02f27..c29155c582 100644 --- a/rules/build-package.mk +++ b/rules/build-package.mk @@ -155,7 +155,7 @@ endif # Don't put bootstrapping packages in the bindist ifneq "$3" "0" -BINDIST_EXTRAS += $1/*.cabal $$(wildcard $1/*.buildinfo) $1/$2/setup-config $1/LICENSE +BINDIST_EXTRAS += $1/*.cabal $$(wildcard $1/*.buildinfo) $$(wildcard $1/dist-install/build/*.buildinfo) $1/$2/setup-config $1/LICENSE BINDIST_EXTRAS += $$($1_$2_INSTALL_INCLUDES_SRCS) endif diff --git a/testsuite/tests/driver/T4437.hs b/testsuite/tests/driver/T4437.hs index d82e434b72..9f892c99a5 100644 --- a/testsuite/tests/driver/T4437.hs +++ b/testsuite/tests/driver/T4437.hs @@ -41,6 +41,7 @@ expectedGhcOnlyExtensions = ["RelaxedLayout", "AlternativeLayoutRuleTransitional", "EmptyDataDeriving", "NumericUnderscores", + "BlockArguments", "GeneralisedNewtypeDeriving"] expectedCabalOnlyExtensions :: [String] diff --git a/utils/check-api-annotations/check-api-annotations.cabal b/utils/check-api-annotations/check-api-annotations.cabal index f2b3d74e1c..3cdb378294 100644 --- a/utils/check-api-annotations/check-api-annotations.cabal +++ b/utils/check-api-annotations/check-api-annotations.cabal @@ -24,6 +24,6 @@ Executable check-api-annotations Build-Depends: base >= 4 && < 5, containers, - Cabal >= 2.1 && < 2.2, + Cabal >= 2.2 && < 2.3, directory, ghc diff --git a/utils/check-ppr/check-ppr.cabal b/utils/check-ppr/check-ppr.cabal index e788927196..d7429c82df 100644 --- a/utils/check-ppr/check-ppr.cabal +++ b/utils/check-ppr/check-ppr.cabal @@ -25,7 +25,7 @@ Executable check-ppr Build-Depends: base >= 4 && < 5, bytestring, containers, - Cabal >= 2.1 && < 2.2, + Cabal >= 2.2 && < 2.3, directory, filepath, ghc diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs index 3faf998ee7..a91889561b 100644 --- a/utils/ghc-cabal/Main.hs +++ b/utils/ghc-cabal/Main.hs @@ -15,7 +15,7 @@ import Distribution.Simple.GHC import Distribution.Simple.Program import Distribution.Simple.Program.HcPkg import Distribution.Simple.Setup (ConfigFlags(configStripLibs), fromFlag, toFlag) -import Distribution.Simple.Utils (defaultPackageDesc, writeFileAtomic, +import Distribution.Simple.Utils (defaultPackageDesc, findHookedPackageDesc, writeFileAtomic, toUTF8LBS) import Distribution.Simple.Build (writeAutogenFiles) import Distribution.Simple.Register @@ -27,6 +27,7 @@ import qualified Distribution.Simple.PackageIndex as PackageIndex import Control.Exception (bracket) import Control.Monad +import Control.Applicative ((<|>)) import Data.List import Data.Maybe import System.IO @@ -268,7 +269,13 @@ generate directory distdir config_args hooked_bi <- if (buildType pd0 == Configure) || (buildType pd0 == Custom) then do - maybe_infoFile <- defaultHookedPackageDesc + cwd <- getCurrentDirectory + -- Try to find the .buildinfo in the $dist/build folder where + -- cabal 2.2+ will expect it, but fallback to the old default + -- location if we don't find any. This is the case of the + -- bindist, which doesn't ship the $dist/build folder. + maybe_infoFile <- findHookedPackageDesc (cwd </> distdir </> "build") + <|> defaultHookedPackageDesc case maybe_infoFile of Nothing -> return emptyHookedBuildInfo Just infoFile -> readHookedBuildInfo verbosity infoFile @@ -284,13 +291,16 @@ generate directory distdir config_args -- generate inplace-pkg-config withLibLBI pd lbi $ \lib clbi -> do cwd <- getCurrentDirectory + let fixupIncludeDir dir | cwd `isPrefixOf` dir = [dir, cwd </> distdir </> "build" ++ drop (length cwd) dir] + | otherwise = [dir] let ipid = mkUnitId (display (packageId pd)) let installedPkgInfo = inplaceInstalledPackageInfo cwd distdir pd (mkAbiHash "inplace") lib lbi clbi final_ipi = installedPkgInfo { Installed.installedUnitId = ipid, Installed.compatPackageKey = display (packageId pd), - Installed.haddockHTMLs = [] + Installed.haddockHTMLs = [], + Installed.includeDirs = concatMap fixupIncludeDir (Installed.includeDirs installedPkgInfo) } content = Installed.showInstalledPackageInfo final_ipi ++ "\n" writeFileAtomic (distdir </> "inplace-pkg-config") @@ -369,11 +379,20 @@ generate directory distdir config_args mkLibraryRelDir "Cabal" = "libraries/Cabal/Cabal/dist-install/build" mkLibraryRelDir l = "libraries/" ++ l ++ "/dist-install/build" libraryRelDirs = map mkLibraryRelDir transitiveDepNames - wrappedIncludeDirs <- wrap $ forDeps Installed.includeDirs + + -- this is a hack to accommodate Cabal 2.2+ more hygenic + -- generated data. We'll inject `dist-install/build` after + -- before the `include` directory, if any. + injectDistInstall :: FilePath -> [FilePath] + injectDistInstall x | takeBaseName x == "include" = [x, takeDirectory x ++ "/dist-install/build/" ++ takeBaseName x] + injectDistInstall x = [x] + + wrappedIncludeDirs <- wrap $ concatMap injectDistInstall $ forDeps Installed.includeDirs let variablePrefix = directory ++ '_':distdir mods = map display modules otherMods = map display (otherModules bi) + buildDir' = map (\c -> if c=='\\' then '/' else c) $ buildDir lbi let xs = [variablePrefix ++ "_VERSION = " ++ display (pkgVersion (package pd)), -- TODO: move inside withLibLBI variablePrefix ++ "_COMPONENT_ID = " ++ localCompatPackageKey lbi, @@ -387,7 +406,9 @@ generate directory distdir config_args variablePrefix ++ "_DEP_COMPONENT_IDS = " ++ unwords depLibNames, variablePrefix ++ "_TRANSITIVE_DEP_NAMES = " ++ unwords transitiveDepNames, variablePrefix ++ "_TRANSITIVE_DEP_COMPONENT_IDS = " ++ unwords transitiveDepLibNames, - variablePrefix ++ "_INCLUDE_DIRS = " ++ unwords (includeDirs bi), + variablePrefix ++ "_INCLUDE_DIRS = " ++ unwords ( [ dir | dir <- includeDirs bi ] + ++ [ buildDir' ++ "/" ++ dir | dir <- includeDirs bi + , not (isAbsolute dir)]), variablePrefix ++ "_INCLUDES = " ++ unwords (includes bi), variablePrefix ++ "_INSTALL_INCLUDES = " ++ unwords (installIncludes bi), variablePrefix ++ "_EXTRA_LIBRARIES = " ++ unwords (extraLibs bi), diff --git a/utils/ghc-cabal/ghc-cabal.cabal b/utils/ghc-cabal/ghc-cabal.cabal index 7f413b6fc8..4b19116a4e 100644 --- a/utils/ghc-cabal/ghc-cabal.cabal +++ b/utils/ghc-cabal/ghc-cabal.cabal @@ -21,7 +21,7 @@ Executable ghc-cabal Build-Depends: base >= 3 && < 5, bytestring >= 0.10 && < 0.11, - Cabal >= 2.1 && < 2.2, + Cabal >= 2.2 && < 2.3, directory >= 1.1 && < 1.4, filepath >= 1.2 && < 1.5 diff --git a/utils/ghctags/ghctags.cabal b/utils/ghctags/ghctags.cabal index 0e2bc5252e..c798a9336b 100644 --- a/utils/ghctags/ghctags.cabal +++ b/utils/ghctags/ghctags.cabal @@ -18,6 +18,6 @@ Executable ghctags Build-Depends: base >= 4 && < 5, containers, - Cabal >= 2.1 && <2.2, + Cabal >= 2.2 && <2.3, ghc |