source-repository-package not optional
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
I was hoping that I can use `source-repository-package` to point to “optional” dependencies, i.e. dependencies that are used when needed, but not built when not. I want to use this in my `cabal.project`:
```
source-repository-package
type: git
location: https://github.com/ghcjs/ghcjs-base
tag: 01014ade3f8f5ae677df192d7c2a208bd795b96c
```
because `ghcjs-base` is not on Hackage yet. The problem is that this package is only a dependency of `jsaddle` when using `ghcjs`, but not when using `ghc`. Furthemore, `ghcjs-base` has dependencies that cannot be fulfilled with `ghc`.
So with this in `cabal.project`, `cabal` thinks it *has to* build `ghcjs-base`, even with using `ghc`, and fails.
Contributor guide
Research direction
Start by reproducing the example in cabal.project with ghc and ghcjs, comparing how source-repository-package dependencies are selected and built. Read the project configuration and dependency-resolution paths involved in that behavior. Done means the source repository is available for the ghcjs-only dependency without being built, or causing unsatisfied dependencies, when using ghc.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100