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

Commit aa73410

Browse files
committed
:Merge branch 'randen-win801a1'
2 parents e3015bc + e6eab5a commit aa73410

File tree

11 files changed

+22
-18
lines changed

11 files changed

+22
-18
lines changed

hptool/src/GhcDist.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cppCommandFlags cpp = case cpp of
3939

4040

4141
ghcInstall :: GhcInstall ->
42-
FilePath -> Maybe (BuildConfig -> FilePath) -> Action FilePath
42+
FilePath -> Maybe (BuildConfig -> FilePath) -> Action (Maybe FilePath)
4343
ghcInstall postUntarAction base mfPrefix = do
4444
tarFile <- askGhcBinDistTarFile
4545
conf <- askBuildConfig
@@ -74,7 +74,7 @@ ghcInstallConfigure base mfPrefix conf distDir = do
7474
Just cppCommand <- getCppCommand settings settingsFile
7575
writeSettings settingsFile (updateCppFlags cppCommand settings)
7676

77-
return destDir
77+
return . Just $ destDir
7878
where
7979
layout Nothing = (base, base)
8080
layout (Just p) = (p, base </+> p)
@@ -113,7 +113,7 @@ ghcDistRules = do
113113
ghcInstall postUntar ghcLocalDir Nothing >> return ()
114114
ghcVirtualTarget ~/> do
115115
postUntar <- osGhcTargetInstall . osFromConfig <$> askBuildConfig
116-
ghcInstall postUntar targetDir (Just targetPrefix) >>= return . Just
116+
ghcInstall postUntar targetDir (Just targetPrefix)
117117
where
118118
targetPrefix = osGhcPrefix . osFromConfig
119119

hptool/src/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ whatIsIncluded rel = ("-- Minimal Platform:":minimalIncludes) ++ ("-- Full Platf
110110
buildRules :: Release -> FilePath -> BuildConfig -> Rules()
111111
buildRules hpRelease srcTarFile bc = do
112112
"build-source" ~> need [srcTarFile]
113-
"build-target" ~> need [targetDir]
113+
"build-target" ~> need [phonyTargetDir]
114114
"build-product" ~> need [osProduct]
115115
"build-local" ~> need [dir ghcLocalDir]
116116
"build-website" ~> need [dir websiteDir]

hptool/src/OS/Internal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ genericOS BuildConfig{..} = OS{..}
124124
osProduct = productDir </> "generic.tar.gz"
125125
osRules _hpRelease _bc =
126126
osProduct %> \out -> do
127-
need [targetDir, vdir ghcVirtualTarget]
127+
need [phonyTargetDir, vdir ghcVirtualTarget]
128128
command_ [Cwd buildRoot]
129129
"tar" ["czf", out `relativeToDir` buildRoot, targetDir `relativeToDir` buildRoot]
130130

hptool/src/OS/Mac.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ macOsFromConfig BuildConfig{..} = OS{..}
140140

141141

142142
hpPkgFile %> \out -> do
143-
need [targetDir]
144-
need [dir extrasDir] -- FIXME(mzero): could be more specific
143+
need [phonyTargetDir, dir extrasDir] -- FIXME(mzero): could be more specific
145144
command_ []
146145
"pkgbuild"
147146
[ "--identifier", "org.haskell.HaskellPlatform.Libraries."

hptool/src/OS/Posix.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ posixOS BuildConfig{..} = OS{..}
9797
]
9898

9999
usrLocalTar %> \out -> do
100-
need [targetDir, vdir ghcVirtualTarget]
100+
need [phonyTargetDir, vdir ghcVirtualTarget]
101101
command_ [Cwd targetDir]
102102
"tar" ["czf", out `relativeToDir` targetDir, hpTargetDir `relativeToDir` targetDir]
103103

hptool/src/OS/Win.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ winOsFromConfig BuildConfig{..} = os
5454
-- dependencies on the contents of winGhcTargetDir won't account
5555
-- for the HP pieces. Also, for Windows, the ghc-bindist/local and
5656
-- the GHC installed into the targetDir should be identical.
57-
-- osTargetAction is the right place to do the targetDir snapshot.
57+
-- It is incorrect to return anything here since the
58+
-- dir which we just processed is not completed yet (as mentioned
59+
-- above, we need to await the hp-specific packages to be built).
5860
GhcInstallCustom $ \bc distDir -> do
5961
void $ winGhcInstall winGhcTargetDir bc distDir
60-
return ghcLocalDir
62+
return Nothing
6163

6264
osPackageTargetDir p = winHpPrefix </> packagePattern p
6365

@@ -135,7 +137,7 @@ winOsFromConfig BuildConfig{..} = os
135137
winRules
136138

137139
osProduct %> \_ -> do
138-
need $ [dir ghcLocalDir, targetDir, vdir ghcVirtualTarget]
140+
need $ [dir ghcLocalDir, phonyTargetDir, vdir ghcVirtualTarget]
139141
++ winNeeds
140142

141143
copyWinTargetExtras bc

hptool/src/OS/Win/WinNsis.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Text.Hastache.Context (mkStrContext)
1313
import Config
1414
import OS.Win.WinPaths
1515
import OS.Win.WinUtils
16-
import Paths ( installerPartsDir, targetDir )
16+
import Paths ( installerPartsDir, phonyTargetDir )
1717
import Templates
1818
import Types
1919
import Utils
@@ -22,11 +22,11 @@ import Utils
2222
genNsisData :: Rules ()
2323
genNsisData = do
2424
nsisInstDat %> \dFile -> do
25-
need [targetDir]
25+
need [phonyTargetDir]
2626
dirs <- getDirsFiles filterEmptyDirs
2727
genData nsisInstDatTmpl dFile dirs
2828
nsisUninstDat %> \uFile -> do
29-
need [targetDir]
29+
need [phonyTargetDir]
3030
dirs <- getDirsFiles sortByDirRev
3131
genData nsisUninstDatTmpl uFile dirs
3232
where

hptool/src/OS/Win/WinRules.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ winGhcInstall destDir bc distDir = do
5656
winGlutIncSrcs
5757
needContents winGlutIncludeInstallDir
5858

59-
return destDir
59+
return . Just $ destDir
6060

6161

6262
copyWinTargetExtras :: BuildConfig -> Action ()

hptool/src/Paths.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module Paths
1818
, listBuild, listCore, listSource
1919
, hpCabalFile
2020

21-
, targetDir
21+
, targetDir, phonyTargetDir
2222
, ghcVirtualTarget, hpVirtualTarget
2323

2424
, installerPartsDir, extrasDir
@@ -111,6 +111,9 @@ hpCabalFile = buildRoot </> "haskell-platform.cabal"
111111
targetDir :: FilePath
112112
targetDir = buildRoot </> "target"
113113

114+
phonyTargetDir :: FilePath
115+
phonyTargetDir = "PHONYtargetdir"
116+
114117
ghcVirtualTarget :: String
115118
ghcVirtualTarget = "target-ghc"
116119

hptool/src/Target.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ targetRules :: BuildConfig -> Rules ()
2525
targetRules bc = do
2626
buildRules
2727
installRules bc
28-
targetDir ~> do
28+
phonyTargetDir ~> do
2929
hpRel <- askHpRelease
3030
bc' <- askBuildConfig
3131
let OS{..} = osFromConfig bc'

0 commit comments

Comments
 (0)