Skip to content

Fix opam config subst handling of absolute paths - #6936

Merged
kit-ty-kate merged 2 commits into
ocaml:masterfrom
NathanReb:fix-opam-config-subst-absolute-path
Jun 29, 2026
Merged

Fix opam config subst handling of absolute paths#6936
kit-ty-kate merged 2 commits into
ocaml:masterfrom
NathanReb:fix-opam-config-subst-absolute-path

Conversation

@NathanReb

Copy link
Copy Markdown
Collaborator

Fixes #6925

This PR fixes opam config subst so that it treats absolute paths correctly.

What this PR does not do is change the current subst behaviour which is in my opinion a bit shady. opam config subst <path> will not rewrite <path> in place, substituting variables, as is described in the manual/command's --help section but instead expects to find a <path>.in file and will write the result of the substitution in <path>.

The fact this hasn't been reported seem to indicate it is probably unused but I thought that fixing the absolute paths handling to be necessary since I touched this particular part of the code in #6910.

@NathanReb
NathanReb force-pushed the fix-opam-config-subst-absolute-path branch from cb9cb8e to 8449b7b Compare May 18, 2026 08:49
@kit-ty-kate kit-ty-kate added this to the 2.6.0~alpha1 milestone Jun 27, 2026
Comment thread master_changes.md Outdated
Comment thread master_changes.md Outdated
Comment thread tests/reftests/config.test Outdated
@kit-ty-kate
kit-ty-kate force-pushed the fix-opam-config-subst-absolute-path branch from 085cf09 to 95c8c8e Compare June 29, 2026 13:34
Signed-off-by: Nathan Rebours <nathan.rebours@ocamlpro.com>
Signed-off-by: Nathan Rebours <nathan.rebours@ocamlpro.com>
@kit-ty-kate
kit-ty-kate force-pushed the fix-opam-config-subst-absolute-path branch from 95c8c8e to 819f558 Compare June 29, 2026 13:37
@kit-ty-kate

Copy link
Copy Markdown
Member

Thanks!

@kit-ty-kate
kit-ty-kate merged commit b1f264b into ocaml:master Jun 29, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opam config subst does not support absolute pathnames

3 participants