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 is producing rather useless error messages #1914

Closed
wereHamster opened this issue Jun 1, 2014 · 11 comments
Closed

cabal install is producing rather useless error messages #1914

wereHamster opened this issue Jun 1, 2014 · 11 comments
Milestone

Comments

@wereHamster
Copy link

Consider this example, and now go figure out what the actual problem is:

$ cabal install websockets
Resolving dependencies...
Notice: installing into a sandbox located at /project/.cabal-sandbox
Downloading websockets-0.8.2.3...
Failed to install websockets-0.8.2.3
Last 10 lines of the build log ( /project/.cabal-sandbox/logs/websockets-0.8.2.3.log ):
cabal:
/project/.cabal-sandbox/logs/websockets-0.8.2.3.log:
does not exist
@23Skidoo 23Skidoo added sandbox and removed sandbox labels Jun 2, 2014
@23Skidoo
Copy link
Member

23Skidoo commented Jun 2, 2014

I tried to reproduce this, but websockets install fine on my machine. More info needed.

@23Skidoo
Copy link
Member

23Skidoo commented Jun 2, 2014

Maybe the download failed, so the log file was never created.

@wereHamster
Copy link
Author

Indeed. Disable or disconnect the network before running the command.

Compare cabal's message with those produced by other tools under the same conditions:

@23Skidoo
Copy link
Member

23Skidoo commented Jun 2, 2014

Yes, this should be fixed. cabal install -v3 probably produces a better message.

@vincenthz
Copy link
Contributor

A different issue but somewhat related, is that truncated error log (10 last lines) are completely useless. Specially with ghc being on the verbose side, it's very often that the line number is not even displayed if there's an error.

Is there a reason that the error log are reported truncated in the first place ? and would it make sense to have a bigger default value (50 ? 100 ?) ?

@23Skidoo
Copy link
Member

23Skidoo commented Sep 4, 2014

@vincenthz

A different issue but somewhat related, is that truncated error log (10 last lines) are completely useless.

This is fixed in master, we print the full error log now.

@vincenthz
Copy link
Contributor

@23Skidoo: awesome, thanks. I'll update my versions.

@crockeea
Copy link

I think I just got the same behavior:

# ~ $ cabal update
Downloading the latest package list from hackage.haskell.org
# ~ $ cabal install hdevtools
Resolving dependencies...
Downloading cmdargs-0.10.12...
Downloading ghc-paths-0.1.0.9...
Failed to install ghc-paths-0.1.0.9
Build log ( ~/.cabal/logs/ghc-paths-0.1.0.9.log ):
cabal: ~/.cabal/logs/ghc-paths-0.1.0.9.log: does not exist
# ~ $ cabal install ghc-paths
Resolving dependencies...
Downloading ghc-paths-0.1.0.9...
Configuring ghc-paths-0.1.0.9...
Building ghc-paths-0.1.0.9...
Installed ghc-paths-0.1.0.9

So ghc-paths failed to install, then immediately installed without complaint.

@tendril
Copy link

tendril commented Apr 12, 2015

I encountered this issue; the cause was that packages in the repo-cache were owned by root and not readable by the user account.

Deleting the package from the repo-cache resolved the issue

Improved error reporting would help a great deal.

@ttuegel ttuegel added this to the cabal-install-1.24 milestone Apr 24, 2015
@Blaisorblade
Copy link
Collaborator

cabal update also suffers this problem — it prints "does not exist" on a network failure (in my actual scenario, we needed a proxy but none was set; FWIW, this user suffered this problem for months).
I've fixed the problem thanks to http://www.yesodweb.com/blog/2015/06/cabals-does-not-exist-error-message

So I managed to trigger (a variant of) this error in a simple way — just set a non-existent proxy (I use http_proxy=http://127.0.0.1). This might be a bit more convenient to reproduce.

cabal install -v3 probably produces a better message.
Unfortunately not, in either case. Traces below.

$ http_proxy=http://127.0.0.1 cabal update -v3
Downloading the latest package list from hackage.haskell.org
Sending:
GET http://hackage.haskell.org/packages/archive/00-index.tar.gz HTTP/1.1
User-Agent: cabal-install/1.20.0.3 (osx; x86_64)
If-None-Match: "2ed1a621df9edcca3a9f3a9c3a4335c3"
Host: hackage.haskell.org

proxy uri host: 127.0.0.1, port:
Creating new connection to 127.0.0.1
cabal: does not exist
$ http_proxy=http://127.0.0.1 cabal install -v3 base-orphans
Searching for ghc in path.
Found ghc at /usr/bin/ghc
("/usr/bin/ghc",["--numeric-version"])
/usr/bin/ghc is version 7.8.3
looking for tool ghc-pkg near compiler in /usr/bin
found ghc-pkg in /usr/bin/ghc-pkg
("/usr/bin/ghc-pkg",["--version"])
/usr/bin/ghc-pkg is version 7.8.3
("/usr/bin/ghc",["--supported-languages"])
("/usr/bin/ghc",["--info"])
Reading installed packages...
("/usr/bin/ghc-pkg",["dump","--global","-v0"])
("/usr/bin/ghc-pkg",["dump","--user","-v0"])
("/usr/bin/ghc",["--print-libdir"])
Reading available packages...
Choosing modular solver.
Resolving dependencies...
[__0] trying: base-orphans-0.4.4 (user goal)
[__1] trying: base-4.7.0.1/installed-df2... (dependency of base-orphans-0.4.4)
[__2] trying: rts-1.0/installedbuil... (dependency of base-4.7.0.1/installed-df2...)
[__3] trying: integer-gmp-0.5.1.0/installed-d42... (dependency of base-4.7.0.1/installed-df2...)
[__4] trying: base-orphans-0.4.4:!test
[__5] next goal: ghc-prim (dependency of base-orphans-0.4.4)
[__5] trying: ghc-prim-0.3.1.0/installed-954...
[__6] done
Ready to install base-orphans-0.4.4
Downloading base-orphans-0.4.4...
Sending:
GET
http://hackage.haskell.org/packages/archive/base-orphans/0.4.4/base-orphans-0.4.4.tar.gz
HTTP/1.1
User-Agent: cabal-install/1.20.0.3 (osx; x86_64)
Host: hackage.haskell.org

proxy uri host: 127.0.0.1, port:
Creating new connection to 127.0.0.1
Waiting for install task to finish...
Failed to install base-orphans-0.4.4
Build log ( /Users/pgiarrusso/.cabal/logs/base-orphans-0.4.4.log ):
cabal: /Users/pgiarrusso/.cabal/logs/base-orphans-0.4.4.log: does not exist

@Blaisorblade
Copy link
Collaborator

Closing in favor of more "synthetic" #3073.

@ezyang ezyang modified the milestones: cabal-install 2.0, 2.0 (planned for next feature release) Sep 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants