Open Chimrod opened 10 months ago
Note that opam does not officially support running with a MSYS2 environment at the moment, we only officially support Cygwin. We currently do not have the knowledge or time necessary to support and test both. Hopefully in the future but not now. That said, with sufficiant knowledge of MSYS2 it should work in theory, if i remember correctly.
A quick look at a search engine with the error you got, gives me https://github.com/msys2/MSYS2-packages/issues/1794, which looks like it states that mixing mingw libraries and msys2 system libraries can lead to this kind of error.
Your PATH contains both the mingw path and the msys2 system (as well as a cygwin path?). Maybe it would work if you removed D:\msys64\mingw64\bin;
from your PATH.
cc @jonahbeckford in case you’re interested.
Yes, the latest versions of opam install Cygwin during its opam initialization; that uses a DLL cygwin1.dll
that cannot be active at the same time as MSYS2 (msys-2.0.dll
). Even though there was no official support for MSYS2, MSYS2 did work quite well. You may be better off using an older version of opam (ie. commits around 2022/12/21).
And if you are just looking for prebuilt native Windows binaries (compatible with MSYS2), grab v2.2.0-alpha-20221228 from https://github.com/diskuv/dkml-component-opam/releases.
Even though there was no official support for MSYS2, MSYS2 did work quite well. You may be better off using an older version of opam (ie. commits around 2022/12/21).
Do you know what broke it? Is it the thing you explained in https://github.com/ocaml/opam/issues/5683 or is there something else?
Hello, thanks all for your answer. I completely understand that the situation here is very specific, but I didn’t know if it was out of the scope or not. As I know you are still stabilizing the windows version, I’ve estimated this issue could be reported here.
Yes, it is the thing in #5683 (which is being worked on).
@Chimrod how did you use opam init
? Could you try https://github.com/ocaml/opam/issues/5683#issuecomment-1794831405
(Oh, I’ve answer in the wrong ticket. Sorry for the noise.)
When I specify the path to msys (in my case D:\msys64
), opam look for a subdirectory \home\msys64 which do not exists:
$ opam init --cygwin-location=D:\msys64
[WARNING] Flag --cygwin-location is experimental, there is no guarantee that it will be kept; avoid using it in
scripts.
No configuration file found, using built-in defaults.
<><> Unix support infrastructure ><><><><><><><><><><><><><><><><><><><><><> 🐫
[ERROR] Error while checking Cygwin install (C:\cygwin64): D:\msys64\home\msys64 not found!
I’ve tried differents way to spectify the path, but I do not understand the hierarchy required
Which term are you using ? i'm testing it with cmd (make cold on cygwin), and there is no path rewriting. It is not working because it detects that it is not an cygwin install, but looks for in the given path.
The good path to give is the one that contains bin
directory.
I’ve upgraded opam to the latest version git version. The compilation process now works fine, but I have an error when creating a new fresh environnent.
I’ve extracted the log and the environment files generated by opam:
ocaml-base-compiler-25444-20665a.env.txt ocaml-base-compiler-25444-20665a.out.txt