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

Cannot install library dependencies #6246

Closed
goldfirere opened this issue Sep 18, 2019 · 5 comments
Closed

Cannot install library dependencies #6246

goldfirere opened this issue Sep 18, 2019 · 5 comments

Comments

@goldfirere
Copy link

Describe the bug
I can't seem to globally install the dependencies of a local package.

To Reproduce
Navigate to the root directory of a cabalized package and run cabal install --only-dependencies. Witness the following error:

cabal: Cannot build the executables in the package units because it does not
contain any executables. Check the .cabal file for the package and make sure
that it properly declares the components that you expect.

I know there are no executables. I want the libraries installed into my global package database, just like happened with previous versions of cabal.

Expected behavior
I want the dependencies of my package to be installed in my global package database, so that when I run ghci, from any directory on my system, I can access them.

System informataion

  • cabal version 3.0.0.0

Additional context
Perhaps I am misusing cabal, but trying to educate myself hit #6245. Some background may be in #5650, which also describes why I care about the global database.

@goldfirere
Copy link
Author

Aha. I needed to pass --lib. Perhaps the error message should suggest this? In any case, I've gotten past this barrier.

@fgaz
Copy link
Member

fgaz commented Sep 19, 2019

Duplicate of #6237 (pinging @typedrat again)

@typedrat
Copy link
Collaborator

I’ll look at it on the other issue.

@selinger
Copy link
Contributor

Please fix this as soon as possible, as it is a major usability issue. The Cabal 3.0.0.0 (and later) documentation clearly states that "cabal install [PACKAGE]" is the way to install a package, for example here: https://www.haskell.org/cabal/users-guide/installing-packages.html#building-and-installing-packages

It does not mention the existence of any --lib option at all. And most packages that I have ever installed are libraries, so why would the default be to expect executables in a package that doesn't contain them?

It looks to me like the documentation that claims to be for Cabal 3.0.0.0 is in fact for Cabal 2, as it contains many other instructions that don't work with Cabal 3.0.0.0 (e.g., "cabal sandbox init", which gives an "unrecognised command" error, or "cabal install package-0.0.0.0.tar.gz", which gives an "Invalid package ID" error.

Incidentally, where is the actual documentation for Cabal 3.0.0.0 located? Thanks!

@RealVidy
Copy link

RealVidy commented Jan 7, 2020

I had to find this thread to understand why I could not install packages. Running cabal install I get:

Resolving dependencies...
cabal: Cannot build the executables in the package HDBC because none of the
components are available to build: the executable 'runtests' is marked as
'buildable: False'

Adding "--lib" does fix the issue. Please update wikis and docs

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

No branches or pull requests

5 participants