From e223b28e6820dcd9fa5c38ba22de487ada2ca0e6 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 18 Nov 2020 20:20:27 -0500 Subject: Extend bild to nix targets properly Also had to capitalize some stuff, and move some nix files around and rename the metadata directive from 'exe' to 'out' because that just makes more sense, and fix some compiler errors. But now bild treats both nix and hs files as buildable things. So that's cool. One interesting example is Biz/Pie.{nix,hs} - I can either create a dev build of the hs file with ghc, or I can create a fully-encapsulated nix build. Its nice to have both options because a dev build with ghc takes half the amount of time, and I can rely on my locally cached hi and ho files. I think this shows the power of bild, but also can be a somewhat subtle thing. The issue really is with the separate command calls in nix builds vs dev builds. I figure there are a few ways to fix this: 1. Try to use bild inside the nix rules. That could be interesting, but could also lead to some weird behavior or worm holes forming. 2. Extract the command line invocation into a separate file, some kind of really simple template that gets pulled into both programs. It is important to consider that in the future I might want to have bild do a module-by-module nix build of programs, but I'm not sure how that would effect my choice here. --- Biz/Pie.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Biz/Pie.hs') diff --git a/Biz/Pie.hs b/Biz/Pie.hs index 7e1c19e..409f14f 100644 --- a/Biz/Pie.hs +++ b/Biz/Pie.hs @@ -29,6 +29,15 @@ -- - Sean Ellis' question: "How would you feel if you could no longer use this -- product? (a) Very disappointed, (b) somewhat disappointed, (c) not -- disappointed" and then measure the percentage who answer (a). +-- +-- Bild Metadata: +-- +-- : out pie +-- : dep aeson +-- : dep protolude +-- : dep optparse-simple +-- : dep parsec +-- : dep haskeline module Biz.Pie ( main, ) -- cgit v1.2.3