summaryrefslogtreecommitdiff
path: root/bild
AgeCommit message (Collapse)Author
2020-06-17bild: print log output if the build failsBen Sima
This also switches to using `nix-build` instead of `nix build`. The reason for this is that the latter does something with the stdout/stderr that makes it hard to capture via tee. Idk why. Maybe I'll look into this again, or maybe not, since nix-build works just fine.
2020-04-03Rewrite buildGhc and buildGhcjsBen Sima
I wanted to even further simplify the build tooling overhead. My general goal is to not have to think about declaring packages, or dependencies, or really anything that you might find in a cabal file. Not all of these goals are possible, but we can get pretty close. With this commit all I need for the 'buildGhc/buildGhcjs' functions is the path to the entrypoint file; everything else is either inferred by the Nix code or declared in the Haskell code comments. The strategy is to map a Haskell module to an executable artifact, and pass just that module to 'ghc --make'. Then we can rely on ghc to handle walking the local filesystem for imports. The only thing ghc really needs to know is a name for the output executable; it is hard to automatically infer this, so we have a simple comment syntax to declare this in the file. The comment syntax is inspired by existing Haskell 'LANGUAGE' pragmas; having this in the same file keeps the configuration as close to the real code as possible. The Nix code then extracts this info from the code comments, and sets the required ghc flags. Second, we need to declare the set of 3rd-party packages that our program relies on. For this we can re-use the same comment syntax and just list the dependencies, then extract them in Nix and construct a package set as we were before. This reduces the amount of "package declaration" code we have to write in default.nix, and reduces the amount of time we have to spend switching between the Haskell code and the Nix code (I find such context switching super annoying). I also think having the configuration in with the Haskell code encourages us to write smaller, simpler modules and only write code that we need. Additionally, I refactored the bild and ghci (now called 'repl') scripts to work in any directory. The .envrc uses direnv to set the path so that you can run these scripts anywhere. That means the following works: $ cd Run/Que $ bild Website $ repl Server λ> :l Run.Que.Server I find this to be a rather nice workflow.
2019-11-23Put outputs in _bild pathBen Sima
2019-11-23Print the nix log on bild failureBen Sima
2019-11-02add common scripts, remove old scripts, update readmeBen Sima
2019-10-27move everything to namespace directoriesBen Sima
2019-02-23Get rid of cabalBen Sima
Using just nix and ghc, ah it's so nice.