This repository was archived by the owner on Feb 3, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 11 files changed +22
-18
lines changed Expand file tree Collapse file tree 11 files changed +22
-18
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ cppCommandFlags cpp = case cpp of
39
39
40
40
41
41
ghcInstall :: GhcInstall ->
42
- FilePath -> Maybe (BuildConfig -> FilePath ) -> Action FilePath
42
+ FilePath -> Maybe (BuildConfig -> FilePath ) -> Action ( Maybe FilePath )
43
43
ghcInstall postUntarAction base mfPrefix = do
44
44
tarFile <- askGhcBinDistTarFile
45
45
conf <- askBuildConfig
@@ -74,7 +74,7 @@ ghcInstallConfigure base mfPrefix conf distDir = do
74
74
Just cppCommand <- getCppCommand settings settingsFile
75
75
writeSettings settingsFile (updateCppFlags cppCommand settings)
76
76
77
- return destDir
77
+ return . Just $ destDir
78
78
where
79
79
layout Nothing = (base, base)
80
80
layout (Just p) = (p, base </+> p)
@@ -113,7 +113,7 @@ ghcDistRules = do
113
113
ghcInstall postUntar ghcLocalDir Nothing >> return ()
114
114
ghcVirtualTarget ~/> do
115
115
postUntar <- osGhcTargetInstall . osFromConfig <$> askBuildConfig
116
- ghcInstall postUntar targetDir (Just targetPrefix) >>= return . Just
116
+ ghcInstall postUntar targetDir (Just targetPrefix)
117
117
where
118
118
targetPrefix = osGhcPrefix . osFromConfig
119
119
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ whatIsIncluded rel = ("-- Minimal Platform:":minimalIncludes) ++ ("-- Full Platf
110
110
buildRules :: Release -> FilePath -> BuildConfig -> Rules ()
111
111
buildRules hpRelease srcTarFile bc = do
112
112
" build-source" ~> need [srcTarFile]
113
- " build-target" ~> need [targetDir ]
113
+ " build-target" ~> need [phonyTargetDir ]
114
114
" build-product" ~> need [osProduct]
115
115
" build-local" ~> need [dir ghcLocalDir]
116
116
" build-website" ~> need [dir websiteDir]
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ genericOS BuildConfig{..} = OS{..}
124
124
osProduct = productDir </> " generic.tar.gz"
125
125
osRules _hpRelease _bc =
126
126
osProduct %> \ out -> do
127
- need [targetDir , vdir ghcVirtualTarget]
127
+ need [phonyTargetDir , vdir ghcVirtualTarget]
128
128
command_ [Cwd buildRoot]
129
129
" tar" [" czf" , out `relativeToDir` buildRoot, targetDir `relativeToDir` buildRoot]
130
130
Original file line number Diff line number Diff line change @@ -140,8 +140,7 @@ macOsFromConfig BuildConfig{..} = OS{..}
140
140
141
141
142
142
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
145
144
command_ []
146
145
" pkgbuild"
147
146
[ " --identifier" , " org.haskell.HaskellPlatform.Libraries."
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ posixOS BuildConfig{..} = OS{..}
97
97
]
98
98
99
99
usrLocalTar %> \ out -> do
100
- need [targetDir , vdir ghcVirtualTarget]
100
+ need [phonyTargetDir , vdir ghcVirtualTarget]
101
101
command_ [Cwd targetDir]
102
102
" tar" [" czf" , out `relativeToDir` targetDir, hpTargetDir `relativeToDir` targetDir]
103
103
Original file line number Diff line number Diff line change @@ -54,10 +54,12 @@ winOsFromConfig BuildConfig{..} = os
54
54
-- dependencies on the contents of winGhcTargetDir won't account
55
55
-- for the HP pieces. Also, for Windows, the ghc-bindist/local and
56
56
-- 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).
58
60
GhcInstallCustom $ \ bc distDir -> do
59
61
void $ winGhcInstall winGhcTargetDir bc distDir
60
- return ghcLocalDir
62
+ return Nothing
61
63
62
64
osPackageTargetDir p = winHpPrefix </> packagePattern p
63
65
@@ -135,7 +137,7 @@ winOsFromConfig BuildConfig{..} = os
135
137
winRules
136
138
137
139
osProduct %> \ _ -> do
138
- need $ [dir ghcLocalDir, targetDir , vdir ghcVirtualTarget]
140
+ need $ [dir ghcLocalDir, phonyTargetDir , vdir ghcVirtualTarget]
139
141
++ winNeeds
140
142
141
143
copyWinTargetExtras bc
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import Text.Hastache.Context (mkStrContext)
13
13
import Config
14
14
import OS.Win.WinPaths
15
15
import OS.Win.WinUtils
16
- import Paths ( installerPartsDir , targetDir )
16
+ import Paths ( installerPartsDir , phonyTargetDir )
17
17
import Templates
18
18
import Types
19
19
import Utils
@@ -22,11 +22,11 @@ import Utils
22
22
genNsisData :: Rules ()
23
23
genNsisData = do
24
24
nsisInstDat %> \ dFile -> do
25
- need [targetDir ]
25
+ need [phonyTargetDir ]
26
26
dirs <- getDirsFiles filterEmptyDirs
27
27
genData nsisInstDatTmpl dFile dirs
28
28
nsisUninstDat %> \ uFile -> do
29
- need [targetDir ]
29
+ need [phonyTargetDir ]
30
30
dirs <- getDirsFiles sortByDirRev
31
31
genData nsisUninstDatTmpl uFile dirs
32
32
where
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ winGhcInstall destDir bc distDir = do
56
56
winGlutIncSrcs
57
57
needContents winGlutIncludeInstallDir
58
58
59
- return destDir
59
+ return . Just $ destDir
60
60
61
61
62
62
copyWinTargetExtras :: BuildConfig -> Action ()
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ module Paths
18
18
, listBuild , listCore , listSource
19
19
, hpCabalFile
20
20
21
- , targetDir
21
+ , targetDir , phonyTargetDir
22
22
, ghcVirtualTarget , hpVirtualTarget
23
23
24
24
, installerPartsDir , extrasDir
@@ -111,6 +111,9 @@ hpCabalFile = buildRoot </> "haskell-platform.cabal"
111
111
targetDir :: FilePath
112
112
targetDir = buildRoot </> " target"
113
113
114
+ phonyTargetDir :: FilePath
115
+ phonyTargetDir = " PHONYtargetdir"
116
+
114
117
ghcVirtualTarget :: String
115
118
ghcVirtualTarget = " target-ghc"
116
119
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ targetRules :: BuildConfig -> Rules ()
25
25
targetRules bc = do
26
26
buildRules
27
27
installRules bc
28
- targetDir ~> do
28
+ phonyTargetDir ~> do
29
29
hpRel <- askHpRelease
30
30
bc' <- askBuildConfig
31
31
let OS {.. } = osFromConfig bc'
You can’t perform that action at this time.
0 commit comments