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

opam pin ./local#mybranch does not take mybranch opam file #6408

Open
rjbou opened this issue Mar 5, 2025 · 0 comments · May be fixed by #6409
Open

opam pin ./local#mybranch does not take mybranch opam file #6408

rjbou opened this issue Mar 5, 2025 · 0 comments · May be fixed by #6409

Comments

@rjbou
Copy link
Collaborator

rjbou commented Mar 5, 2025

When we pin a local VCS directory, if the locally fetched branch is not the one that is specified in argument, opam look up for the local directory without taking into account the branch.
Example:

> git checkout snd
Switched to branch 'snd'
> git ls-files
snd.opam
> git checkout fst
Switched to branch 'fst'
> git ls-files
fst.opam
> cd ..
> opam pin snd ./mydir#snd -n
[NOTE] Package snd does not exist in opam repositories registered in the current switch.
[snd.dev] synchronised (git+file://path/to/mydir#snd)
[NOTE] No package definition found for snd.dev: please complete the template
[WARNING] The opam file didn't pass validation:
             error 22: Some fields are present but empty; remove or fill them: "homepage", "license", "bug_reports"
             error 57: Synopsis must not be empty
           warning 62: License doesn't adhere to the SPDX standard, see https://spdx.org/licenses/ : ""
Proceed anyway ('no' will re-edit)? [Y/n] y
You can edit this file again with "opam pin edit snd", export it with "opam show snd --raw"
snd is now pinned to git+file://path/to/local#snd (version dev)

This is due to the magic lookup of an opam file : it should be retrieved even if it is not committed.

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 a pull request may close this issue.

1 participant