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

"resolution of the request timed out" even with OPAMSOLVERTIMEOUT=1200 #5504

Open
MdeLv opened this issue Apr 5, 2023 · 5 comments · Fixed by #5510
Open

"resolution of the request timed out" even with OPAMSOLVERTIMEOUT=1200 #5504

MdeLv opened this issue Apr 5, 2023 · 5 comments · Fixed by #5510

Comments

@MdeLv
Copy link

MdeLv commented Apr 5, 2023

I have an old ocsigen.2.19.3 configuration that I don't want&need to upgrade.

After the problem described at #5485, it was destroyed but with some tweak, I could save it with a opam switch export and built it with opam switch import.

I've the following error message with the package ocsigen-ppx-rpc requires by ocsigen-start:

$ opam install ocsigen-ppx-rpc
[ERROR] Sorry, resolution of the request timed out.                                                       
        Try to specify a more precise request, use a different solver, or increase the allowed time by    
        setting OPAMSOLVERTIMEOUT to a bigger value (currently, it is set to 60.0 seconds).               
'opam install ocsigen-ppx-rpc --verbose' failed.                                                          

Using OPAMSOLVERTIMEOUT=1200 or OPAMSOLVERTIMEOUT=1200.0 gives nothing more.

Using flag --verbose gives NO MORE details.

For unknown reason, the existing and working ocsigen-start.2.19.3 webapp was expecting ocsigen-ppx-rpc.1.0 for compilation while this package is not a dependency (it is an ocsigen-start dependecy from 4.6.0). See https://opam.ocaml.org/packages/ocsigen-ppx-rpc/ .

I suspect that it may have been caused by opam tool and opam repository that are not enough strict/demanding regarding declared opam files. ITO, one can declare a wrong opam file.
See [TODO : find previous discussion about that.]

btw, what is the recommended command/way to produce the real dependencies of a package?
ocamldep gives only references to external compilation units.

Possibly related issues:
#3447
#4203
#3447
#685

@kit-ty-kate
Copy link
Member

This is a duplicate of #5353.

I've opened #5510. With this, setting OPAMSOLVERTOLERANCE=0.0003 or above will fix your issue at hand.

@MdeLv
Copy link
Author

MdeLv commented Apr 17, 2023

Thanks for this useful feedback.

Side question:
I'm mainly an opam-CLI user. As opam is mainly programmed in OCaml, I assume I should be able to "easily" integrate opam services in some program written in Ocaml.
Apart from the API, is there a reference document to help deeply understand how to use it, be able to select a version that has been battlefield-tested on which I can also run various tests in my specific context?
Thanks.

@MdeLv
Copy link
Author

MdeLv commented Jul 29, 2023

Hi,

opam 2.1.4

Same trouble today : impossible to install packages (after installing ocamlformat ; that fails at some step)

Using OPAMSOLVERTOLERANCE=0.0003 didn't fix the situation.
Setting OPAMSOLVERTIMEOUT=600.0 either.
Upgrading to opam 2.1.5 didn't fix either.

To work around, I created a new packages configuration (so-called "switch").
It's possible to install simple packages (cairo2, merlin) but not possible to install packages with more complex dependencies.

finally, I tried to pin the package to a specific version but opam still refused to install it.

My service is broken with not understandable reason.
I urgently switched to another server.

Q1: how can I fix that?
Can an older of opam help?

Q2: How can you make opam's behaviour more predictable?

Thanks

@kit-ty-kate
Copy link
Member

kit-ty-kate commented Jul 31, 2023

opam 2.1.4
[...]
Using OPAMSOLVERTOLERANCE=0.0003 didn't fix the situation.

Did you compile the branch in #5510 ? If you're still using 2.1.4 it looks like you haven't tried this fix as linked above and thus setting OPAMSOLVERTOLERANCE would have no effect as it is a new environment variable.

@MdeLv
Copy link
Author

MdeLv commented Jul 31, 2023

I didn't, believing it was an included var I just had to use. See

I've opened #5510. With this, setting OPAMSOLVERTOLERANCE=0.0003 or above will fix your issue at hand.

Now, when I have some trouble with opam, i don't try to fix it anymore. It's nearly always a lost of time ending with crash or pain.
I start again with an export I took care to generate from a previous working configuration; or with a snapshot of the server.
Hoping I won't go again in unstable parts of the sw.

PS: for unknow reason, with opam 2.1.5 I could finally build the targeted packages that failed as described.

Q2: How can you make opam's behaviour more predictable? I mean we often don't exactly know what is going on.

@rjbou rjbou reopened this Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants