mirror of
https://github.com/srid/haskell-flake.git
synced 2024-09-11 14:05:58 +03:00
chore: only mention cabal.project issue for parser errors
This commit is contained in:
parent
f2153d02be
commit
462f004e30
@ -1,6 +1,7 @@
|
||||
{ pkgs
|
||||
, lib
|
||||
, throwError ? builtins.throw
|
||||
, throwErrorOnCabalProjectParseError ? builtins.throw
|
||||
, ...
|
||||
}:
|
||||
|
||||
@ -49,13 +50,13 @@ in
|
||||
if isSelfPath path
|
||||
then projectRoot
|
||||
else if lib.strings.hasInfix "*" path
|
||||
then throwError "Found a path with glob (${path}) in ${cabalProjectFile}, which is not supported"
|
||||
then throwErrorOnCabalProjectParseError "Found a path with glob (${path}) in ${cabalProjectFile}, which is not supported"
|
||||
else if lib.strings.hasSuffix ".cabal" path
|
||||
then throwError "Expected a directory but ${path} (in ${cabalProjectFile}) is a .cabal filepath"
|
||||
then throwErrorOnCabalProjectParseError "Expected a directory but ${path} (in ${cabalProjectFile}) is a .cabal filepath"
|
||||
else "${projectRoot}/${path}"
|
||||
)
|
||||
res.value
|
||||
else throwError "Failed to parse ${cabalProjectFile}: ${builtins.toJSON res}"
|
||||
else throwErrorOnCabalProjectParseError "Failed to parse ${cabalProjectFile}: ${builtins.toJSON res}"
|
||||
else
|
||||
[ projectRoot ];
|
||||
in
|
||||
|
@ -41,6 +41,12 @@ in
|
||||
A default value for `packages` cannot be auto-determined:
|
||||
|
||||
${msg}
|
||||
'';
|
||||
throwErrorOnCabalProjectParseError = msg: config.log.throwError ''
|
||||
|
||||
A default value for `packages` cannot be auto-determined:
|
||||
|
||||
${msg}
|
||||
|
||||
haskell-flake's `cabal.project` parser is limited; see #307.
|
||||
Please specify the `packages` option manually or modify your
|
||||
|
Loading…
Reference in New Issue
Block a user