Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail when trying to pin a package whose definition could not be found instead of forcing interactive edition #6319

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kit-ty-kate
Copy link
Member

Fixes #6322
This could happen with things like opam pin <typo> <url> or a typo in the pin-depends definition.

The interactive edition based on the dummy opam file template is now only allowed if the user is purposefully requesting it using --edit or opam pin edit.

@kit-ty-kate kit-ty-kate added this to the 2.4.0~alpha1 milestone Nov 30, 2024
@kit-ty-kate kit-ty-kate requested a review from rjbou November 30, 2024 19:11
OpamConsole.note
"No package definition found for %s: please complete the template"
(OpamConsole.colorise `bold (OpamPackage.to_string nv));
OpamFileTools.template nv
Copy link
Member Author

Choose a reason for hiding this comment

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

do we really want to keep this template around? In which situation is it useful? I feel like it doesn't really has any purpose and we might want to remove it entirely (probably in a separate PR)

@kit-ty-kate kit-ty-kate force-pushed the no-edit-pkg-not-found-pin branch from 39b1927 to 5e0a66d Compare November 30, 2024 23:43
@rjbou
Copy link
Collaborator

rjbou commented Dec 6, 2024

Discussion on dev meeting: Overall agreement on blocked CI issue. We can't set the editing only on non tty as it is used hackishly in several places (our test for ex.) with specific command in OPAMEDITOR (cp/sed/etc.).
This option was useful at the beginning of opam, to ease pinning packages that didn't have yet an opam file, but today almost all OCaml package have one. And if it is missing, it will mostly be added in the repository itself than just internally in users opam switch. But we need to keep the ability to do that, and opam pin add --edit can permit it.

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.

Stuck when pinning non-existent package
2 participants