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

error : [OPAM INIT] - Platform: Windows 11 HOME - Version: 23h2 #6120

Closed
BatmiBoom opened this issue Jul 28, 2024 · 8 comments · Fixed by #6168 · May be fixed by #6142
Closed

error : [OPAM INIT] - Platform: Windows 11 HOME - Version: 23h2 #6120

BatmiBoom opened this issue Jul 28, 2024 · 8 comments · Fixed by #6168 · May be fixed by #6142
Assignees
Milestone

Comments

@BatmiBoom
Copy link

Steps:

  • Install cygwin
  • Install packages

Packages

  • Download opam from releases
  • Add to env
  • Run
opam init

Error

Can't execute opam config report becauses its not initialized
@dra27 dra27 self-assigned this Jul 29, 2024
@dra27
Copy link
Member

dra27 commented Aug 5, 2024

I'm unable to reproduce this - cURL docs say exit code 43 is an internal error. Is it repeatable? If so, what happens if you run the command directly? (from the shell you have there, that'd be /cygdrive/c/Windows/system32/curl.exe --write-out '%{http_code}\n' --retry 3 --retry-delay 2 --user-agent opam/2.2.0 -L -o index.tar.gz.part -- https://opam.ocaml.org/index.tar.gz)

If it is a persistent problem, a workaround is almost certainly to install Cygwin's curl package, but it ought to be working with the Windows copy.

@BatmiBoom
Copy link
Author

BatmiBoom commented Aug 5, 2024

The first tip didn't work
The workaround worked: replacing the C:\Windows\System32\curl.exe with the Cygwin version
Thanks!

@dra27 dra27 reopened this Aug 7, 2024
@dra27
Copy link
Member

dra27 commented Aug 7, 2024

Glad that's worked around it (although I hope that was by shadowing C:\Windows\System32\curl.exe, not actually replacing files in the Windows system32 directory!).

@dra27
Copy link
Member

dra27 commented Aug 7, 2024

I'm re-opening this as although I've not seen it do it at this point, I have seen Windows curl do this when downloading a series of packages and there are various reports in Discord seeing the same thing. In my particular instance some downloads succeeded while most of them ended up with this cURL error. As it happens, I was also using Windows 11 22H2 (rather than Windows 10, as I use both).

@dra27
Copy link
Member

dra27 commented Aug 7, 2024

I'm tempted to:

  • Add curl to the required programs for opam init for Windows (internal installation would naturally then get it and opam will recommend it for external Cygwin/MSYS2 installs via depext). That would be for 2.2.1+ potentially
  • Distribute opam with an internal download agent (something a la ocurl - the benefit of libcurl is that it can be compiled against Windows SSL). That's quite a chunk of maintenance work, though.

@kit-ty-kate
Copy link
Member

I've opened #6142 as an implementation of solution 1

@kit-ty-kate
Copy link
Member

For anyone reading this, if you encounter the same error during opam init, the fix is to instead call:

opam init --cygwin-internal-install --cygwin-extra-packages=curl

@rikusilvola
Copy link

rikusilvola commented Aug 20, 2024

Looks like curl/curl#13845 which has been fixed in curl 8.9.0.

I see this has already been mentioned in the implementation of solution 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants