haskell / haskell/cabal

Foreign libs not reconfigured when dependency versions change

Open
#4,678 1 comment 0 reactions 0 assignees View on GitHub
cabal-install: v2-build system recompilation
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I have a package with both a regular library (lib) and a foreign-lib (flib) which depends on the former. If I build this package with new-build and then change the version constraint of a dependency of lib the resulting flib is linked against the correct version of the dependencies' .so but the RPATH/RUNPATH in flib still mentions only the old dependency version.

Here is a minimal reproducer: https://github.com/DanielG/cabal-flib-invalid-cache-repro

The `./repro.sh` script just builds the package twice, once with `--constraint 'bytestring ==0.9.2.1'` and once with `--constraint 'bytestring ==0.10.8.1'` and then calls `ldd` and `objdump -x` (to get the RPATH). As can be seen from the output (reproduced in the README there) the `R*PATH` is incorrect.

I've looked into what is causing this and it seems the flib is not getting reconfigured when the dependency version of the lib changes and thus it's still using the old `LocalBuildInfo` structure for the `Distribution.Simple.GHC.getRPaths`.

I'm not exactly sure but I think if've tracked it down to `Distribution.Client.ProjectBuilding.rebuildTargetsDryRun` which generates the `BuildStatusMap`, specifically the call to `checkPackageFileMonitorChanged` in there but I'm really quite confused about how this "monitor" buissness all ties togeter.

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.