Add als executable as dependency of test-suite#43
Conversation
6df6462 to
afc0c14
Compare
This will make it available via PATH, when running cabal test, so that we do not need to manually point the test suiet at the executable with the --als-path test option.
afc0c14 to
f8f04a6
Compare
|
Thanks, this looks useful. I don’t expect this to interfere with our current workflows in any major way. Our CI is still Stack-based, so this change is mainly relevant for cabal test / Nix-style builds rather than the existing CI path. So yes, I think this is worth pursuing. |
|
I tried to build the server today and hit the exact same two issues. My "downstream" workaround for the test suite was to add this to the Nix expression: preCheck = ''
export PATH="$PWD/dist/build/als:$PATH"
'';Does seem to be code smell that one would need to add this to path for the test to work. |
|
Yes, but unfortunately this seems to be the way of doing things currently. There are a bunch of Haskell packages that have this fix defined in Nixpkgs. The most ridiculous is Cabal2Nix which has a special case for the generation of it's own nix expression hardcoded for this exact issue. Because nix interacts with Setup.hs instead of thorough cabal, build-tools and build-tool-depends don't work for making the executable available during testing. |
I want to fix #33, so that this just works under nix, ideally without requiring any special treatment on the nix side. There are currently two problems stopping the package from building (without providing specific configuration):
This addresses the second one by making cabal add the als executable to PATH when running cabal test.
To be honest, I don't know how thiss interacts with other workflows, so I'm waiting to see if the GitHub Actions go through and for your comment. :)