haskell / haskell/cabal

Special treatment of pre-installed packages by the solver

Open
#9,669 64 comments 6 reactions 1 assignee Claimed by @TeofilC View on GitHub
cabal-install: solver re: user experience type: user-question
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

The cabal solver seems to treat pre-installed packages specially (e.g. those shipped with GHC).

To reproduce:

```
git clone https://github.com/hasufell/toto.git
cd toto
ghcup run --ghc 9.4.8 -- cabal build
```

This should cause a failure, because ghc-9.4.8 ships with filepath-1.4.2.2, but the package above uses modules from 1.4.100.1. The package has no upper bounds on filepath. **For any other non-pre-installed package, the solver would pick the latest**.

I understand that this is by design, but I question this design here, because:

* it makes it harder for core library maintainers to ship bugfixes
* it's a potential security risk

@mpickering found out that there used to be a `--upgrade-dependencies` switch, which is now disabled.

I argue that the **default should be to pick the latest possible version anyway**.

----

CCing some potentially interested parties: @simonpj @frasertweedale

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.