old openssl version linked by dream prevents installation of downstream packages
I reported this issue first at https://github.com/panglesd/slipshow/issues/157 . See there for more details and history.
The short version is this:
- An opam switch with ocaml 5.3.0 is created and slipshow is installed, which leads to the chain of dependencies
conf-openssl->dream-> slipshow being installed - later homebrew updates openssl from 3.5.2 to 3.6.0.
- updating slipshow now fails. dream installs, but slipshow has a linking problem, see the issue above
- also installing other dream dependents fails, tried: dream-serve
In a fresh opam switch, slipshow installs successfully with [email protected], which is the only version available on the system
I would suspect that an outdated location for openssl is kept somewhere in opam metadata.
I'm happy to provide detail in addition to https://github.com/panglesd/slipshow/issues/157 if required
Homebrew is one of the package manager that breaks the path to the libraries they package quite often, due to the way they install things. It more rarely happens on other systems but it still does to some extend as we're currently not tracking the path of the dynamic library files.
Doing this would require changing the way we currently deal with external dependencies and probably do tricky scanning of dynamic dependencies of executables/installed files. Somewhat related to https://github.com/ocaml/opam/issues/3140
In the meantime, looking at the the definition of conf-libssl and trying the upgrade myself i can't see anything wrong with the way the symlink (used to go around this known issue) is setup, however the symlinked pkgconfig files do point to the non-symlinked version of the library and thus would produce an executable that breaks whenever the lib directory is removed (e.g. on upgrades).
I personally think this issue should be fixed in homebrew, and i remember some of the maintainer did say that this kind of issue is a indeed a bug, in the past
I ran into an apparently related issue today. After homebrew updated llvm from 21.1.13 to 21.1.14, I could no longer build a program depending on the nx and rune libraries due to linking problems. What fixed it was to reinstall nx which apparently links to llvm; potentially also the downstream rune is the one that does.
Even though homebrew may be at fault, what I find problematic is that the only error message I got was
ld: warning: search path '/opt/homebrew/Cellar/llvm/21.1.3/lib' not found
without an easy way to trace which of my dependencies actually links to llvm; so resolving this was trial and error.
Discussed on dev meeting: One solution would be to used file depends feature in those conf-* opam files. It'll permit to highlight the change of the system file earlier: opam would print a message if the specified system file is no longer existent. ocaml-system packages work that way. It's not the solution, not even ideal, but it could help.
It's not the solution, not even ideal, but it could help.
mh, it's not ideal in the sense that this has to be implemented in conf-libssl/conf-llvm/... in opam-repository but i think it is the solution. file-depends will mark the package for reinstall so the dependent packages will be reinstalled and this kind of error should disappear