summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Angermann <moritz.angermann@gmail.com>2017-11-16 22:54:11 +0800
committerMoritz Angermann <moritz.angermann@gmail.com>2017-11-18 11:06:45 +0800
commit835d8ddbbfb11796ea8a03d1806b7cee38ba17a6 (patch)
tree61e7681171e65484e647fc2ddde97bd450051931
parent12a7444463184e9eddbe7b7251a0ee1e976f4d75 (diff)
downloadhaskell-835d8ddbbfb11796ea8a03d1806b7cee38ba17a6.tar.gz
GHC.Prim use virtual-modules
Stop the GHC.Prim madness with `virtual-module` support from cabal. Needs https://github.com/haskell/cabal/pull/4875. Bumps submodule libraries/Cabal to include the necessary logic for `virtual-module`. Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4179
-rw-r--r--ghc.mk10
m---------libraries/Cabal0
-rw-r--r--libraries/ghc-prim/ghc-prim.cabal12
-rw-r--r--utils/ghc-cabal/Main.hs16
4 files changed, 7 insertions, 31 deletions
diff --git a/ghc.mk b/ghc.mk
index 8918441b83..e653aae88f 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -598,15 +598,9 @@ libraries/ghci_dist-install_CONFIGURE_OPTS += --flags=ghci
# We want the ghc-prim package to include the GHC.Prim module when it
# is registered, but not when it is built, because GHC.Prim is not a
-# real source module, it is built-in to GHC. The old build system did
-# this using Setup.hs, but we can't do that here, so we have a flag to
-# enable GHC.Prim in the .cabal file (so that the ghc-prim package
-# remains compatible with the old build system for the time being).
-# GHC.Prim module in the ghc-prim package with a flag:
-#
-libraries/ghc-prim_CONFIGURE_OPTS += --flag=include-ghc-prim
+# real source module, it is built-in to GHC.
-# And then we strip it out again before building the package:
+# Strip it out again before building the package:
define libraries/ghc-prim_PACKAGE_MAGIC
libraries/ghc-prim_dist-install_MODULES := $$(filter-out GHC.Prim,$$(libraries/ghc-prim_dist-install_MODULES))
endef
diff --git a/libraries/Cabal b/libraries/Cabal
-Subproject 357d49d826004c022f3b4871f16d753e1b932b5
+Subproject 97c66f2c7698f0aea4277acb66b918b7341b3d0
diff --git a/libraries/ghc-prim/ghc-prim.cabal b/libraries/ghc-prim/ghc-prim.cabal
index ca50808469..9b8c1ac196 100644
--- a/libraries/ghc-prim/ghc-prim.cabal
+++ b/libraries/ghc-prim/ghc-prim.cabal
@@ -1,3 +1,4 @@
+cabal-version: 2.1
name: ghc-prim
version: 0.5.2.0
-- NOTE: Don't forget to update ./changelog.md
@@ -7,7 +8,6 @@ category: GHC
maintainer: libraries@haskell.org
bug-reports: http://ghc.haskell.org/trac/ghc/newticket?component=libraries%20%28other%29&keywords=ghc-prim
synopsis: GHC primitives
-cabal-version: >=1.10
build-type: Custom
description:
This package contains the primitive types and operations supplied by GHC.
@@ -19,10 +19,6 @@ source-repository head
location: http://git.haskell.org/ghc.git
subdir: libraries/ghc-prim
-flag include-ghc-prim
- Description: Include GHC.Prim in exposed-modules
- default: False
-
custom-setup
setup-depends: base >= 4 && < 5, Cabal >= 1.23
@@ -53,6 +49,9 @@ Library
GHC.Tuple
GHC.Types
+ virtual-modules:
+ GHC.Prim
+
-- OS Specific
if os(windows)
-- Windows requires some extra libraries for linking because the RTS
@@ -67,9 +66,6 @@ Library
-- on Windows. Required because of mingw32.
extra-libraries: user32, mingw32, mingwex
- if flag(include-ghc-prim)
- exposed-modules: GHC.Prim
-
c-sources:
cbits/atomic.c
cbits/bswap.c
diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs
index 9d0ffcff9a..440ab0b7d0 100644
--- a/utils/ghc-cabal/Main.hs
+++ b/utils/ghc-cabal/Main.hs
@@ -145,26 +145,12 @@ doCopy directory distDir
else ["--destdir", myDestDir])
++ args
copyHooks = userHooks {
- copyHook = noGhcPrimHook
- $ modHook False
+ copyHook = modHook False
$ copyHook userHooks
}
defaultMainWithHooksArgs copyHooks copyArgs
where
- noGhcPrimHook f pd lbi us flags
- = let pd'
- | packageName pd == mkPackageName "ghc-prim" =
- case library pd of
- Just lib ->
- let ghcPrim = fromJust (simpleParse "GHC.Prim")
- ems = filter (ghcPrim /=) (exposedModules lib)
- lib' = lib { exposedModules = ems }
- in pd { library = Just lib' }
- Nothing ->
- error "Expected a library, but none found"
- | otherwise = pd
- in f pd' lbi us flags
modHook relocatableBuild f pd lbi us flags
= do let verbosity = normal
idts = updateInstallDirTemplates relocatableBuild