Reinstall conf packages when related external dependencies are upgraded

clangml reinstallations regularly break when the underlying llvm dep-ext (a system package) is upgraded, because the detection of the system package is performed by conf-libclang, and the detected paths (stored in package variables) are no longer valid after upgrade.

A workaround is to run opam reinstall conf-libclang to detect the new paths, but this is not intuitive for the users.

In an ideal world, I would like to tell opam that conf-libclang should be reinstalled each time the external dependency has changed, but I doubt there exists such a mechanism.

Another possibility is to duplicate the detection logic implemented in conf-libclang directly in the package clangml itself, but that is not very satisfactory and, in that case, I will not see the point to keep a separate conf-libclang package anymore.

I think it should be a common problem for all conf packages relying on external dependencies. Are there any better solutions?


I faced this issue as well when using sqlite. Perhaps we should open an issue in the opam tracker?

Maybe the conf-libclang package could generate a config file and attempt to leverage the file-depends field ?

1 Like

Thank you very much, @AltGr ! I missed the file-depends field and I think it answers my needs. I just updated the conf-libclang package: Package conf-libclang: Use file-depends to track llvm-config by thierry-martinez · Pull Request #21280 · ocaml/opam-repository · GitHub

Thanks again!