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
- Clone https://github.com/antoine-fl/resolver-issue
- 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
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
stack build.Expected
The build should be fine
Actual
The build failed with the following error:
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
Method of installation