diff options
author | Ben Sima <ben@bsima.me> | 2021-12-21 18:48:16 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2021-12-21 18:48:16 -0500 |
commit | 8e2eede487b24908c89d60bce272e4269135e4ec (patch) | |
tree | b35467c72efe19b0d62e56abcc2aefe0840ccc42 /Biz/Bild.hs | |
parent | c28c544b933cfb3ef3152be922248e9bbe89811e (diff) |
Extract repl program from bild
This is basically building on top of bild's analysis, which is great becuase it
means that bild is becoming a useful tool rather than a monolithic do-everything
job runner. The eventual goal is for the bild analysis to be much more useful,
maybe even provide data to remote repls or language-server or whatever.
Diffstat (limited to 'Biz/Bild.hs')
-rw-r--r-- | Biz/Bild.hs | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/Biz/Bild.hs b/Biz/Bild.hs index 845daf1..ce97807 100644 --- a/Biz/Bild.hs +++ b/Biz/Bild.hs @@ -44,8 +44,6 @@ -- -- * flags modify the way to interact with the build, some ideas: -- --- * -s = jump into a shell and/or repl --- -- * -p = turn on profiling -- -- * -t = limit build by type (file extension) @@ -68,16 +66,6 @@ -- This will build the file at ./A/B.hs, which translates to something like -- `ghc --make A.B`. -- --- > bild -s <target> --- --- Starts a repl/shell for target. --- --- - if target.hs, load ghci --- - if target.scm, load scheme repl --- - if target.clj, load a clojure repl --- - if target.nix, load nix-shell --- - and so on. --- -- > bild -p <target> -- -- build target with profiling (if available) @@ -187,8 +175,6 @@ move args = |> Map.elems |> putJSON >> pure [Exit.ExitSuccess] - | args `Cli.has` Cli.longOption "repl" = - traverse (repl isLoud) (Map.elems analyses) | otherwise = do root <- Env.getEnv "BIZ_ROOT" createHier root @@ -468,31 +454,6 @@ test loud Target {..} = case compiler of >> Log.br >> pure Exit.ExitSuccess -repl :: Bool -> Target -> IO Exit.ExitCode -repl _ Target {..} = do - root <- Env.getEnv "BIZ_ROOT" - case compiler of - c - | c `elem` [GhcExe, GhcLib] -> - -- this is a complicated set of string joins which basically means to - -- create a command like this: - -- nix-shell -E "with import Biz/Bild.nix {}; mkGhcPackageSet (h: [h.pkg])" - [ "--expr", - "with import " <> root <> "/Biz/Bild.nix {};" - <> "mkGhcPackageSet (h: [" - <> joinWith " " ["h." <> d | d <- Set.toList langdeps] - <> "])", - -- Set.toList sysdeps, - "--command", - "ghci -i$BIZ_ROOT -ghci-script $BIZ_ROOT/.ghci " <> path - ] - |> Process.callProcess "nix-shell" - >> Exit.exitSuccess - _ -> - Log.fail ["repl", nschunk namespace, "not implemented"] - >> Log.br - >> Exit.exitFailure - build :: Bool -> Bool -> Target -> IO Exit.ExitCode build andTest loud target@Target {..} = do root <- Env.getEnv "BIZ_ROOT" |