spago
spago copied to clipboard
Display all problems with spago.dhall at once
» spago bump-version --no-dry-run v1.0.0
[info] Generating a new Bower config using the package set versions..
spago: Error: Error while reading spago.dhall:
Explanation: a record is missing a required key.
The key missing is:
↳ license
The keys in the record are:
↳ dependencies, name, packages, sources
» spago bump-version --no-dry-run v1.0.0
[info] Generating a new Bower config using the package set versions..
spago: Error: Error while reading spago.dhall:
Explanation: a record is missing a required key.
The key missing is:
↳ repository
The keys in the record are:
↳ dependencies, license, name, packages, sources
Could both errors be listed at the same time?
These errors are coming from Dhall interpreter.
From looking at the issues tagged "error messages" on the dhall-haskell
repo I can't see one which covers the issue you've raised: https://github.com/dhall-lang/dhall-haskell/issues?page=2&q=is%3Aissue+label%3A%22error+messages%22. It may be worth reporting this there.
These errors are coming from Dhall interpreter.
Guys from dhall, say errors are not produced in dhall. https://github.com/dhall-lang/dhall-haskell/issues/1010#issuecomment-609438538
Oops, that's right, @flip111. Thanks for correction.
Yeah this is due to the smarts of how we parse the Config for publishing - right now we just raise an error the first time we encounter it, but we should collect them before failing instead
Is there a good way of asking spago
to report the original error from Dhall rather than constructing its own error message? I'm coming across a sort-of-related problem where if a record key has the wrong type, the error from spago
describes the key as "missing", e.g. if your spago.dhall says
{ name = 0
, dependencies = 0
, packages = 0
, sources = 0
}
then you get
$ spago build
[error] Error: Error while reading spago.dhall:
Explanation: a record is missing a required key.
The key missing is:
↳ name
The keys in the record are:
↳ dependencies, name, packages, sources
@hdgarrood the reason why error messages are so far away from Dhall ones is that our config is a bit of a special Dhall file (for historical reasons, and backwards compatibility, etc).
We'd really need some tidying up in the way we handle/manage/parse the config in the Spago.Config
module. Related: #594
It's unclear to me from the linked dhall-haskell issue if that library actually supports collecting errors at this stage. I'm not familiar enough with Haskell to know - it's MonadThrow
, so is it likely?
The new Spago does not use Dhall anymore.