Skip to content
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

Show why configuring dependencies failed #10273

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

9999years
Copy link
Collaborator

@9999years 9999years commented Aug 23, 2024

When act-as-setup configure fails, it doesn't indicate which dependencies are missing entirely and which ones don't satisfy the version constraints. The errors from cabal build are more informative, but aren't available in all contexts (nixpkgs Haskell builds, for example, use the act-as-setup interface). This makes it immediately clear what sort of dependency error has occurred.

Before (cabal-install 3.12.1.0):

Configuring test-pkg-0.1.0.0...
Error: [Cabal-8010]
Encountered missing or private dependencies:
    base <=4.18,
    foobar,
    test-pkg:{bar-internal, foo-internal}

After:

Configuring test-pkg-0.1.0.0...
Error: [Cabal-8010]
Encountered missing or private dependencies:
    base <=4.18 (installed: 4.19.1.0),
    foobar (missing),
    test-pkg:{bar-internal,foo-internal} (missing: :bar-internal)

Please let me know if you're interested in this patch and I can write tests and polish up the documentation.


Please read Github PR Conventions and then fill in one of these two templates.


Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.
  • Manual QA notes have been included.
  • Tests have been added. (Ask for help if you don’t know how to write them! Ask for an exemption if tests are too complex for too little coverage!)

Copy link
Collaborator

@geekosaur geekosaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, I'm not qualified to determine whether this is logically correct, only that it looks reasonable (and being a spell checker 😛).

Cabal/src/Distribution/Simple/PackageIndex.hs Outdated Show resolved Hide resolved
Cabal/src/Distribution/Simple/PackageIndex.hs Outdated Show resolved Hide resolved
Cabal/src/Distribution/Simple/PackageIndex.hs Outdated Show resolved Hide resolved
Cabal/src/Distribution/Simple/PackageIndex.hs Outdated Show resolved Hide resolved
Cabal/src/Distribution/Simple/PackageIndex.hs Outdated Show resolved Hide resolved
Cabal/src/Distribution/Simple/Configure.hs Outdated Show resolved Hide resolved
Cabal/src/Distribution/Simple/Configure.hs Outdated Show resolved Hide resolved
Cabal/src/Distribution/Simple/Configure.hs Outdated Show resolved Hide resolved
Cabal/src/Distribution/Simple/Configure.hs Outdated Show resolved Hide resolved
@9999years 9999years force-pushed the missing-or-private-details branch 5 times, most recently from 2b37276 to 310a3ed Compare August 26, 2024 22:54
@9999years
Copy link
Collaborator Author

Ah, the tests are failing because they pass the exact ID of the base library (which varies per GHC version under test), and that shows up in the output. Not sure how to work around that with the expect tests.

@jasagredo
Copy link
Collaborator

You should probably work out how to identify those and replace them with a common string in OutputNormalizer.hs

When `act-as-setup configure` fails, it doesn't indicate which
dependencies are missing entirely and which ones don't satisfy the
version constraints. The errors from `cabal build` are more informative,
but aren't available in all contexts (nixpkgs Haskell builds, for
example, use the `act-as-setup` interface). This makes it immediately
clear what sort of dependency error has occurred.

Before (cabal-install 3.12.1.0):

    Configuring test-pkg-0.1.0.0...
    Error: [Cabal-8010]
    Encountered missing or private dependencies:
        base <=4.18,
        foobar,
        test-pkg:{bar-internal, foo-internal}

After:

    Configuring test-pkg-0.1.0.0...
    Error: [Cabal-8010]
    Encountered missing or private dependencies:
        base <=4.18 (installed: 4.19.1.0),
        foobar (missing),
        test-pkg:{bar-internal,foo-internal} (missing: :bar-internal)
@9999years 9999years marked this pull request as draft September 17, 2024 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants