Description
Is your enhancement request related to a problem? Please describe.
The contributing guide mentions this alternative:
cabal run haskell-language-server:func-test -- -p "hlint enables"
This is supposed to work around Cabal flushing caches when using --test-options
:
But that does not work, because Cabal does not set executables to PATH for run
:
And thus runSession
produces this slightly confusing message:
haskell-language-server
window/workDoneProgress
sends indefinite progress notifications: FAIL
Exception: haskell-language-server: createProcess: posix_spawnp: does not exist (No such file or directory)
Describe the solution you'd like
The contributing guide should probably be updated to mention this error and link to the Cabal bug.
As a temporary workaround, the tests could check that the executable exists and print more helpful error.
Describe alternatives you've considered
The users can set HLS_TEST_EXE
and HLS_WRAPPER_TEST_EXE
like CI does, but that seems brittle.
haskell-language-server/test/utils/Test/Hls/Command.hs
Lines 10 to 19 in c0f7d4c
Additional context
I hit this long ago and @pepeiborra helpfully pointed out that this does not work in #2837, but I have since forgotten about it. 😅