Skip to content

Make paths from ld.conf absolute - #119

Closed
rlepigre-skylabs-ai wants to merge 1 commit into
ocaml:masterfrom
rlepigre-skylabs-ai:fix_paths
Closed

Make paths from ld.conf absolute#119
rlepigre-skylabs-ai wants to merge 1 commit into
ocaml:masterfrom
rlepigre-skylabs-ai:fix_paths

Conversation

@rlepigre-skylabs-ai

Copy link
Copy Markdown
Contributor

This fixes #115 by making relative paths contained in a read ld.conf file absolute (by making them relative to the directory holding the ld.conf file). This is necessary for reading the ld.conf file that is installed by OCaml 5.5.0, which on current opam switch contains:

../stublibs
./stublibs
.

Note however that this will lead to the following paths with this PR, since no normalization is performed.

$OPAM_SWTCH_PREFIX/lib/ocaml/../stublibs
$OPAM_SWTCH_PREFIX/lib/ocaml/./stublibs
$OPAM_SWTCH_PREFIX/lib/ocaml/.

I believe this could have implications for parts of the system that deal with installing / uninstalling packages, but it could well be that things are fine if the paths are always consistent. In any case, I'm not sure the install/uninstall features are widely used now that most packages rely on dune.

@dra27

dra27 commented Jul 17, 2026

Copy link
Copy Markdown
Member

Thanks for this - you're right that the normalisation is technically a problem for the detection which findlib does when updating ld.conf (not that that is a very common way to use findlib these days, I think - opam, in particular, is not configured that way). There's a commit in #122 which does both this, and the normalisation.

@rlepigre-skylabs-ai

Copy link
Copy Markdown
Contributor Author

OK, thanks. Should we just close this PR then?

@dra27

dra27 commented Jul 18, 2026

Copy link
Copy Markdown
Member

Closing in favour of implementation in #122

@dra27 dra27 closed this Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ocamlfind warning "Cannot read directory ../stublibs which is mentioned in ld.conf"

2 participants