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 fails adding new or multiple packages when --no-action is present #3199

Open
kit-ty-kate opened this issue Jan 27, 2018 · 6 comments · May be fixed by #6309
Open

opam pin fails adding new or multiple packages when --no-action is present #3199

kit-ty-kate opened this issue Jan 27, 2018 · 6 comments · May be fixed by #6309

Comments

@kit-ty-kate
Copy link
Member

kit-ty-kate commented Jan 27, 2018

For now the opam pin command used with the --no-action/-n argument fails if the package pinned is new or if we try to add multiple packages from a single directory.
This behaviour does not really matches the intended purpose of --no-action, namely:

Just record the new pinning status, and don't prompt for
(re)installation or removal of affected packages.

Moreover the default behaviour in opam 1.2.2 in regards to adding new package was to add them anyway. --no-action didn't really play any role there but imho for scripts it is important to keep this behaviour and to be able to pin packages without installing them.

@AltGr
Copy link
Member

AltGr commented Jan 29, 2018

Could you give details on the interaction you are expecting ? By 'new', do you mean a package without metadata ?

This works:

% cat >opam
opam-version: "2.0"  
version: "test"
build: "false"
% opam pin -n .
Package foo does not exist, create as a NEW package ? [Y/n] y
[foo.~dev] synchronised from file:///tmp/foo
[WARNING] Failed checks on foo package definition from source at file:///tmp/foo:
    error 23: Missing field 'maintainer'
    error 25: Missing field 'authors'
    error 35: Missing field 'homepage'
  warning 36: Missing field 'bug-reports'
foo is now pinned to file:///tmp/foo (version test)

@AltGr
Copy link
Member

AltGr commented Mar 28, 2018

@kit-ty-kate Do you have any details on this ? I confirm that you are expecting the right thing from -n

@kit-ty-kate
Copy link
Member Author

Oh sorry I missed your first ping. Hum, well your example above doesn't work if you are using docker for instance. Of course if we add -y to the pin command it works but my point being that the behaviour is different between pining an existing package and pinning a new (that doesn't exist yet in the list of packages) or multiple packages because opam first asks questions like "do you want to continue" here.

@AltGr
Copy link
Member

AltGr commented Apr 3, 2018

Hmm, maybe it's the wording that is wrong then. The message should be understood as "don't prompt for (re)installation or removal of affected packages", not "don't prompt for (re)installation or removal of affected packages".

The important part is that it won't run the installation actions, not the fact that it will prompt (for other reasons). Was that the unclear part, and should we just clarify the wording, or do you think more is needed ?

@rjbou
Copy link
Collaborator

rjbou commented Jun 13, 2019

ping @kit-ty-kate

@dra27
Copy link
Member

dra27 commented Jul 27, 2021

Would this be better, getting rid of the word "prompt" completely?

Only record the new pinning status; affected packages will
not be (re)installed or removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants