Skip to content

gen-bounds for more than library stanzas #5932

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

Open
puffnfresh opened this issue Mar 10, 2019 · 3 comments · May be fixed by #10840
Open

gen-bounds for more than library stanzas #5932

puffnfresh opened this issue Mar 10, 2019 · 3 comments · May be fixed by #10840

Comments

@puffnfresh
Copy link

Running cabal gen-bounds will give bounds for the library in my .cabal file. I would also like to see additional bounds for the executables, test-suites and benchmarks.

@phadej
Copy link
Collaborator

phadej commented Mar 10, 2019

It would be also cool if redundant bounds aren't added

i.e. (note no bound on base in tests, because tests depends on the library example)

name example

library
  build-depends:  base ^>=4.12.0.0

test-suite tests
  build-depends: base, example, tasty ^>=1.2.1

@ozkutuk
Copy link
Contributor

ozkutuk commented Aug 3, 2023

With the way cabal check currently works, this results in an awkward situation:

$ cabal check
Warning: These warnings may cause trouble when distributing the package:
Warning: These packages miss upper bounds:
- tasty
- tasty-golden
Please add them, using `cabal gen-bounds` for suggestions. For more
information see: https://pvp.haskell.org/

$ cabal gen-bounds
Resolving dependencies...
Congratulations, all your dependencies have upper bounds!

@ozkutuk
Copy link
Contributor

ozkutuk commented Aug 3, 2023

I realized cabal check no longer generates above warnings for tests (and benchmarks) on master, since #8361 got merged. I still think it may be beneficial for cabal gen-bounds to generate the bounds for these internal targets nonetheless. Would it be counterintuitive for gen-bounds to generate bounds when check doesn't complain about the lack of them? If not, I can try my hand at implementing this.

mpickering added a commit that referenced this issue Mar 20, 2025
This commit implements project-aware functionality for the `cabal gen-bounds` command,
allowing it to work correctly in multi-package projects. Previously, running `gen-bounds`
from within a package directory that depends on another local package would fail
because it couldn't find the local dependency.

The implementation follows the same pattern as other v2 commands, creating a full
project context that knows about all packages defined in the cabal.project file.
This allows `gen-bounds` to properly analyze dependencies between local packages
and suggest appropriate bounds.

```
cabal gen-bounds <TARGET>
```

Fixes #7504 #8654 #9752 #5932
mpickering added a commit that referenced this issue Mar 20, 2025
This commit implements project-aware functionality for the `cabal gen-bounds` command,
allowing it to work correctly in multi-package projects. Previously, running `gen-bounds`
from within a package directory that depends on another local package would fail
because it couldn't find the local dependency.

The implementation follows the same pattern as other v2 commands, creating a full
project context that knows about all packages defined in the cabal.project file.
This allows `gen-bounds` to properly analyze dependencies between local packages
and suggest appropriate bounds.

```
cabal gen-bounds <TARGET>
```

Fixes #7504 #8654 #9752 #5932
@mpickering mpickering linked a pull request Mar 20, 2025 that will close this issue
8 tasks
mpickering added a commit that referenced this issue Mar 20, 2025
This commit implements project-aware functionality for the `cabal gen-bounds` command,
allowing it to work correctly in multi-package projects. Previously, running `gen-bounds`
from within a package directory that depends on another local package would fail
because it couldn't find the local dependency.

The implementation follows the same pattern as other v2 commands, creating a full
project context that knows about all packages defined in the cabal.project file.
This allows `gen-bounds` to properly analyze dependencies between local packages
and suggest appropriate bounds.

```
cabal gen-bounds <TARGET>
```

Fixes #7504 #8654 #9752 #5932
mpickering added a commit that referenced this issue Mar 20, 2025
This commit implements project-aware functionality for the `cabal gen-bounds` command,
allowing it to work correctly in multi-package projects. Previously, running `gen-bounds`
from within a package directory that depends on another local package would fail
because it couldn't find the local dependency.

The implementation follows the same pattern as other v2 commands, creating a full
project context that knows about all packages defined in the cabal.project file.
This allows `gen-bounds` to properly analyze dependencies between local packages
and suggest appropriate bounds.

```
cabal gen-bounds <TARGET>
```

Fixes #7504 #8654 #9752 #5932
mpickering added a commit that referenced this issue Mar 21, 2025
This commit implements project-aware functionality for the `cabal gen-bounds` command,
allowing it to work correctly in multi-package projects. Previously, running `gen-bounds`
from within a package directory that depends on another local package would fail
because it couldn't find the local dependency.

The implementation follows the same pattern as other v2 commands, creating a full
project context that knows about all packages defined in the cabal.project file.
This allows `gen-bounds` to properly analyze dependencies between local packages
and suggest appropriate bounds.

```
cabal gen-bounds <TARGET>
```

Fixes #7504 #8654 #9752 #5932
mpickering added a commit that referenced this issue Mar 21, 2025
This commit implements project-aware functionality for the `cabal gen-bounds` command,
allowing it to work correctly in multi-package projects. Previously, running `gen-bounds`
from within a package directory that depends on another local package would fail
because it couldn't find the local dependency.

The implementation follows the same pattern as other v2 commands, creating a full
project context that knows about all packages defined in the cabal.project file.
This allows `gen-bounds` to properly analyze dependencies between local packages
and suggest appropriate bounds.

```
cabal gen-bounds <TARGET>
```

Fixes #7504 #8654 #9752 #5932
mpickering added a commit that referenced this issue Mar 21, 2025
This commit implements project-aware functionality for the `cabal gen-bounds` command,
allowing it to work correctly in multi-package projects. Previously, running `gen-bounds`
from within a package directory that depends on another local package would fail
because it couldn't find the local dependency.

The implementation follows the same pattern as other v2 commands, creating a full
project context that knows about all packages defined in the cabal.project file.
This allows `gen-bounds` to properly analyze dependencies between local packages
and suggest appropriate bounds.

```
cabal gen-bounds <TARGET>
```

Fixes #7504 #8654 #9752 #5932
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants