summaryrefslogtreecommitdiff
path: root/Biz/Bild.hs
AgeCommit message (Collapse)Author
2023-08-03Add packageSet argumentBen Sima
2023-08-03Move buildPhase to a nix-instantiate argumentBen Sima
2023-08-02Better log messageBen Sima
2023-08-02Factor out nix builder into Haskell.nixBen Sima
This also fixed a bug where every dependency would get pulled into the Haskell target while searching for transitive dependencies.
2023-07-31Implement nix builds for HaskellBen Sima
This is prototype quality. For some reason I think it breaks when doing `build **/*.hs`, which isn't good. But also it's working, and the code feels good. Next I'd like to get Python builds working, as hopefully that will force me to improve the existing code to support a second language.
2023-07-31Capture and return stdout from procBen Sima
2023-07-31Add srcs to TargetBen Sima
Only fully implemented for Haskell at the moment but that is okay.
2023-07-31Prototype nix expression generationBen Sima
There are some limitations to this implementation: 1. Using `runCommand` means this will re-run any time anything changes in the repo. The solution is to use the existing import detection to make a list of source files, and put that into a `stdenv.mkDerivation`, which I'll do next. 2. The `NeatInterpolation` usage is ugly. The templated nix code should be extracted into its own file, such as `Biz/Bild/Builder.nix`. 3. I'm not actually calling it yet. The ideal thing would be to call `nix-instantiate`, get the output drv path, and then call `nix-store --realise` on that. To do that I need to refactor my `proc` function to return stdout to the calling function, and I should probably just make helper functions like `nixInstatiate :: Target -> IO DrvPath` and `nixStoreRealise :: DrvPath -> NixStorePath`, or something like that.
2023-07-28Add NIX_CFLAGS_COMPILE and some depsBen Sima
2023-04-28Parse more meta in scheme codeBen Sima
2023-01-06Use str instead of Text.packBen Sima
2023-01-06Fix guile lib building bugBen Sima
I need to guard on the existence of `out`. This should properly be a `Maybe FilePath`, but to make that change requires a lot of refactoring that I don't want to do right now. Instead, I added it to my todo list for later.
2023-01-05Fix a bug where I couldn't bild from a subdirBen Sima
I need to use the absPath, and the `makeAbsolute` function doesn't actually verify that the path is correct, it just prepends the CWD to the given path.
2023-01-05Also log bild output to a fileBen Sima
2022-10-28Factor out metadata handling into Biz.Bild.MetaBen Sima
The code was becoming repetitive and messy, with functions like 'metaDep' and so on. So that's an indication that they just need to have their own home.
2022-10-26Support building with SDLBen Sima
As a byproduct this also (sorta) generalizes how I pass flags to the C compiler using pkg-config, instead of using the guile-config. Now the 'lib' metadata will be added with 'pkg-config --libs', and the 'sys' metadata will be added with 'pkg-config --cflags'. I'm not *really* sure what the difference is, but if it works it works.
2022-08-09Use wrapper and compiler fields from TargetBen Sima
2022-08-08Remove some TODOsBen Sima
I don't like TODOs in my codebase, I'd rather keep them in org files. Eventually I need a linter that prevents all TODOs from getting into code.
2022-08-05Load asdf before loading the target fileBen Sima
Asdf is required in order to load any third-party packages.
2022-08-05Refactoring to simplify some codeBen Sima
Reduced duplication of out and sysdeps detection. Some other readibility cleanups.
2022-08-05Combine GhcLib and GhcExe into just GhcBen Sima
2022-08-04Add wutbar glyph and use itBen Sima
2022-08-04Improve bild loggingBen Sima
2022-08-03Fix bild testBen Sima
2022-08-03Distinguish between output name and output pathBen Sima
Bild.nix relies on output name when setting the output path, which is gonna be different than the dev build cabdir output path.
2022-08-03Print bild JSON analysis as a dictionary instead of a streamBen Sima
2022-08-03Key analyses on Namespace, not FilePathBen Sima
Namespace is unique, whereas FilePath could be relative or absolute, or have a leading . or trailing / or not.
2022-08-03Fold analyses with a caching containerBen Sima
2022-08-03Add compilerFlags to TargetBen Sima
This moves logic into the analysis step, and allows better auditing because you can see exactly what flags and command bild will use to compile the target.
2022-08-02Simplify analyze code a bit moreBen Sima
2022-08-02Break up monolithic detectImports functionBen Sima
2022-07-29Implement Guile linking for C buildsBen Sima
In order to write Guile code against C, I need to distiguish between libs and bins, so I did that, then I got the flags that gcc needs from `guile-config` and put them in the args for any C lib build. I tested this with Bessel.c and Bessel.scm (not in this patch, because I don't really want that code in my tree, I'll come up with another way to test it later).
2022-07-29Parse sysdeps for C codeBen Sima
2022-07-25Concurrently analyze transitive dependenciesBen Sima
Before: ϟ time bild Biz/Dragons.hs good: bild: Biz/Dragons.hs real 0m31.587s user 0m25.073s sys 0m6.446s After: ϟ time bild Biz/Dragons.hs good: bild: Biz/Dragons.hs real 0m17.111s user 0m39.719s sys 0m9.145s So yeah this is a good speedup.
2022-07-25Add basic support for building C codeBen Sima
2022-07-25Fix typoBen Sima
2022-07-25Remove GHCJS support completelyBen Sima
I don't care about ghcjs anymore, the most javascript I want to do is jQuery.
2022-07-20Re-enable scheme buildsBen Sima
I had thought that I needed some unmerged commits to nixpkgs that enable Guile 3.0, but turns out I just needed to use a different target name :P
2022-07-19Provision lisp repls with nixBen Sima
asdf seems to always be necessary for any other packages to work, so I just include that in the call to nix-shell, and swank is included because it's just useful to start a repl server.
2022-07-19Upgrade nixpkgs, ghc923Ben Sima
I ended up deleting miso, and consequently all files under Hero/ and Miso/, because I couldn't get miso to build with GHC 9.2. Other things: - Niv has been wrapped by Biz/Bild/Deps.hs, so I can extend it to my liking. - Apply-refact is gone because I couldn't get it to build. - Disabled python stuff.
2022-07-17Add basic Rust supportBen Sima
Support for packages and third-party imports will need to come later once I figure out how to lookup rust packages by their import statements. Until then, this works to compile "hello world".
2022-07-14Sort this enum alphabeticallyBen Sima
2022-07-14Remove unnecessary MapBen Sima
2022-07-05Doc fixesBen Sima
2022-03-30Add isCab functionBen Sima
2021-12-21Remove some old bild commentsBen Sima
2021-12-21Extract repl program from bildBen Sima
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.
2021-12-21Fix bild --repl to use the proper hasakell package setBen Sima
2021-12-14Add custom package db to ghcPkgFindModuleBen Sima
This means my call to ghc-pkg will look at the full package set from Hoogle.
2021-12-13Add --repl for Haskell programsBen Sima