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

lock hold/release messages as part of another command should be printed on stderr #5990

Closed
Khady opened this issue Jun 6, 2024 · 4 comments · Fixed by #5999
Closed

lock hold/release messages as part of another command should be printed on stderr #5990

Khady opened this issue Jun 6, 2024 · 4 comments · Fixed by #5999
Milestone

Comments

@Khady
Copy link
Contributor

Khady commented Jun 6, 2024

information messages such as "Another process has locked" and "lock acquired" should be printed on stderr, not stdout, as they aren't really part of the output of a command.

An example where we caught the problem

opam switch set-invariant --packages=ahrefs-setup,ahrefs-dev-tools-deps,ocaml-base-compiler.$(opam show ocaml-base-compiler --field=installed-version),ahrefs-all-deps

Can end up being executed as

opam switch set-invariant --packages=ahrefs-setup,ahrefs-dev-tools-deps,ocaml-base-compiler.Another process has locked /home/user/monorepo/.opam/repo/state-11ABC690.cache, waiting (C-c to abort)... lock acquired. 4.14.0,ahrefs-all-deps

This is true for lock messages but probably also applied to other informational messages.

@kit-ty-kate
Copy link
Member

Will be fixed by #5999

@kit-ty-kate kit-ty-kate added this to the 2.2.0~beta3 milestone Jun 6, 2024
@kit-ty-kate
Copy link
Member

In the meantime, i believe that if you add --readonly to your opam show invocation it should now work fine without waiting for the lock.

@rr0gi
Copy link

rr0gi commented Jun 6, 2024

are there cases when opam show is not readonly?

@kit-ty-kate
Copy link
Member

Yes, for example, if the internal repository data cache (marshalled data) isn't up-to-date or has been removed, opam will try to save that file by default

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.

3 participants