Skip to content

cabal install pkg-x.y.z fails unless --ignore-project is given #8325

Closed
@andreasabel

Description

@andreasabel

If you sit in a local project directory and cabal install a remote package, you cannot give its version suffix unless you also pass --ignore-project.

Reproducer:

  1. change to a cabal project root
  2. cabal install fix-whitespace-0.0.8 fails:
    Error: cabal: No targets given and there is no package in the current
    directory. Use the target 'all' for all packages in the project or specify
    packages or components by name or location.
    
  3. cabal install fix-whitespace succeeds
  4. cabal install --ignore-project fix-whitespace-0.0.8 also succeeds

In the wild: https://github.com/haskell/cabal/runs/7509048343?check_suite_focus=true#step:6:1

Run cabal install --install-method=copy --installdir=$HOME/.local/bin fix-whitespace-0.0.8
cabal: No targets given and there is no package in the current directory. Use
the target 'all' for all packages in the project or specify packages or
components by name or location.

Metadata

Metadata

Assignees

Labels

cabal-install: cmd/installcan-workaroundThere is a (maybe partial) workaround for the issue or missing featurere: --ignore-projectConcerning flag `--ignore-project`re: targetConcerning build targets like pkg:lib

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions