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

usability suggestion: fail if opam cannot build a built-in solver, unless explicitly requested #5749

Closed
maroneze opened this issue Nov 29, 2023 · 3 comments

Comments

@maroneze
Copy link
Contributor

I feel there's a usability issue with the way opam is currently built: if opam cannot build its built-in solver mccs (e.g., if the user has no C++ compiler available), there is a message in the build process that says so ("opam will be compiled WITHOUT a built-in solver"), but otherwise, there is no indication that this happened.

This is especially problematic in the case of opam-bundle: its first script, bootstrap.sh, will run and terminate successfully (since opam was indeed installed), but the user will have no explicit message about the lack of a built-in solver. Then, the user will run ./configure.sh, which will fail due to lack of any available solvers, and the user will be puzzled.

Since option --without-mccs exists, I believe it should be clearly specified by the user to allow the build to continue, if mccs cannot be built. This serves to confirm the user's intent that "yes, I want you to build regardless". Otherwise, the build should fail with "cannot compile a built-in solver; please ensure that your system can build mccs, or try to build opam with option --without-mccs".

This is just a suggestion, feel free to close this issue if you have already considered this. It's mostly because every 6 months, when I try to re-use opam-bundle on a new Docker image, I end up forgetting to add g++ to the list of dependencies, and I end up thinking that opam-bundle is somehow broken...

@rjbou
Copy link
Collaborator

rjbou commented Nov 29, 2023

Which opam version are you using ?

@rjbou
Copy link
Collaborator

rjbou commented Nov 29, 2023

If it is <2.2, can you test with opam 2.2.0~alpha at least, it contains PR #5527, that may fix your issue.

@maroneze
Copy link
Contributor Author

Indeed it works perfectly! Sorry about the noise.

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

No branches or pull requests

2 participants