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 install fails with exitcode 5 instead of 20 when a package is unavailable #6017

Open
kit-ty-kate opened this issue Jun 12, 2024 · 1 comment

Comments

@kit-ty-kate
Copy link
Member

Similar to #4493
Using opam 2.2.0~beta3 and ocaml/opam-repository#26072:

$ opam install conf-libssl.1
Error:  conf-libssl = 1: unmet availability conditions: 'os != "win32" | os-distribution = "cygwinports"'
$ echo $?
5

According to the documentation, exit code 5 means:

5 Not found. You requested something (package, version, repository, etc.) that couldn't be found.

Instead, one would expect exit code 20:

20 There is no solution to the user request. This can be caused by asking to install two incompatible packages, for example.

@kit-ty-kate
Copy link
Member Author

The source of the issue is located in OpamSolution.check_availability

OpamStd.Sys.exit_because `Not_found)
which seems to mix both concept of "unavailability because the package does not (longer) exist" and "unavailability because the package is not available on this platform"

Based on how OpamSwitchState.unavailable_reason is used everywhere else with the correct exit_reason, i strongly believe this is a bug.

@kit-ty-kate kit-ty-kate changed the title opam install fails with exitcode 5 instead of 20 when a package is unavailable because of depexts opam install fails with exitcode 5 instead of 20 when a package is unavailable Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant