Skip to content

gen-bounds does not work in multiprojects #7504

Closed

Description

@newhoggy

Describe the bug
For multiprojects where one package depends on another inside the project, cabal gen-bounds does not work for projects that have local dependencies.

To Reproduce
Steps to reproduce the behavior:

$ tar zxvf gen-bounds.tar.gz
$ cd gen-bounds
$ cabal build all
$ cd package-b
$ cabal gen-bounds
Warning: The package list for 'hackage.haskell.org' is 15 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: package-b-0.1.0.0 (user goal)
[__1] unknown package: package-a (dependency of package-b)
[__1] fail (backjumping, conflict set: package-a, package-b)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: package-b, package-a

Projects that reference git repositories in cabal.project fail similarly.

Expected behavior
cabal should recognise it is in a multiproject and be able to find local dependencies.

System information

  • MacOS (and possibly others)
  • cabal-3.4, ghc-8.10.4

Additional context
Attached example code.
gen-bounds.tar.gz

Activity

  1. Mikolaj commented on Aug 3, 2021

    @Mikolaj
    Member

    Indeed, the use of ComponentRequestedSpec in genBounds seems suspect.

  2. ysangkok commented on Sep 27, 2021

    @ysangkok
    Member

    I can't reproduce this with Cabal 3.6.0.0 and GHC 9.0.1. I did get an error regarding the base bounds, but I think that is not relevant to this issue. So I fixed it, and everything built.

  3. Mikolaj commented on Sep 28, 2021

    @Mikolaj
    Member

    Actually, I can't reproduce with cabal-3.4 and ghc-8.10.7 (Linux). What was your OS, @ysangkok?

    @newhoggy: any reason this can fail only on MacOS? Case sensitivity? Anything else?

    Could anybody else wirh MacOS repro? Best if with cabal 3.4 and cabal 3.6.

  4. ysangkok commented on Sep 28, 2021

    @ysangkok
    Member

    @Mikolaj I tested on Ubuntu 21.04.

  5. jneira commented on May 15, 2022

    @jneira
    Member

    @newhoggy could you confirm if it still is reproduced in your macos with other cabal and ghc versions?

  6. andreasabel commented on Aug 17, 2022

    @andreasabel
    Member

    This still reproduces with latest cabal (on macOS with GHC 8.10.7). There was a typo in the reproducer (which I edited out just now). The correct reproducer is:

    $ cabal build all
    $ cd package-b
    $ cabal gen-bounds
    Error: cabal: Could not resolve dependencies:
    [__0] trying: package-b-0.1.0.0 (user goal)
    [__1] unknown package: package-a (dependency of package-b)
    [__1] fail (backjumping, conflict set: package-a, package-b)
    

    The problem is that local package-a, which package-b depends on, isn't known from the package-b directory as root. It is known from the project root (containing cabal.project), but cabal gen-bounds does not work on projects, only on individual cabal files.

    So, the issue is just the same as in the OP.

  7. 3 remaining items

  8. fendor commented on Sep 30, 2022

    @fendor
    Collaborator

    I guess gen-bounds just doesn't use the new-style project orchestration. Ideally, this just about migrating the old code to the new infrastructure.

  9. nuttycom commented on Nov 27, 2022

    @nuttycom

    I have a similar/related issue that a cabal.project file referring to a dependency on github prevents gen-bounds from working (though cabal build works fine.)

  10. added 7 commits that reference this issue on Mar 20, 2025
    5a24313
    7b92cdc
    81e2cb7
    04c7f02
    7ab786f
    b7dac1b
    6ae908d
  11. added a commit that references this issue on May 27, 2025
    4e0ad33
  12. added a commit that references this issue on Jun 14, 2025
    b41f09a
  13. added 2 commits that reference this issue on Aug 25, 2025
    2be46f0
    25bb4fb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions