commercialhaskell / commercialhaskell/stack

Dependencies without .cabal files are not found with custom resolver

Open
#5,295 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

### 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: https://github.com/antoine-fl/resolver-issue/pull/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: https://github.com/antoine-fl/resolver-issue/pull/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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.