parent
c05876cc60
commit
d038c361c0
25
lib/GHCup.hs
25
lib/GHCup.hs
@ -851,31 +851,26 @@ compileHLS targetHLS ghcs jobs ov isolateDir cabalProject cabalProjectLocal patc
|
|||||||
Nothing -> pure "cabal.project"
|
Nothing -> pure "cabal.project"
|
||||||
forM_ cabalProjectLocal $ \cpl -> copyFileE cpl (workdir </> cp <.> "local")
|
forM_ cabalProjectLocal $ \cpl -> copyFileE cpl (workdir </> cp <.> "local")
|
||||||
|
|
||||||
let targets = ["exe:haskell-language-server", "exe:haskell-language-server-wrapper"]
|
|
||||||
|
|
||||||
artifacts <- forM (sort ghcs) $ \ghc -> do
|
artifacts <- forM (sort ghcs) $ \ghc -> do
|
||||||
let ghcInstallDir = installDir </> T.unpack (prettyVer ghc)
|
let ghcInstallDir = installDir </> T.unpack (prettyVer ghc)
|
||||||
liftIO $ createDirRecursive' ghcInstallDir
|
liftIO $ createDirRecursive' installDir
|
||||||
lift $ logInfo $ "Building HLS " <> prettyVer installVer <> " for GHC version " <> prettyVer ghc
|
lift $ logInfo $ "Building HLS " <> prettyVer installVer <> " for GHC version " <> prettyVer ghc
|
||||||
liftE $ lEM @_ @'[ProcessError] $
|
liftE $ lEM @_ @'[ProcessError] $
|
||||||
execLogged "cabal" ( [ "v2-build"
|
execLogged "cabal" ( [ "v2-install"
|
||||||
, "-w"
|
, "-w"
|
||||||
, "ghc-" <> T.unpack (prettyVer ghc)
|
, "ghc-" <> T.unpack (prettyVer ghc)
|
||||||
|
, "--install-method=copy"
|
||||||
] ++
|
] ++
|
||||||
maybe [] (\j -> ["--jobs=" <> show j]) jobs ++
|
maybe [] (\j -> ["--jobs=" <> show j]) jobs ++
|
||||||
[ "--project-file=" <> cp
|
[ "--overwrite-policy=always"
|
||||||
] ++ targets
|
, "--disable-profiling"
|
||||||
|
, "--disable-tests"
|
||||||
|
, "--installdir=" <> ghcInstallDir
|
||||||
|
, "--project-file=" <> cp
|
||||||
|
, "exe:haskell-language-server"
|
||||||
|
, "exe:haskell-language-server-wrapper"]
|
||||||
)
|
)
|
||||||
(Just workdir) "cabal" Nothing
|
(Just workdir) "cabal" Nothing
|
||||||
forM_ targets $ \target -> do
|
|
||||||
let cabal = "cabal"
|
|
||||||
args = ["list-bin", target]
|
|
||||||
CapturedProcess{..} <- lift $ executeOut cabal args (Just workdir)
|
|
||||||
case _exitCode of
|
|
||||||
ExitFailure i -> throwE (NonZeroExit i cabal args)
|
|
||||||
_ -> pure ()
|
|
||||||
let cbin = stripNewlineEnd . T.unpack . decUTF8Safe' $ _stdOut
|
|
||||||
copyFileE cbin (ghcInstallDir </> takeFileName cbin)
|
|
||||||
pure ghcInstallDir
|
pure ghcInstallDir
|
||||||
|
|
||||||
forM_ artifacts $ \artifact -> do
|
forM_ artifacts $ \artifact -> do
|
||||||
|
Loading…
Reference in New Issue
Block a user