haskell / haskell/cabal

Only choose buildable components for build-depends and build-tool-depends dependencies.

Open
#5,325 9 comments 1 reaction 0 assignees View on GitHub
cabal-install: solver re: build-tool type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

See https://github.com/haskell/cabal/pull/5304#issuecomment-388626764 and https://github.com/haskell/cabal/issues/3978#issuecomment-388504699 for an example involving `http-client-0.5.12.1`. The library stanza contains

```
-- See build failure at https://travis-ci.org/snoyberg/http-client/jobs/359573631
if impl(ghc < 7.10)
buildable: False
```

The solver doesn't backtrack to find an older version with a buildable library, and cabal fails with (from https://github.com/haskell/cabal/pull/5304#issuecomment-388626764):

```
$ cabal new-build -w ghc-7.8.4 --index-state='2018-05-09T06:20:23Z'
Error:
Dependency on unbuildable library from http-client
In the stanza 'library'
In the inplace package 'zzz-0'
```

This issue is a continuation of #3978, which described a bad error message for an unbuildable component. Its regression test tests the current error message:

https://github.com/haskell/cabal/blob/898fcc230fb537064f0992cfffb5955b6bc36d34/cabal-testsuite/PackageTests/NewBuild/T3978/cabal.out#L1-L6

This issue should probably be fixed as part of #4087.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported command with GHC 7.8.4 and the stated index state, then read cabal-testsuite/PackageTests/NewBuild/T3978/cabal.out and the linked discussions for the existing behavior. Done means dependency solving selects a buildable component or an appropriate older version instead of failing on an unbuildable library, with the regression test updated accordingly.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.