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

the opam lock command now exits with a non-zero exit code when dependencies are not yet installed in the current switch issue:#5520 reopened pr#6341 #6377

Conversation

progressive-galib
Copy link

this might fix #5520

i mistakenly deleted the branch that was on #6341 thus i am re opening this pull request.

sorry for my silly mistake

@progressive-galib
Copy link
Author

@kit-ty-kate i am galib from #6341 (comment)

@kit-ty-kate
Copy link
Member

Hi, sorry but have you tested this code to make sure what you think it does? Reading it i can see this change doesn't do anything and i think it would be a better use of both of our time if things that you would like to work on were tested locally prior to sending it to us for review.

If you wish to learn OCaml from contributing to opam i think this is great, but i think most of the learning comes from reading the current code and testing what it does on your own, and only asking when you're stuck or the documentation is insufficient. If you jump to the last step without doing the former, there can only be so much actual learning from that.
For example from your question in #6341 (comment) if you read the code or tested it, you would see that OpamConsole.error does not raise any exception, it only displays a message on screen.

@progressive-galib
Copy link
Author

ohh sorry this was due to me mistakenly deleting the branch and not taking my account my changes to opamLockCommand.ml i did in other branches.sorry for this.

i will fix it before Friday.

also please what type of exception should I raise ? i saw that opam has its own opamstd or something. does any specific internally defined exception should be raised or should a generic one do ?

@progressive-galib
Copy link
Author

progressive-galib commented Feb 14, 2025

@kit-ty-kate @rjbou done, and before friday as promised,

currently due to exception the code never reaches the acc) before exeption is raised so should we replace

image

with this below ?

image

also this old code bellow from back when it was opened as #6341 had better benchmark by 0.008... something percentage, negligible but the old code was faster.
the old impl as per #6341:
image

@progressive-galib
Copy link
Author

done ignore what i said earlier benchmark is really negligible and also removed unreachable code @kit-ty-kate please merge

@kit-ty-kate
Copy link
Member

The expected behaviour does not match what was said in #6341 (comment) and is instead equivalent to your previous PR.

Please do test your changes locally. I would also suggest to have a better understanding of OCaml before sending patches to large projects such as opam, it would probably be better use of both of our time if you had your own pet project to sink your teeth into first and come back in a few months when basic concepts such as exceptions and return values are well understood. I'll close this PR in the meantime

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.

opam lock does not exit with an error code after displaying an error
2 participants