Skip to content

Confusing error message when a cabal file for an extra-dep can't be found #3806

Closed
@MaxGabriel

Description

@MaxGabriel

General summary/comments (optional)

When the cabal file for an extra-dep can't be found, stack suggests the problem is with the packages field, not extra-deps.

Steps to reproduce

For example:

  1. Add a reference to a repo without a cabal file to your extra-deps (see YAML)
  2. Run command stack build.
# A fork of amazonka, which is a mega-repo, so the root directory doesn't have a cabal file
extra-deps:
  - git: https://github.com/tvision-insights/amazonka.git
    commit: 9d914189042d6d31ffee912436ddfacde08f1b50

Expected

The user is told which dependency the cabal file couldn't be found for, or at least that an extra-dep was the problem, or that it could be an extra-dep that is the problem.

Actual

Stack implies that my packages field is the problem with this message:

Stack looks for packages in the directories configured in the 'packages' variable defined in your stack.yaml

(See #2729)

Stack version

$ stack --version
Version 1.6.3, Git revision b27e629b8c4ce369e3b8273f04db193b060000db (5454 commits) x86_64 hpack-0.20.0

Method of installation

  • Official binary, downloaded from stackage.org or fpcomplete's package repository, upgraded via stack upgrade

Potential fixes:

  • Quick fix: Modify the message to mention extra-deps
  • Potentially better: pass the package being searched for down so that the error message can be more detailed. I think usually this will be unnecessary, because the path itself is probably much more helpful for non-git repo downloads.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions