Open F-Loyer opened 10 months ago
Could you show us whatβs the output of opam option
and opam repo -a
?
$opam option
<><> Global configuration <><><><><><><><><><><><><><><><><><><><><><><><><> π«
archive-mirrors {}
best-effort-prefix-criteria {}
depext true
depext-bypass {}
depext-cannot-install false
depext-run-installs true
download-command {}
download-jobs 3
git-location {}
jobs {}
post-build-commands {}
post-install-commands {}
post-remove-commands {}
post-session-commands {}
pre-build-commands {}
pre-install-commands {}
pre-remove-commands {}
pre-session-commands {}
repository-validation-command {}
solver {}
solver-criteria {}
solver-fixup-criteria {}
solver-upgrade-criteria {}
swh-fallback true
sys-pkg-manager-cmd ["cygwin" "C:\\Cygwin\\bin\\cygcheck.exe"]
wrap-build-commands ["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"}
wrap-install-commands ["%{hooks}%/sandbox.sh" "install"] {os = "linux" | os = "macos"}
wrap-remove-commands ["%{hooks}%/sandbox.sh" "remove"] {os = "linux" | os = "macos"}
<><> Switch configuration <><><><><><><><><><><><><><><><><><><><><><><><><> π«
No switch installed
and
$opam repo -a
# Repository # Url # Switches(rank)
Ah, according to opam repo -a
, https://github.com/ocaml-opam/opam-repository-mingw
failed to be fetched. Have you seen an error message during the opam init
step?
To try to reproduce it or fix it, could you try opam repo add default git+https://github.com/ocaml-opam/opam-repository-mingw
? (or if it fails because itβs saying that default
already exist, try to replace add
with set-url
)
With the opam repo set-url ...
I have:
[ERROR] Opam has not been initialised, please run `opam init'
I try the opam init ...
and find:
<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><> π«
[ERROR] Could not update repository "default": OpamDownload.Download_fail(_, "curl: code 404 while downloading
https://github.com/ocaml-opam/opam-repository-mingw/index.tar.gz")
[ERROR] Initial download of repository failed.
I have submitted a ticket https://github.com/ocaml-opam/opam-repository-mingw/issues/15 on the repository project.
you used opam init https://github.com/ocaml-opam/opam-repository-mingw
instead of opam init git+https://github.com/ocaml-opam/opam-repository-mingw
could you try again with that one?
My bad, with git+
, it works... nearly (fails to compile 4.14.1+msvc64c
) !
...
# checking how to print strings... printf
# checking for x86_64-pc-windows-gcc... cl# checking whether the C compiler works... no
# configure: error: in `/cygdrive/c/Users/frede/AppData/Local/opam/default/.opam-switch/build/ocaml-variants.4.14.1+msvc64c':
# configure: error: C compiler cannot create executables
# See `config.log' for more details
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><> π«
ββ The following actions failed
β Ξ» build ocaml-variants 4.14.1+msvc64c
ββ
ββ The following changes have been performed (the rest was aborted)
β β install base-bigarray base
β β install base-threads base
β β install base-unix base
ββ
Note, I have both mingw and MSVC compilers installed.
However, opam switch create default 4.14.1+mingw64c
has created my switch.
awesome!
Iβm still confused at how you ended up without any repositories despite giving the proper url in the first place (the original two first comments of this issue). Do you remember anything at all from the first time you called opam init git+https://github.com/ocaml-opam/opam-repository-mingw
? Do you have the logs somewhere by any chance?
Running opam init https://github.com/ocaml-opam/opam-repository-mingw
(the wrong url) fails immediately and does not create the opam root, so itβs not that.
Also how did you end up from having an opam root to not having one in https://github.com/ocaml/opam/issues/5798#issuecomment-1906350254 ? Did you remove your opam root by hand?
@kit-ty-kate I have tried with the git+
prefix as proposed, and it has initialized an opam dir properly.
The issue with the msvc64c variant come from a PATH issue. (cl.exe
) couldnβt be found.
@kit-ty-kate I have tried with the
git+
prefix as proposed, and it has initialized an opam dir properly.
Yes, but I was asking about the first time around (the reason why you opened this issue), do you remember anything from then? An empty opam repo -a
means there is no repositories in the current opam setup, despite opam init
seemingly succeeding to create an opam root, which should be incompatible. Maybe you did hit Ctrl-C somewhere in the middle of the opam init
?
Yes, it is possible that the first time I hit Ctrl-C since the actual compilation of ocaml in a switch takes a lot of time without printing anything. But I was sure to erase the opam directory.
Note: I have finally manage to build a msvc32c variant: from CMD : call "c:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat" -arch=x86, then launch a Cygwin subshell, then create the switch. (-arch=amd64 is needed for a 64 bits switch). Launching a MSVC tool chain from cygwin is not straightforward!
I guess the ticket can be closed. Thanks for the help.
I have just installed opam-full-2.2.0-beta1 on Windows (
make cold; make cold-install; opam init git+https://github.com/ocaml-opam/opam-repository-mingw
).But I can't create a switch:
opam update
doesn't help (it quickly returns, no apparent download).Also: