Cabal 3.8 expects `pkg-config --libs --static` to always work.
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
See https://github.com/haskell/cabal/commit/bf32602db5770a312fe632b997ff9b7c7e4d0329 and https://github.com/input-output-hk/haskell.nix/issues/1642
I think it is unreasonable for cabal to expect `pkg-config --libs --static` to work when only dynamic libraries may be installed on a system.
**To Reproduce**
```
$ cabal --version
cabal-install version 3.9
compiled using version 3.9.0.0 of the Cabal library
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.10.7
$ cabal v2-install haskell-gi-base -v3
...
```
In `setup configure` for `haskell-gi-base` you will see it has both:
```
Running: SOME_PATH/pkg-config --libs gobject-2.0 glib-2.0
Running: SOME_PATH/pkg-config --libs --static gobject-2.0 glib-2.0
```
On nix you can run something like this to see the second one fail:
```
nix-shell -E 'let pkgs = import {}; in pkgs.mkShell { buildInputs = [ pkgs.gtk4.dev pkgs.pkgconfig ]; }' --run 'cabal v2-install haskell-gi-base -v3'
```
**Expected behavior**
Perhaps cabal could store the error and replay it when the linker arguments are actually needed.
Contributor guide
Assessment
This issue has not been assessed yet.