diff --git a/default.nix b/default.nix index 08dad5fe2..b0585e1a8 100644 --- a/default.nix +++ b/default.nix @@ -111,19 +111,19 @@ let - getDefaultGHC = "ghc${ - ( - # Remove '.' from the string 8.8.4 -> 884 - pkgs.lib.stringAsChars (c: if c == "." then "" else c) - # Get default GHC version, - (pkgs.lib.getVersion pkgs.haskellPackages.ghc) - ) - }"; - - compilerPackage = - if ((compiler == "") || (compiler == "default")) - then getDefaultGHC - else compiler; + getDefaultGHC = "ghc${ + ( + # Remove '.' from the string 8.8.4 -> 884 + pkgs.lib.stringAsChars (c: if c == "." then "" else c) + # Get default GHC version, + (pkgs.lib.getVersion pkgs.haskellPackages.ghc) + ) + }"; + + compilerPackage = + if ((compiler == "") || (compiler == "default")) + then getDefaultGHC + else compiler; # 2020-12-31: NOTE: Remove after `hnix-store 0.4` arrives into Nixpkgs hnix-store-src = pkgs.fetchFromGitHub { @@ -226,13 +226,14 @@ let # 2020-12-07 We really want cryptohash-sha512, but it conflicts with # recent versions of base, for seemingly no valid reason. # As the update is slow to happen, just jailbreak here - # See https://github.com/haskell-hvr/cryptohash-sha512/pull/3 - # and https://github.com/haskell-hvr/cryptohash-sha512/pull/5 + # See https://github.com/haskell-hvr/cryptohash-sha512 PRs 3, 5 and issue 4 + # See also https://github.com/NixOS/nixpkgs/pull/106333 for a temporary fix. cryptohash-sha512 = pkgs.haskell.lib.unmarkBroken ( pkgs.haskell.lib.doJailbreak super.cryptohash-sha512 ); # 2020-12-07 hnix-store-remote fails when trying to connect to a real hnix daemon. # probably due to nix sandbox restrictions. - hnix-store-remote = pkgs.haskell.lib.dontCheck super.hnix-store-remote; + # Upstream issue @ https://github.com/haskell-nix/hnix-store/issues/80 + hnix-store-remote = pkgs.haskell.lib.removeConfigureFlag super.hnix-store-remote "-fio-testsuite"; # 2020-08-04 hnix uses custom LayoutOptions and therefore is # likely to be affected by the change in the ribbon width diff --git a/src/Nix/Effects.hs b/src/Nix/Effects.hs index c1df93300..0ce82e677 100644 --- a/src/Nix/Effects.hs +++ b/src/Nix/Effects.hs @@ -244,14 +244,15 @@ type StorePathSet = HS.HashSet StorePath class Monad m => MonadStore m where - -- | Add a path to the store, with bells and whistles + -- | Copy the contents of a local path to the store. The resulting store + -- path is returned. Note: This does not support yet support the expected + -- `filter` function that allows excluding some files. addToStore :: StorePathName -> FilePath -> RecursiveFlag -> RepairFlag -> m (Either ErrorCall StorePath) default addToStore :: (MonadTrans t, MonadStore m', m ~ t m') => StorePathName -> FilePath -> RecursiveFlag -> RepairFlag -> m (Either ErrorCall StorePath) addToStore a b c d = lift $ addToStore a b c d - -- | Add a nar (action) to the store - -- addToStore' :: StorePathName -> IO Nar -> RecursiveFlag -> RepairFlag -> m (Either ErrorCall StorePath) - + -- | Like addToStore, but the contents written to the output path is a + -- regular file containing the given string. addTextToStore' :: StorePathName -> Text -> Store.StorePathSet -> RepairFlag -> m (Either ErrorCall StorePath) default addTextToStore' :: (MonadTrans t, MonadStore m', m ~ t m') => StorePathName -> Text -> Store.StorePathSet -> RepairFlag -> m (Either ErrorCall StorePath) addTextToStore' a b c d = lift $ addTextToStore' a b c d diff --git a/src/Nix/Effects/Derivation.hs b/src/Nix/Effects/Derivation.hs index 47e32bffc..51a0f3b16 100644 --- a/src/Nix/Effects/Derivation.hs +++ b/src/Nix/Effects/Derivation.hs @@ -219,10 +219,10 @@ derivationParser = do let (hashType, hashMode) = case Text.splitOn ":" rht of ["r", ht] -> (ht, Recursive) [ht] -> (ht, Flat) - _ -> undefined -- What ?! -- TODO: Throw a proper error + _ -> error $ "Unsupported hash type for output of fixed-output derivation in .drv file: " ++ show fullOutputs in case Store.mkNamedDigest hashType hash of Right digest -> (Just digest, hashMode) - Left _err -> undefined -- TODO: Raise a proper parse error. + Left err -> error $ "Unsupported hash " ++ show (hashType <> ":" <> hash) ++ "in .drv file: " ++ err _ -> (Nothing, Flat) @@ -282,7 +282,7 @@ defaultDerivationStrict = fromValue @(AttrSet (NValue t f m)) >=> \s -> do AllOutputs -> -- TODO: recursive lookup. See prim_derivationStrict -- XXX: When is this really used ? - undefined + error "Not implemented: derivations depending on a .drv file are not yet supported." -- | Build a derivation in a context collecting string contexts.