ucsd-progsys / liquidhaskell

Liquid Types For Haskell
BSD 3-Clause "New" or "Revised" License
1.18k stars 134 forks source link

Make tests not stack-dependent #1584

Closed adinapoli closed 4 years ago

adinapoli commented 4 years ago

Currently mkTest assumes that liquid has been installed/provisioned via stack, but this might not be true for users using cabal.

In particular, it took me a while to realise why on my machine calling cabal new-test was hanging indefinitely, and only when I (accidentally) tried to run stack test (so that the relevant folders were generated on my machine) that I have realised what was going on 😉 I can see how others might end up into the same pit.

I think it would be nice for users not being tied to a particular program, even though stack is the de facto for this project.

@nikivazou , @ranjitjhala Would you accept a pull request in this area or is this something that doesn't warrant the effort? Thanks!

adinapoli commented 4 years ago

I do wonder if using binDir as before (cfr. commented-out code) is indeed the cleanest solution, as the user can always override the choice by doing export liquidhaskell_bindir=/path/to/custom/liquid.

Alternatively, we could pass some optional test option to tweak the behaviour, but that feels slightly overkill.

After playing a bit with the tests, perhaps the path of least resistance is a new "--liquid-runner" optional flag to be passed to the testsuite executable; it would default to stack exec -- liquid if not set or allow the user to pass something like cabal new-exec liquid -- , which will have basically the same effect of the stack's counterpart. It's not very elegant, but it might get the job done for now.

ranjitjhala commented 4 years ago

Hi Alfredo,

this code is certainly a bit old (perhaps predating the recent advances in cabal). My sense is that if there is some easy way to generalize then we can do it, otherwise maybe it is of lower priority?

Would certainly accept a PR if you or someone else knows how to do it!

Thanks!

On Tue, Jan 14, 2020 at 2:51 AM Alfredo Di Napoli notifications@github.com wrote:

I do wonder if using binDir as before (cfr. commented-out code) is indeed the cleanest solution, as the user can always override the choice by doing export liquidhaskell_bindir=/path/to/custom/liquid.

Alternatively, we could pass some optional test option to tweak the behaviour, but that feels slightly overkill.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ucsd-progsys/liquidhaskell/issues/1584?email_source=notifications&email_token=AAMS4OEMZSKXLKDR6OYEYOLQ5WKJPA5CNFSM4KGQVX4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI4FHQI#issuecomment-574116801, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMS4ODBFKEQQSFTQCEJBDDQ5WKJPANCNFSM4KGQVX4A .