Skip to content

Fix opam pin list when the internal source directory of the pinned package doesn't exist#6597

Draft
kit-ty-kate wants to merge 2 commits intoocaml:masterfrom
kit-ty-kate:fix-opam-pin-no-dir
Draft

Fix opam pin list when the internal source directory of the pinned package doesn't exist#6597
kit-ty-kate wants to merge 2 commits intoocaml:masterfrom
kit-ty-kate:fix-opam-pin-no-dir

Conversation

@kit-ty-kate
Copy link
Copy Markdown
Member

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

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

pinned-pkg is now pinned to git+file://${BASEDIR}/no-source-dir#master (version dev)
### rm -r OPAM/no-source-dir/.opam-switch/sources/pinned-pkg
### opam pin
pinned-pkg.dev (uninstalled) git git+file://${BASEDIR}/no-source-dir#master (at error while fetching current revision)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pinned-pkg.dev (uninstalled) git git+file://${BASEDIR}/no-source-dir#master (at error while fetching current revision)
pinned-pkg.dev (uninstalled) git git+file://${BASEDIR}/no-source-dir#master (error while fetching current revision)

Or even more concise

Suggested change
pinned-pkg.dev (uninstalled) git git+file://${BASEDIR}/no-source-dir#master (at error while fetching current revision)
pinned-pkg.dev (uninstalled) git git+file://${BASEDIR}/no-source-dir#master (no revision found)

@rjbou
Copy link
Copy Markdown
Collaborator

rjbou commented Jul 15, 2025

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...)

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