summaryrefslogtreecommitdiff
path: root/Biz/Bild.nix
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2023-10-10 13:15:59 -0400
committerBen Sima <ben@bsima.me>2023-10-10 13:15:59 -0400
commit904de577261e7024373e7a42fd763184764238f9 (patch)
tree563e4968eab568466ae3e7a1c747dd24a77986c0 /Biz/Bild.nix
parent6107f8178e26ada67e5d5ec60501e24528b3db56 (diff)
Don't swallow namespace-parsing errors
Previously, if there was a problem with the inputs and bild failed to determine the namespace, 'fromPath' would return 'Nothing' and then 'catMaybes' would drop the error-causing input altogether. In the one time that I had a bad input, this made debugging incredibly difficult. It's always a bad idea to swallow errors silently, so instead lets just kill the program if we have bad inputs.
Diffstat (limited to 'Biz/Bild.nix')
-rw-r--r--Biz/Bild.nix27
1 files changed, 12 insertions, 15 deletions
diff --git a/Biz/Bild.nix b/Biz/Bild.nix
index 1e4bcf8..9647983 100644
--- a/Biz/Bild.nix
+++ b/Biz/Bild.nix
@@ -59,18 +59,6 @@ in nixpkgs // { bild = rec {
;
};
- # this is needed to do builds without calling out to nix, remove this when I
- # switch to all-nix builds
- bildRuntimeDeps = with nixpkgs; [
- pkg-config
- # this is just to get access to ghc-pkg in bild
- (haskell.ghcWith (_: []))
-
- # lisp deps
- guile
- (lisp.sbclWith (p: with p; [asdf alexandria])) # just enough to build Example.lisp
- ];
-
# a standard nix build for bild, for bootstrapping. this should be the only
# hand-written builder we need
bild = nixpkgs.stdenv.mkDerivation {
@@ -78,7 +66,16 @@ in nixpkgs // { bild = rec {
src = ../.;
nativeBuildInputs = [ haskell.ghcPackageSetBild ];
buildInputs = [ nixpkgs.makeWrapper ];
- propagatedBuildInputs = bildRuntimeDeps;
+ propagatedBuildInputs = with nixpkgs; [
+ pkg-config
+ git
+ # this is just to get access to ghc-pkg in bild
+ (haskell.ghcWith (_: []))
+
+ # lisp deps, remove this when i implement nix builds for lisp
+ guile
+ (lisp.sbclWith (p: with p; [asdf alexandria])) # just enough to build Example.lisp
+ ];
strictDeps = true;
buildPhase = ''
mkdir -p $out/bin $out/lib/ghc-${haskell.ghcPackageSetFull.version}
@@ -95,7 +92,7 @@ in nixpkgs // { bild = rec {
'';
installPhase = ''
wrapProgram $out/bin/bild \
- --prefix PATH : ${lib.makeBinPath [ haskell.ghcPackageSetBild ]} \
+ --prefix PATH : ${lib.makeBinPath [ haskell.ghcPackageSetBild pkgs.git ]} \
--set GHC_PACKAGE_PATH \
$out/lib/ghc-${haskell.ghcPackageSetFull.version}/package.conf.d
'';
@@ -108,7 +105,7 @@ in nixpkgs // { bild = rec {
USER = "nixbld";
HOSTNAME = "nix-sandbox";
# this is the default sandbox path where bild will be working:
- CODEROOT = "/build/biz";
+ CODEROOT = "/build/omni";
# we need to remove the $src root because bild expects paths relative to the
# working directory:
TARGET = "." + lib.strings.removePrefix (toString src) (toString target);