Skip to content

Improve the error message of opam pin list when the internal source directory of the pinned package doesn't exist - #6597

Merged
kit-ty-kate merged 2 commits into
ocaml:masterfrom
kit-ty-kate:fix-opam-pin-no-dir
Jul 13, 2026
Merged

Improve the error message of opam pin list when the internal source directory of the pinned package doesn't exist#6597
kit-ty-kate merged 2 commits into
ocaml:masterfrom
kit-ty-kate:fix-opam-pin-no-dir

Conversation

@kit-ty-kate

@kit-ty-kate kit-ty-kate commented Jul 15, 2025

Copy link
Copy Markdown
Member

Regression from #6274

$ opam install .
[...]
Would you like to install? [Y/n] n
$ opam pin
/usr/local/bin/opam: "chdir" failed on .../.opam-switch/sources/<pkg>: No such file or directory

Backported to the 2.4 branch in #6598

Update: #6597 (comment)

Comment thread tests/reftests/pin.test Outdated
Comment thread tests/reftests/pin.test Outdated
@rjbou

rjbou commented Jul 15, 2025

Copy link
Copy Markdown
Collaborator

On the idea, lgtm!

@rjbou rjbou changed the title Fix opam pin when the source of the pinned package doesn't exist Fix opam pin list when the source of the pinned package doesn't exist Jul 15, 2025
@rjbou rjbou changed the title Fix opam pin list when the source of the pinned package doesn't exist Fix opam pin list when the internal source directory of the pinned package doesn't exist Jul 15, 2025
@kit-ty-kate
kit-ty-kate force-pushed the fix-opam-pin-no-dir branch from af76a61 to aa6f813 Compare July 15, 2025 17:39
@kit-ty-kate

Copy link
Copy Markdown
Member Author

TODO:

  • remove the chdirs everywhere (cf. multicore PR)
  • avoid the catch-all (OpamStd.Exn...)

@kit-ty-kate
kit-ty-kate marked this pull request as ready for review July 13, 2026 14:41
@kit-ty-kate

Copy link
Copy Markdown
Member Author

This was actually fixed by #6910. So now the only addition of this PR is the removal of the weird (at error ...) phrasing and the specific test

@kit-ty-kate
kit-ty-kate force-pushed the fix-opam-pin-no-dir branch from aa6f813 to 2d5464b Compare July 13, 2026 21:28
@kit-ty-kate kit-ty-kate changed the title Fix opam pin list when the internal source directory of the pinned package doesn't exist Improve the error message of opam pin list when the internal source directory of the pinned package doesn't exist Jul 13, 2026
@kit-ty-kate

Copy link
Copy Markdown
Member Author

Ignoring the benchmark still searching for a build machine bc the result doesn't matter anyway

@kit-ty-kate
kit-ty-kate merged commit 6a1bd34 into ocaml:master Jul 13, 2026
40 of 41 checks passed
@kit-ty-kate
kit-ty-kate deleted the fix-opam-pin-no-dir branch July 13, 2026 23:58
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.

2 participants