summaryrefslogtreecommitdiff
path: root/Biz/Bild.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Biz/Bild.hs')
-rw-r--r--Biz/Bild.hs34
1 files changed, 34 insertions, 0 deletions
diff --git a/Biz/Bild.hs b/Biz/Bild.hs
index d089048..cba5232 100644
--- a/Biz/Bild.hs
+++ b/Biz/Bild.hs
@@ -209,6 +209,7 @@ data Compiler
| GhcjsLib
| Guile
| NixBuild
+ | Rustc
deriving (Eq, Show, Generic, Aeson.ToJSON)
data Target = Target
@@ -233,6 +234,7 @@ data Target = Target
isBuildableNs :: Namespace -> Bool
isBuildableNs (Namespace (x : _) Namespace.Hs) | x /= "Hero" = True
isBuildableNs (Namespace _ Namespace.Scm) = True
+isBuildableNs (Namespace _ Namespace.Rs) = True
isBuildableNs ns
| ns `elem` nixTargets = True
| otherwise = False
@@ -370,6 +372,21 @@ analyze path = do
builder = user <> "@localhost",
..
}
+ Namespace.Rs -> do
+ pure
+ Target
+ { langdeps = Set.empty,
+ sysdeps = Set.empty,
+ compiler = Rustc,
+ out =
+ contentLines
+ /> Text.unpack
+ /> Regex.match (metaOut "//")
+ |> catMaybes
+ |> head,
+ builder = user <> "@localhost",
+ ..
+ }
_ ->
pure
Target
@@ -568,6 +585,23 @@ build andTest loud target@Target {..} = do
Copy -> do
Log.warn ["bild", "copy", "TODO", nschunk namespace]
pure Exit.ExitSuccess
+ Rustc -> do
+ Log.info
+ [ "bild",
+ "rust",
+ if Text.null builder
+ then "local"
+ else builder,
+ nschunk namespace
+ ]
+ proc
+ loud
+ namespace
+ "rustc"
+ [ path,
+ "-o",
+ root </> bindir </> Maybe.fromJust out
+ ]
data Proc = Proc
{ loud :: Bool,