From 904de577261e7024373e7a42fd763184764238f9 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Tue, 10 Oct 2023 13:15:59 -0400 Subject: 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. --- Biz/Bild.nix | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'Biz/Bild.nix') 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); -- cgit v1.2.3