Skip to content

Dependencies without .cabal files are not found with custom resolver #5295

@antoine-fl

Description

@antoine-fl

General summary

If a dependency is specified by a git commit in a custom resolver and if that dependency did not commit the .cabal file, stack is not able to find it.

Steps to reproduce

  1. Clone https://github.com/antoine-fl/resolver-issue
  2. Run stack build.

Expected

The build should be fine

Actual

The build failed with the following error:

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for resolver-issue-0.1.0.0:
    dummy-dep needed, but the stack configuration has no specified version (no package with that name found,
              perhaps there is a typo in a package's build-depends or an omission from the stack.yaml packages
              list?)
needed since resolver-issue is a build target.

Some different approaches to resolving this:


Plan construction failed.

Workarounds

1. Committing the .cabal file in the dependency repo

As done in this PR: antoine-fl/resolver-issue#1
But this require to have commit access to the dependency and be willing to do a dependency bump.

2. Adding the dependency to the stack.yaml file

As done in this PR: antoine-fl/resolver-issue#2

Stack version

$ stack --version
Version 2.3.1, Git revision de2a7b694f07de7e6cf17f8c92338c16286b2878 (8103 commits) x86_64 hpack-0.33.0

Method of installation

  • Upgrade from an older version installed from stackage.org

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions