@@ -144,7 +144,13 @@ setupHaskell = do
144
144
" dependencies.cabal"
145
145
(toStrict helperDependenciesCabalText)
146
146
Turtle. stdout (Turtle. input " dependencies.cabal" )
147
- let solverCommand = " stack init --solver --install-ghc"
147
+ let solverCommand = " stack init --solver --resolver "
148
+ <> stackResolver
149
+ <> " --install-ghc"
150
+ -- XXX for best results we should solve and install each one of them
151
+ -- independently rather than solving them together. It becomes more
152
+ -- difficult for the solver to find a workable build plan when we
153
+ -- solve them together.
148
154
-- Solve the versions of all helper binaries listed in
149
155
-- dependencies.cabal.
150
156
solverResult <- Turtle. shell solverCommand empty
@@ -164,18 +170,14 @@ setupHaskell = do
164
170
(Turtle. begins (" #" <|> " user-message" <|> " " ) *>
165
171
pure " " )
166
172
(Turtle. input " stack.yaml.bak" )))
167
- versionedHelperDeps <-
168
- fmap Turtle. lineToText <$>
169
- Turtle. fold
170
- (mfilter
171
- (filterHelperDeps . Turtle. lineToText)
172
- (Turtle. inshell " stack list-dependencies --separator -"
173
- empty))
174
- Foldl. list
175
- helperDepStackResolver <- stackResolverText $
176
- hvnHelperBinDir </> " stack.yaml"
177
- forM_ versionedHelperDeps $ \ dep ->
178
- stackInstall helperDepStackResolver dep
173
+ -- XXX I could not figure out how to keep the ">" sign unescaped in
174
+ -- mustache, so had to treat this especially. If we can do that then
175
+ -- we can push this as well in helperDependencies.
176
+ stackInstall stackResolver " hscope"
177
+ forM_ (map (head . Text. words ) helperDependencies) $
178
+ \ dep -> stackInstall stackResolver dep
179
+ -- XXX we should remove the temporary dir after installing to reclaim
180
+ -- unnecessary space.
179
181
msg " Installing git-hscope..."
180
182
-- TODO: The 'git-hscope' file won't do much good on Windows as it
181
183
-- is a bash script.
@@ -245,15 +247,10 @@ helperDependencies =
245
247
, " hasktags"
246
248
, " hlint"
247
249
, " hoogle"
248
- , " hscope"
249
250
, " pointfree"
250
251
, " pointful"
251
252
]
252
253
253
- filterHelperDeps :: Text -> Bool
254
- filterHelperDeps dep =
255
- any ($ dep) (fmap Text. isPrefixOf helperDependencies)
256
-
257
254
helperDependenciesCabalTemplate :: Template
258
255
helperDependenciesCabalTemplate = [mustache |name: dependencies
259
256
version: 0.1.0.0
@@ -267,7 +264,9 @@ build-type: Simple
267
264
cabal-version: >=1.10
268
265
269
266
library
267
+ -- hscope 0.4 does not compile with most resolvers so use newer
270
268
build-depends: base >=4.9 && <4.10
269
+ , hscope > 0.4
271
270
{{#dependencies}}
272
271
, {{.}}
273
272
{{/dependencies}}
0 commit comments