Skip to content

cabal gen-bounds ignores project file #9752

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
alt-romes opened this issue Feb 28, 2024 · 6 comments · May be fixed by #10840
Open

cabal gen-bounds ignores project file #9752

alt-romes opened this issue Feb 28, 2024 · 6 comments · May be fixed by #10840

Comments

@alt-romes
Copy link
Collaborator

alt-romes commented Feb 28, 2024

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
Copy link
Collaborator Author

Same for cabal outdated

@ffaf1
Copy link
Collaborator

ffaf1 commented Feb 28, 2024

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

@ffaf1
Copy link
Collaborator

ffaf1 commented Feb 28, 2024

Documentation: --help, Manual is correct.

@alt-romes
Copy link
Collaborator Author

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...

@ulysses4ever
Copy link
Collaborator

Perhaps duplicate of:

@ffaf1
Copy link
Collaborator

ffaf1 commented Feb 28, 2024

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.

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.

3 participants