diff options
Diffstat (limited to 'Biz/Bild.hs')
-rw-r--r-- | Biz/Bild.hs | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/Biz/Bild.hs b/Biz/Bild.hs index a9988d5..81947ed 100644 --- a/Biz/Bild.hs +++ b/Biz/Bild.hs @@ -458,7 +458,7 @@ analyze hmap ns = case Map.lookup ns hmap of outPath = outToPath pout, out = pout, srcs = Set.singleton path, - packageSet = "pythonWith", + packageSet = "pythonPackages", .. } |> Just @@ -514,7 +514,7 @@ analyze hmap ns = case Map.lookup ns hmap of { builder = Local user host, wrapper = Nothing, compiler = Ghc, - packageSet = "ghcWith", + packageSet = "ghcPackages", compilerFlags = [ "-Werror", "-threaded", @@ -631,16 +631,28 @@ analyze hmap ns = case Map.lookup ns hmap of |> Just |> pure Namespace.Rs -> - Meta.detectOut (Meta.out "//") contentLines |> \out -> + Meta.detectAll "//" contentLines |> \Meta.Parsed {..} -> Target - { langdeps = Set.empty, + { langdeps = pdep, + -- this packageSet doesn't actually exist because everyone in + -- nix just generates nix expressions for rust dependencies with + -- Cargo.lock, so I have to make it in order to use rust deps packageSet = "rustPackages", wrapper = Nothing, - sysdeps = Set.empty, + sysdeps = psys <> Set.singleton "rustc", + out = pout, compiler = Rustc, - compilerFlags = map Text.pack [absPath, "-o", root </> outToPath out], + compilerFlags = case pout of + Meta.Bin o -> + map + Text.pack + [ "$BIZ_ROOT" </> path, + "-o", + o + ] + _ -> panic "can't build rust libs", builder = Local user host, - outPath = outToPath out, + outPath = outToPath pout, srcs = Set.singleton absPath, .. } @@ -776,9 +788,9 @@ build andTest loud analysis = Copy -> do Log.warn ["bild", "copy", "not implemented yet", nschunk namespace] pure (Exit.ExitSuccess, mempty) - Rustc -> do + Rustc -> Log.info ["bild", "dev", "rust", nschunk namespace] - proc loud namespace (toNixFlag compiler) compilerFlags + >> nixBuild loud target Sbcl -> do Log.info ["bild", "dev", "lisp", nschunk namespace] proc loud namespace (toNixFlag compiler) compilerFlags @@ -962,6 +974,7 @@ nixBuild loud Target {..} = selectBuilder :: Namespace -> Text selectBuilder = \case - Namespace _ Namespace.Hs -> "base" + Namespace _ Namespace.Hs -> "haskell" Namespace _ Namespace.Py -> "python" - _ -> panic "no builder for this namespace" + Namespace _ Namespace.Rs -> "base" + Namespace _ ext -> panic <| "no builder for " <> show ext |