Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cabal install => Error: cabal: Driver_stack.hsDriver_cabal.hs doesn't exist #2258

Closed
jwaldmann opened this issue Jan 25, 2024 · 4 comments · Fixed by #2286
Closed

cabal install => Error: cabal: Driver_stack.hsDriver_cabal.hs doesn't exist #2258

jwaldmann opened this issue Jan 25, 2024 · 4 comments · Fixed by #2286

Comments

@jwaldmann
Copy link

I wanted to build from source. I did

git clone --recurse-submodules https://github.com/ucsd-progsys/liquidhaskell
cd liquidhaskell/
cabal install

and I get

Wrote tarball sdist to
...
Error: cabal: Driver_stack.hsDriver_cabal.hs doesn't exist

this is with

$ git log |head -1
commit 3ca414c77690a55ba9c7d4acf3b4b91ceaab2762
$ cabal --version
cabal-install version 3.10.2.1
compiled using version 3.10.1.0 of the Cabal library 
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.6.3
@facundominguez
Copy link
Collaborator

Thanks for the report @jwaldmann.

It looks like a bug in cabal. This at least makes it work for me:

diff --git a/tests/tests.cabal b/tests/tests.cabal
index f6c1acd8a..280ee7a92 100644
--- a/tests/tests.cabal
+++ b/tests/tests.cabal
@@ -25,10 +25,7 @@ flag measure-timings
                than once, and the second run discards the timings of the first.
 
 executable test-driver
-    if flag(stack)
-      main-is:        Driver_stack.hs
-    else
-      main-is:        Driver_cabal.hs
+    main-is:        Driver_cabal.hs
 
     build-depends:    base < 5
                     , shelly

We don't use cabal install ourselves to install from the working copy, and I'm discovering that cabal-install insists in making tarballs for every package even if one wants to install only one of them.

As a workaround, you could remove failing packages from ./cabal.project. I just tried it and ./tests and ./scripts/plot-performance are the only packages with errors.

I just fixed ./scripts/plot-performance in 6d04eb4.

@jwaldmann
Copy link
Author

Yes, "remove failing packages from cabal.project" does work.

I then arrive at

Installing library in /home/waldmann/.cabal/store/ghc-9.6.3/incoming/new-78487/home/waldmann/.cabal/store/ghc-9.6.3/liquidhaskell-0.9.4.7.0-c9731030f7c476ad2cc653dcb0da2f2c218b6420ed55088e534841af45a76acb/lib
Error: setup: '/opt/ghc/latest/bin/ghc-9.6.3' exited with an error:
<command line>: Could not find module ‘LiquidHaskellBoot’
Use -v (or `:set -v` in ghci) to see a list of the files searched for.

Error: cabal: Failed to build liquidhaskell-0.9.4.7.0 (which is required by
exe:liquidhaskell from liquid-platform-0.9.2.8). See the build log above for
details.

Similar error with stack install. But I should make a separate issue for that.

@jwaldmann
Copy link
Author

It looks like a bug in cabal.

I found by trial-and-error that else must be indented ..

diff --git a/tests/tests.cabal b/tests/tests.cabal
index f6c1acd8a..cc47ff570 100644
--- a/tests/tests.cabal
+++ b/tests/tests.cabal
@@ -27,7 +27,7 @@ flag measure-timings
 executable test-driver
     if flag(stack)
       main-is:        Driver_stack.hs
-    else
+     else
       main-is:        Driver_cabal.hs
 
     build-depends:    base < 5

but the documentation does not say so? https://cabal.readthedocs.io/en/stable/cabal-package.html#conditional-blocks

@facundominguez
Copy link
Collaborator

facundominguez commented Jan 25, 2024

That's an interesting finding. I'm trying it in #2260 ... and it doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants