commercialhaskell / commercialhaskell/stack
Feature Request: Expose subdirectory of archive dependencies in ls dependencies json
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
**Feature Request**
I would like the output of `stack ls dependencies json` to contain the subdirectory of archive dependencies.
For example, given the following `extra-deps` entry in `stack.yaml`:
```
extra-deps:
- github: tweag/funflow
commit: 7d8f088f2087423a9314d75c4d0d0c46806dde1e
subdirs:
- funflow
- cas/hashable
- cas/store
```
I would like the output of `stack ls dependencies json` to include `location` entries of the following form:
```
"location":
{"size": ...
, "subdir": "funflow-7d8f088f2087423a9314d75c4d0d0c46806dde1e/funflow/funflow.cabal"
, "url": "https://github.com/tweag/funflow/archive/7d8f088f2087423a9314d75c4d0d0c46806dde1e.tar.gz"
, "type": "archive"
, "sha256": ...
}
...
"location":
{"size": ...
, "subdir": "funflow-7d8f088f2087423a9314d75c4d0d0c46806dde1e/cas/hashable/cas-hashable.cabal"
, "url": "https://github.com/tweag/funflow/archive/7d8f088f2087423a9314d75c4d0d0c46806dde1e.tar.gz"
, "type": "archive"
, "sha256": ...
}
...
"location":
{"size": ...
, "subdir": "funflow-7d8f088f2087423a9314d75c4d0d0c46806dde1e/cas/store/cas-store.cabal"
, "url": "https://github.com/tweag/funflow/archive/7d8f088f2087423a9314d75c4d0d0c46806dde1e.tar.gz"
, "type": "archive"
, "sha256": ...
}
```
**Motivation**
`stack ls dependencies json` is very useful for build tools that would like to call out to `stack` to determine how to build Stackage dependencies. However, currently `stack` does not provide which subdirectory of an archive dependency contains the actual package. The tool that consumes `stack ls dependencies json` will need to replicate some of `stack`'s logic for detecting subdirectories or apply heuristics. See https://github.com/tweag/rules_haskell/issues/1392#issuecomment-657472777.
Contributor guide
Assessment
This issue has not been assessed yet.