Skip to content
This repository was archived by the owner on Feb 3, 2022. It is now read-only.

Commit f870630

Browse files
author
Gershom
committed
bump included versions and switch to bundling a prebuilt cabal
1 parent 6eb7104 commit f870630

File tree

7 files changed

+99
-82
lines changed

7 files changed

+99
-82
lines changed

hptool/src/Config.hs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module Config
66
, askGhcBinDistTarFile
77
, askBuildConfig
88
, addConfigOracle
9+
, askCabalExe
910
, askStackExe
1011
)
1112
where
@@ -69,6 +70,9 @@ askBuildConfig = readOracle "BuildConfig" (BuildConfigQ ())
6970
newtype StackExeQ = StackExeQ ()
7071
deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
7172

73+
newtype CabalExeQ = CabalExeQ ()
74+
deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
75+
7276
-- | Provide the stack executable
7377
-- The filepath will be tracked as a dependency
7478
askStackExe :: Action FilePath
@@ -77,12 +81,22 @@ askStackExe = do
7781
need [stackexe]
7882
return stackexe
7983

80-
addConfigOracle :: Release -> FilePath -> FilePath -> Maybe FilePath -> Bool -> Rules BuildConfig
81-
addConfigOracle hpRel tarFile stackexe prefix includeExtra = do
84+
-- | Provide the stack executable
85+
-- The filepath will be tracked as a dependency
86+
askCabalExe :: Action FilePath
87+
askCabalExe = do
88+
cabalexe <- askOracle $ CabalExeQ ()
89+
need [cabalexe]
90+
return cabalexe
91+
92+
addConfigOracle :: Release -> FilePath -> (FilePath,FilePath) -> Maybe FilePath -> Bool -> Rules BuildConfig
93+
addConfigOracle hpRel tarFile (cabalexe,stackexe) prefix includeExtra = do
8294
_ <- addOracle $
8395
\(HpReleaseQ _) -> return $ show hpRel
8496
_ <- addOracle $
8597
\(GhcBinDistTarFileQ _) -> return tarFile
98+
_ <- addOracle $
99+
\(CabalExeQ _) -> return cabalexe
86100
_ <- addOracle $
87101
\(StackExeQ _) -> return stackexe
88102
_ <- addOracle $

hptool/src/Main.hs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ main = hSetEncoding stdout utf8 >> shakeArgsWith opts flags main'
4343
if Info `elem` flgs
4444
then info
4545
else case args of
46-
(tarfile:stackexe:buildType) -> return $ Just $ do
47-
allRules tarfile stackexe flgs
46+
(tarfile:cabalexe:stackexe:buildType) -> return $ Just $ do
47+
allRules tarfile (cabalexe,stackexe) flgs
4848
want $ if null buildType then ["build-all"] else buildType
4949
_ -> usage
5050

@@ -58,18 +58,21 @@ main = hSetEncoding stdout utf8 >> shakeArgsWith opts flags main'
5858

5959
usage = do
6060
putStrLn "usage: hptool --info\n\
61-
\ hptool [opts] <ghc-bindist.tar.bz> <stack executable> [target...]\n\
61+
\ hptool [opts] <ghc-bindist.tar.bz> <cabal executable> <stack executable> [target...]\n\
6262
\ where target is one of:\n\
6363
\ build-all -- build everything (default)\n\
6464
\ build-source -- build the source tar ball\n\
6565
\ build-target -- build the target tree\n\
66+
\ build-product -- build the os specific installer\n\
6667
\ build-package-<pkg> -- build the package (name or name-ver)\n\
6768
\ build-local -- build the local GHC environment\n\
68-
\ build-website -- build the website\n"
69+
\ build-website -- build the website\n\
70+
\ and opts may be 'f' for a full rather than minimal build, 'i' for info\n\
71+
\ or 'prefix=...' to set a custom install location prefix for linux"
6972
return Nothing
7073

71-
allRules tarfile stackexe flgs = do
72-
buildConfig <- addConfigOracle hpRelease tarfile stackexe (prefixSetting flgs) (Full `elem` flgs)
74+
allRules tarfile stackcabalexe flgs = do
75+
buildConfig <- addConfigOracle hpRelease tarfile stackcabalexe (prefixSetting flgs) (Full `elem` flgs)
7376
ghcDistRules
7477
packageRules
7578
targetRules buildConfig
@@ -85,7 +88,7 @@ main = hSetEncoding stdout utf8 >> shakeArgsWith opts flags main'
8588

8689
opts = shakeOptions
8790

88-
hpRelease = hp_8_0_0
91+
hpRelease = hp_8_0_1
8992
hpFullName = show $ relVersion hpRelease
9093
srcTarFile = productDir </> hpFullName <.> "tar.gz"
9194

hptool/src/OS/Mac.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ macOsFromConfig BuildConfig{..} = OS{..}
110110
makeDirectory hpBinDir
111111
need [dir extrasDir]
112112
binFiles <- getDirectoryFiles "" [extrasDir </> "bin/*"]
113+
cabalExeFile <- askCabalExe
113114
stackFile <- askStackExe
114-
forM_ (stackFile:binFiles) $ \f -> do
115+
forM_ (cabalExeFile:stackFile:binFiles) $ \f -> do
115116
if takeExtension f == ".hs"
116117
then compileToBin f $ hpBinDir </> takeBaseName f
117118
else copyFile' f $ hpBinDir </> takeFileName f

hptool/src/OS/Posix.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@ posixOS BuildConfig{..} = OS{..}
116116
makeDirectory hpBinDir
117117
need [dir extrasDir]
118118
binFiles <- getDirectoryFiles "" [extrasDir </> "bin/*"]
119+
cabalFile <- askCabalExe
119120
stackFile <- askStackExe
120-
forM_ (stackFile:binFiles) $ \f -> do
121+
forM_ (cabalFile:stackFile:binFiles) $ \f -> do
121122
copyFile' f $ hpBinDir </> takeFileName f
122123
return Nothing
123124

hptool/src/OS/Win/WinRules.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ copyWinTargetExtras bc = do
7474
-- copy msys(msys2) pieces
7575
copyDirAction (winExternalMSysDir bc) winMSysTargetDir
7676

77+
-- copy cabal executable
78+
cabalFile <- askCabalExe
79+
copyFileAction (return ()) (takeDirectory cabalFile) (winHpTargetDir </> "bin") (takeFileName cabalFile)
80+
7781
-- copy stack executable
7882
stackFile <- askStackExe
7983
copyFileAction (return ()) (takeDirectory stackFile) (winHpTargetDir </> "bin") (takeFileName stackFile)

hptool/src/Package.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module Package
77

88
import Control.Applicative ((<$>))
99
import Data.Graph (flattenSCCs, stronglyConnComp)
10+
import Data.List (isPrefixOf, isInfixOf)
1011
#if MIN_VERSION_base(4,6,0)
1112
import Data.Ord (Down(..))
1213
#endif
@@ -96,9 +97,12 @@ installAction depFile hpRel = do
9697
("In order, the following would be installed (use -v for more details):":ls) ->
9798
let deps = map (head . words) ls
9899
in if all (`elem` packages) deps
100+
|| "alex" `isInfixOf` depFile
101+
|| "happy" `isInfixOf` depFile
102+
|| any (`isInfixOf` depFile) ["QuickCheck","tf-random"]
99103
then Right deps
100104
else Left $ "Depends on non-HP packages: "
101-
++ unwords (filter (not . (`elem` packages)) deps)
105+
++ unwords (filter (not . (`elem` packages)) deps) ++ "\n" ++ "Could not build " ++ depFile
102106
_ -> Left out
103107

104108
packages = map show $ (allPackages False) hpRel

hptool/src/Releases2016.hs

Lines changed: 60 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -4,112 +4,102 @@ import PlatformDB
44
import Types
55

66
releases2016 :: [Release]
7-
releases2016 = [hp_8_0_0]
7+
releases2016 = [hp_8_0_1]
88

99

10-
hp_8_0_0 :: Release
11-
hp_8_0_0 =
12-
releaseWithMinimal "8.0.0"
13-
[ incGHC "7.10.3"
10+
hp_8_0_1 :: Release
11+
hp_8_0_1 =
12+
releaseWithMinimal "8.0.1"
13+
[ incGHC "8.0.1"
1414

15-
, incGHCLib "Cabal" "1.22.5.0"
15+
, incGHCLib "Cabal" "1.24.0.0"
1616
, incGHCLib "array" "0.5.1.0"
17-
, incGHCLib "base" "4.8.2.0"
18-
, incGHCLib "bytestring" "0.10.6.0"
19-
, incGHCLib "containers" "0.5.6.2"
20-
, incGHCLib "deepseq" "1.4.1.1"
21-
, incGHCLib "directory" "1.2.2.0"
22-
, incGHCLib "filepath" "1.4.0.0"
23-
, incGHCLib "hpc" "0.6.0.2"
24-
, incGHCLib "pretty" "1.1.2.0"
25-
, incGHCLib "process" "1.2.3.0"
26-
, incGHCLib "template-haskell" "2.10.0.0"
27-
, incGHCLib "time" "1.5.0.1"
28-
, incGHCLib "transformers" "0.4.2.0"
17+
, incGHCLib "base" "4.9.0.0"
18+
, incGHCLib "bytestring" "0.10.7.0"
19+
, incGHCLib "containers" "0.5.7.1"
20+
, incGHCLib "deepseq" "1.4.2.0"
21+
, incGHCLib "directory" "1.2.5.1"
22+
, incGHCLib "filepath" "1.4.1.0"
23+
, incGHCLib "hpc" "0.6.0.3"
24+
, incGHCLib "pretty" "1.1.3.3"
25+
, incGHCLib "process" "1.4.2.0"
26+
, incGHCLib "template-haskell" "2.11.0.0"
27+
, incGHCLib "time" "1.6"
28+
, incGHCLib "transformers" "0.5.2.0"
2929
, incGHCLib "xhtml" "3000.2.1"
3030

3131
{- These packages are in the GHC distribution, and hence bundeled with
3232
the Platform. However, they are not officially part of the Platform,
3333
and as such, do not carry the same stability guaruntees.
3434
35-
, incGHCLib "bin-package-db" "0.0.0.0"
36-
, incGHCLib "binary" "0.7.5.0"
37-
, incGHCLib "ghc-prim" "0.4.0.0"
38-
, incGHCLib "haskeline" "0.7.2.1"
39-
, incGHCLib "hoopl" "3.10.0.2"
40-
, incGHCLib "integer-gmp" "1.0.0.0"
41-
, incGHCLib "terminfo" "0.4.0.1"
35+
, incGHCLib "binary" "0.8.2.1"
36+
, incGHCLib "ghc-prim" "0.5.0.0"
37+
, incGHCLib "haskeline" "0.7.2.2"
38+
, incGHCLib "hoopl" "3.10.2.1"
39+
, incGHCLib "integer-gmp" "1.0.0.1"
40+
, incGHCLib "terminfo" "0.4.0.2"
4241
-}
4342

44-
, notWindows $ incGHCLib "unix" "2.7.1.0"
43+
, notWindows $ incGHCLib "unix" "2.7.2.0"
44+
4545

4646
--, onlyWindows $ incGHCLib "Win32" "2.3.1.0"
47-
, incTool "cabal-install" "1.22.6.0"
47+
--, incTool "cabal-install" "1.25.0.0"
4848

49-
, incTool "alex" "3.1.4"
49+
, incTool "alex" "3.1.7"
5050
, incTool "happy" "1.19.5"
5151

52-
, incTool "hscolour" "1.23"
52+
, incTool "hscolour" "1.24"
5353
, incGHCTool "haddock" "2.16.1"
54-
5554
]
5655
[
57-
incLib "async" "2.0.2"
58-
, incLib "attoparsec" "0.13.0.1"
59-
, incLib "case-insensitive" "1.2.0.5"
60-
, incLib "cgi" "3001.2.2.2"
56+
incLib "async" "2.1.0"
57+
, incLib "attoparsec" "0.13.0.2"
58+
, incLib "case-insensitive" "1.2.0.6"
59+
-- , incLib "cgi" "3001.2.2.2"
6160
, incLib "fgl" "5.5.2.3"
62-
, incLib "GLUT" "2.7.0.3"
63-
, incLib "GLURaw" "1.5.0.2"
61+
, incLib "GLUT" "2.7.0.7"
62+
, incLib "GLURaw" "2.0.0.1"
6463
, incLib "haskell-src" "1.0.2.0"
65-
, incLib "hashable" "1.2.3.3"
64+
, incLib "hashable" "1.2.4.0"
6665
, incLib "html" "1.0.1.2"
67-
, incLib "HTTP" "4000.2.20"
68-
, incLib "HUnit" "1.3.0.0"
69-
, incLib "mtl" "2.2.1"
66+
, incLib "HTTP" "4000.3.3"
67+
, incLib "HUnit" "1.3.1.1"
7068
, incLib "network" "2.6.2.1"
71-
, incLib "OpenGL" "2.13.1.0"
72-
, incLib "OpenGLRaw" "2.6.0.0"
73-
, incLib "parallel" "3.2.0.6"
69+
, incLib "OpenGL" "3.0.0.2"
70+
, incLib "OpenGLRaw" "3.1.0.0"
71+
, incLib "parallel" "3.2.1.0"
7472
, incLib "parsec" "3.1.9"
75-
, incLib "primitive" "0.6.1.0"
76-
, incLib "QuickCheck" "2.8.1"
77-
, incLib "random" "1.1"
7873
, incLib "regex-base" "0.93.2"
7974
, incLib "regex-compat" "0.95.1"
8075
, incLib "regex-posix" "0.95.2"
81-
, incLib "split" "0.2.2"
82-
, incLib "stm" "2.4.4"
76+
, incLib "split" "0.2.3"
77+
, incLib "stm" "2.4.4.1"
8378
, incLib "syb" "0.6"
84-
, incLib "text" "1.2.1.3"
85-
, incLib "unordered-containers" "0.2.5.1"
79+
, incLib "text" "1.2.2.1"
80+
, incLib "unordered-containers" "0.2.7.0"
8681
, incLib "vector" "0.11.0.0"
87-
, incLib "zlib" "0.5.4.2"
88-
-- held back because cabal-install needs < 0.6 -- ick
82+
, incLib "zlib" "0.6.1.1"
83+
84+
--needed for happy or alex but otherwise would be in full only
85+
, incLib "mtl" "2.2.1"
86+
, incLib "primitive" "0.6.1.0"
87+
, incLib "random" "1.1"
88+
, incLib "QuickCheck" "2.8.2"
8989

9090
-- Libs required by newer version of stuff - but not cleared for HP
91-
, incLib "tf-random" "0.5"
92-
-- needed by alex & QuickCheck
9391

94-
-- these two were in the old HP
95-
, incLib "old-locale" "1.0.0.7"
96-
, incLib "old-time" "1.1.0.3"
97-
-- needed by cabal-install, cgi, & HTTP
92+
-- needed by alex & QuickCheck
93+
, incLib "tf-random" "0.5"
9894

9995
-- was split out of network, so was in HP, just under different pacakge
100-
, incLib "network-uri" "2.6.0.3"
101-
-- needed by cabal-install, cgi, & HTTP
102-
103-
-- needed by cgi
104-
, incLib "exceptions" "0.8.0.2"
105-
, incLib "transformers-compat" "0.4.0.4"
106-
, incLib "multipart" "0.1.2"
96+
, incLib "network-uri" "2.6.1.0"
10797

108-
-- needed by attoparsec, held back due to attoparsec
109-
, incLib "scientific" "0.3.3.8"
98+
-- needed by attoparsec
99+
, incLib "scientific" "0.3.4.6"
110100

111101
-- needed by OpenGL
112-
, incLib "ObjectName" "1.1.0.0"
113-
, incLib "StateVar" "1.1.0.1"
114-
, incLib "half" "0.2.2.1"
102+
, incLib "ObjectName" "1.1.0.1"
103+
, incLib "StateVar" "1.1.0.4"
104+
, incLib "half" "0.2.2.3"
115105
]

0 commit comments

Comments
 (0)