cabal icon indicating copy to clipboard operation
cabal copied to clipboard

cabal gen-bounds ignores project file

Open alt-romes opened this issue 1 year ago • 6 comments

Describe the bug

Running cabal gen-bounds in a project whose cabal package is not in the root will fail to recognize the package:

To Reproduce Steps to reproduce the behavior:

cd $(mktemp -d)
cabal init -m -n --exe bad
echo 'packages: bad' > cabal.project
cabal gen-bounds bad

Results in

Error: cabal: No cabal file found.
Please create a package description file <pkgname>.cabal

Expected behavior Should gen-bounds for the bad package (which is located in the bad directory)

System information

  • cabal 3.10, HEAD

alt-romes avatar Feb 28 '24 16:02 alt-romes

Same for cabal outdated

alt-romes avatar Feb 28 '24 16:02 alt-romes

The documentation does not imply targets for gen-bound, but it does ([PACKAGES]) for outdated.

ffaf1 avatar Feb 28 '24 16:02 ffaf1

Documentation: --help, Manual is correct.

ffaf1 avatar Feb 28 '24 16:02 ffaf1

I see. Do you think it would be reasonable to make it work with projects?

This came up because I'm unable to do cabal gen-bounds for a package in a project whose dependencies are local...

alt-romes avatar Feb 28 '24 16:02 alt-romes

Perhaps duplicate of:

  • https://github.com/haskell/cabal/issues/7504

ulysses4ever avatar Feb 28 '24 16:02 ulysses4ever

It would be welcome, the only drawbacks that come to mind are:

  • possibly breaking old workflows (shouldn't be the case)
  • having to update tests by adding an empty cabal.project.

ffaf1 avatar Feb 28 '24 17:02 ffaf1