Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit d110059

Browse files
authored
Merge pull request #927 from alanz/cabal-new-merged
cabal new-build merged from arbor repo
2 parents 9470305 + 35699b3 commit d110059

File tree

13 files changed

+49
-30
lines changed

13 files changed

+49
-30
lines changed

.gitmodules

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55

66
[submodule "submodules/cabal-helper"]
77
path = submodules/cabal-helper
8+
# url = https://github.com/arbor/cabal-helper.git
89
url = https://github.com/alanz/cabal-helper.git
910
# url = https://github.com/DanielG/cabal-helper.git
1011

1112
[submodule "submodules/ghc-mod"]
1213
path = submodules/ghc-mod
14+
# url = https://github.com/arbor/ghc-mod.git
1315
# url = https://github.com/bubba/ghc-mod.git
1416
url = https://github.com/alanz/ghc-mod.git
1517

cabal.project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ packages:
66
./submodules/HaRe
77
./submodules/ghc-mod/
88
./submodules/ghc-mod/core/
9+
./submodules/cabal-helper/

haskell-ide-engine.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ library
5656
, brittany
5757
, bytestring
5858
, Cabal
59-
, cabal-helper >= 0.8.1.0
59+
, cabal-helper >= 0.8.0.4
6060
, containers
6161
, data-default
6262
, directory

src/Haskell/Ide/Engine/Plugin/Build.hs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,11 @@ withCommonArgs (CommonParams mode0 mDistDir mCabalExe mStackExe _fileUri) a = do
197197
Just mode -> do
198198
let cabalExe = maybe "cabal" id mCabalExe
199199
stackExe = maybe "stack" id mStackExe
200-
distDir <- maybe (liftIO $ getDistDir mode stackExe) return $
200+
distDir' <- maybe (liftIO $ getDistDir mode stackExe) return $
201201
mDistDir -- >>= uriToFilePath -- fileUri
202202
runReaderT a $ CommonArgs {
203203
caMode = mode,
204-
caDistDir = distDir,
204+
caDistDir = distDir',
205205
caCabal = cabalExe,
206206
caStack = stackExe
207207
}
@@ -217,12 +217,12 @@ withCommonArgs req a = do
217217
Map.lookup "cabalExe" (ideParams req) >>= (\(ParamTextP v) -> return $ T.unpack v)
218218
stackExe = maybe "stack" id $
219219
Map.lookup "stackExe" (ideParams req) >>= (\(ParamTextP v) -> return $ T.unpack v)
220-
distDir <- maybe (liftIO $ getDistDir mode stackExe) return $
220+
distDir' <- maybe (liftIO $ getDistDir mode stackExe) return $
221221
Map.lookup "distDir" (ideParams req) >>=
222222
uriToFilePath . (\(ParamFileP v) -> v)
223223
runReaderT a $ CommonArgs {
224224
caMode = mode,
225-
caDistDir = distDir,
225+
caDistDir = distDir',
226226
caCabal = cabalExe,
227227
caStack = stackExe
228228
}
@@ -232,8 +232,8 @@ withCommonArgs req a = do
232232

233233
-- isHelperPrepared :: CommandFunc Bool
234234
-- isHelperPrepared = CmdSync $ \ctx req -> withCommonArgs ctx req $ do
235-
-- distDir <- asks caDistDir
236-
-- ret <- liftIO $ isPrepared (defaultQueryEnv "." distDir)
235+
-- distDir' <- asks caDistDir
236+
-- ret <- liftIO $ isPrepared (defaultQueryEnv "." distDir')
237237
-- return $ IdeResultOk ret
238238

239239
-----------------------------------------------
@@ -249,15 +249,15 @@ prepareHelper = CmdSync $ \_ req -> withCommonArgs req $ do
249249
return $ IdeResultOk ()
250250

251251
prepareHelper' :: MonadIO m => FilePath -> FilePath -> FilePath -> m ()
252-
prepareHelper' distDir cabalExe dir =
253-
prepare $ (mkQueryEnv dir distDir) {qePrograms = defaultPrograms {cabalProgram = cabalExe}}
252+
prepareHelper' distDir' cabalExe dir =
253+
prepare $ (mkQueryEnv dir distDir') {qePrograms = defaultPrograms {cabalProgram = cabalExe}}
254254

255255
-----------------------------------------------
256256

257257
isConfigured :: CommandFunc CommonParams Bool
258258
isConfigured = CmdSync $ \_ req -> withCommonArgs req $ do
259-
distDir <- asks caDistDir
260-
ret <- liftIO $ doesFileExist $ localBuildInfoFile distDir
259+
distDir' <- asks caDistDir
260+
ret <- liftIO $ doesFileExist $ localBuildInfoFile distDir'
261261
return $ IdeResultOk ret
262262

263263
-----------------------------------------------
@@ -279,7 +279,7 @@ configureStack stackExe = do
279279
_manyPackages -> readProcess stackExe ["build"] ""
280280

281281
configureCabal :: FilePath -> IO String
282-
configureCabal cabalExe = readProcess cabalExe ["configure"] ""
282+
configureCabal cabalExe = readProcess cabalExe ["new-configure"] ""
283283

284284
-----------------------------------------------
285285

@@ -360,7 +360,7 @@ buildDirectory = CmdSync $ \_ (BP m dd c s f mbDir) -> withCommonArgs (CommonPar
360360
liftIO $ case caMode ca of
361361
CabalMode -> do
362362
-- for cabal specifying directory have no sense
363-
_ <- readProcess (caCabal ca) ["build"] ""
363+
_ <- readProcess (caCabal ca) ["new-build"] ""
364364
return $ IdeResultOk ()
365365
StackMode -> do
366366
case mbDir of
@@ -398,7 +398,7 @@ buildTarget = CmdSync $ \_ (BT m dd c s f component package' compType) -> withCo
398398
ca <- ask
399399
liftIO $ case caMode ca of
400400
CabalMode -> do
401-
_ <- readProcess (caCabal ca) ["build", T.unpack $ maybe "" id component] ""
401+
_ <- readProcess (caCabal ca) ["new-build", T.unpack $ maybe "" id component] ""
402402
return $ IdeResultOk ()
403403
StackMode -> do
404404
case (package', component) of
@@ -436,13 +436,13 @@ listTargets = CmdSync $ \_ req -> withCommonArgs req $ do
436436
return $ IdeResultOk ret
437437

438438
listStackTargets :: FilePath -> IO [Package]
439-
listStackTargets distDir = do
439+
listStackTargets distDir' = do
440440
stackPackageDirs <- getStackLocalPackages "stack.yaml"
441-
mapM (listCabalTargets distDir) stackPackageDirs
441+
mapM (listCabalTargets distDir') stackPackageDirs
442442

443443
listCabalTargets :: MonadIO m => FilePath -> FilePath -> m Package
444-
listCabalTargets distDir dir = do
445-
runQuery (mkQueryEnv dir distDir) $ do
444+
listCabalTargets distDir' dir = do
445+
runQuery (mkQueryEnv dir distDir') $ do
446446
pkgName' <- fst <$> packageId
447447
cc <- components $ (,) CH.<$> entrypoints
448448
let comps = map (fixupLibraryEntrypoint pkgName') $ map snd cc

stack-8.2.1.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,22 @@ extra-deps:
88
- ./submodules/HaRe
99
- ./submodules/ghc-mod
1010
- ./submodules/ghc-mod/core
11+
- ./submodules/cabal-helper
12+
13+
# - brittany-0.11.0.0
1114
- butcher-1.3.1.1
12-
- cabal-helper-0.8.1.0@rev:0
1315
- cabal-plan-0.3.0.0
1416
- constrained-dynamic-0.1.0.0
1517
- czipwith-1.0.1.0
16-
- ghc-exactprint-0.5.8.0
18+
- ghc-exactprint-0.5.8.2
1719
- haddock-api-2.18.1
1820
- haddock-library-1.4.4
1921
- haskell-lsp-0.8.0.1
2022
- haskell-lsp-types-0.8.0.1
2123
- hlint-2.0.11
2224
- hsimport-0.8.6
2325
- lsp-test-0.4.0.0
26+
- pretty-show-1.8.2
2427
- sorted-list-0.2.1.0
2528
- syz-0.2.0.0
2629
- yaml-0.8.32

stack-8.2.2.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,22 @@ extra-deps:
88
- ./submodules/HaRe
99
- ./submodules/ghc-mod
1010
- ./submodules/ghc-mod/core
11+
- ./submodules/cabal-helper
12+
13+
# - brittany-0.11.0.0
1114
- butcher-1.3.1.1
12-
- cabal-helper-0.8.1.0@rev:0
1315
- cabal-plan-0.3.0.0
1416
- conduit-parse-0.2.1.0
1517
- constrained-dynamic-0.1.0.0
1618
- czipwith-1.0.1.0
17-
- ghc-exactprint-0.5.8.0
19+
- ghc-exactprint-0.5.8.2
1820
- haddock-api-2.18.1
1921
- haddock-library-1.4.4
2022
- haskell-lsp-0.8.0.1
2123
- haskell-lsp-types-0.8.0.1
2224
- hsimport-0.8.6
2325
- lsp-test-0.4.0.0
26+
- pretty-show-1.8.2
2427
- sorted-list-0.2.1.0
2528
- syz-0.2.0.0
2629

stack-8.4.2.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@ extra-deps:
88
- ./submodules/HaRe
99
- ./submodules/ghc-mod
1010
- ./submodules/ghc-mod/core
11+
- ./submodules/cabal-helper
12+
1113
- base-compat-0.9.3
12-
- cabal-helper-0.8.1.0@rev:0
14+
# - brittany-0.11.0.0
1315
- cabal-plan-0.3.0.0
1416
- constrained-dynamic-0.1.0.0
15-
- ghc-exactprint-0.5.8.0
17+
- ghc-exactprint-0.5.8.2
1618
- haddock-api-2.20.0
1719
- haddock-library-1.6.0
1820
- haskell-lsp-0.8.0.1
1921
- haskell-lsp-types-0.8.0.1
2022
- hlint-2.1.8
2123
- hsimport-0.8.6
2224
- lsp-test-0.4.0.0
25+
- pretty-show-1.8.2
2326
- syz-0.2.0.0
2427
- temporary-1.2.1.1
2528
- windns-0.1.0.0

stack-8.4.3.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ extra-deps:
88
- ./submodules/HaRe
99
- ./submodules/ghc-mod
1010
- ./submodules/ghc-mod/core
11+
- ./submodules/cabal-helper
1112

1213
- base-compat-0.9.3
13-
- cabal-helper-0.8.1.0@rev:0
1414
- cabal-plan-0.3.0.0
1515
- constrained-dynamic-0.1.0.0
1616
- ghc-exactprint-0.5.8.2
@@ -20,6 +20,7 @@ extra-deps:
2020
- haskell-lsp-types-0.8.0.1
2121
- hsimport-0.8.6
2222
- lsp-test-0.4.0.0
23+
- pretty-show-1.8.2
2324
- syz-0.2.0.0
2425
- temporary-1.2.1.1
2526

stack-8.4.4.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ extra-deps:
88
- ./submodules/HaRe
99
- ./submodules/ghc-mod
1010
- ./submodules/ghc-mod/core
11+
- ./submodules/cabal-helper
1112

1213
- base-compat-0.9.3
13-
- cabal-helper-0.8.1.0@rev:0
1414
- cabal-plan-0.3.0.0
1515
- constrained-dynamic-0.1.0.0
1616
- ghc-exactprint-0.5.8.2
@@ -20,6 +20,7 @@ extra-deps:
2020
- haskell-lsp-types-0.8.0.1
2121
- hsimport-0.8.6
2222
- lsp-test-0.4.0.0
23+
- pretty-show-1.8.2
2324
- syz-0.2.0.0
2425
- temporary-1.2.1.1
2526

stack.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ extra-deps:
88
- ./submodules/HaRe
99
- ./submodules/ghc-mod
1010
- ./submodules/ghc-mod/core
11+
- ./submodules/cabal-helper
1112

1213
- base-compat-0.9.3
13-
- cabal-helper-0.8.1.0@rev:0
14+
- base-orphans-0.7
15+
# - brittany-0.11.0.0
1416
- cabal-plan-0.3.0.0
1517
- constrained-dynamic-0.1.0.0
1618
- ghc-exactprint-0.5.8.2
@@ -20,6 +22,9 @@ extra-deps:
2022
- haskell-lsp-types-0.8.0.1
2123
- hsimport-0.8.6
2224
- lsp-test-0.4.0.0
25+
- monad-memo-0.4.1
26+
- pretty-show-1.8.2
27+
- semigroupoids-5.2.2
2328
- syz-0.2.0.0
2429
- temporary-1.2.1.1
2530

0 commit comments

Comments
 (0)