Files in app/ directory of stack projects fail to build w/o taking special steps #3472
Labels
build tool: stack
multi-component
Issues relating to multi-component support
type: bug
Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Your environment
Which OS do you use?
Ubuntu
Which version of GHC do you use and how did you install it?
9.4.4 / ghcup. Note that issue repros with other supported versions
How is your project built (alternative: link to the project)?
stack defaults. See repro instructions on new stack project below
Which LSP client (editor/plugin) do you use?
neovim + coc.nvim. Repros in VSCode as well
Which version of HLS do you use and how did you install it?
1.9.0.0. As above, other versions repro
Have you configured HLS in any way (especially: a
hie.yaml
file)? No, but see note belowSteps to reproduce
stack new --resolver nightly-2023-01-28 test
ghc-9.4.4
andHLS-1.9.0.0
are installed./test
app/Main.hs
. Note that an error is issued:cannot satisfy -package test-0.1.0.0
. If other dependencies are specified inpackage.yaml
, it may complain of being unable to satisfy one of those instead.Some observations that are hopefully clues:
app/Main.hs
is opened first and thensrc/Lib.hs
, the same error is displayed at the top of both files. In reverse order,HLS
works fine on any files insrc
but still fails on files inapp
.stack purge
before trying them:stack build
. Openapp/Main.hs
up in an editor. It works! (Sidenote: I do this /stack run
regularly during development, so I've been seeing this problem disappear "magically" for a while. It was only upon starting a new project today and deciding to dig in and file a bug that I made the connection.)haskell-language-server-wrapper
. This will fail onSetup.hs
for a default stack project, but we can just ignore that. This seems like a clue thathaskell-language-server-wrapper
is doing something different build-wise when run with--lsp
vs. without.hie.yaml
, i.e.cradle:\n stack:
. Same result. This could be a clue that implicit-hie is being used strangely (or itself has a bug).Expected behaviour
Everything works without taking any of the steps detailed above.
Actual behaviour
(Covered in Steps to reproduce)
Debug information
N/A
The text was updated successfully, but these errors were encountered: