You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using --file-watch, and the build plan cannot be constructed, Stack displays an internal error representation instead of a readable error message.
Steps to reproduce
In an empty directory, create stack.yaml with no dependencies, e.g.
resolver: ghc-9.2.4packages:
- .
Create a Cabal file referencing an unavailable package, e.g.
cabal-version: 1.12
name: test
version: 0.1.0.0synopsis: Test
description: Test
author: Test
maintainer: [email protected]build-type: Simple
executablemainmain-is: Main.hs
hs-source-dirs:
.
build-depends:
base >=4.7&&<5
, microlens-platform
default-language: Haskell2010
Run stack build --file-watch.
Expected
Readable error message, such as in the case of stack build without watch:
Error: [S-4804]
Stack failed to construct a build plan.
While constructing the build plan, Stack encountered the following errors:
In the dependencies for test-0.1.0.0:
microlens-platform needed, but the Stack configuration has no specified version (latest matching version is 0.4.3.3)
needed since test is a build target.
stack --version
Version 2.9.3, Git revision 6cf638947a863f49857f9cfbf72a38a48b183e7e x86_64 hpack-0.35.1
Method of installation
Official binary, downloaded via haskellstack.org or from Stack's repository
The text was updated successfully, but these errors were encountered:
mpilgrem
changed the title
Watch mode reports a wall of text starting with ConstructPlanFailed instead of a readable error
Watch mode reports the Show instance of ConstructPlanFailed, instead of a readable error
Dec 20, 2022
@koterpillar, thanks for reporting. The problem is that - somehow - the Show instance of ConstructPlanFailed is being reported instead of its 'pretty' form. There is only one place in Stack's code where ConstructPlainFailed is being thrown expressly, and it is thrown as a 'PrettyException', so this must be something to do with how --file-watch handles exceptions. That will take a little investigation by me.
General summary/comments (optional)
When using
--file-watch
, and the build plan cannot be constructed, Stack displays an internal error representation instead of a readable error message.Steps to reproduce
In an empty directory, create
stack.yaml
with no dependencies, e.g.Create a Cabal file referencing an unavailable package, e.g.
Run
stack build --file-watch
.Expected
Readable error message, such as in the case of
stack build
without watch:Actual
Only an internal error representation shown:
Stack version
Method of installation
The text was updated successfully, but these errors were encountered: