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

Opam for windows: failed to install version 5.0.0 #5863

Closed
bjeannet2 opened this issue Feb 29, 2024 · 6 comments
Closed

Opam for windows: failed to install version 5.0.0 #5863

bjeannet2 opened this issue Feb 29, 2024 · 6 comments

Comments

@bjeannet2
Copy link

bjeannet2 commented Feb 29, 2024

I failed to reproduce the installation of ocaml-5.0.0 with opam 2.2.0 beta1, using the provided binary for windows, due to an ocaml exception during compilation.
Is this expected or not ? Below the details of my attempt:

I settled repositories as follows:

<><> Repository configuration for switch default ><><><><><><><><><><><><><>  🐫

 1 dra27   git+https://github.com/dra27/opam-repository#windows-5.0
 2 default git+https://github.com/fdopen/opam-repository-mingw.git#opam2

and default switch:

#  switch   compiler             description
→  default  ocaml-system.4.12.0  ocaml >= 4.05.0
   essai                         oocaml-option-mingw

I typed the command:

$ ./opam switch create essai --packages=ocaml.5.0.0,ocaml-option-mingw

<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><>  🐫

Switch invariant: ["ocaml" {= "5.0.0"} "ocaml-option-mingw"]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫

∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
∗ installed ocaml-option-mingw.1
⬇ retrieved flexdll.0.43  (cached)
∗ installed flexdll.0.43
⬇ retrieved ocaml-variants.5.0.0+pr11846  (https://github.com/dra27/ocaml/archiv
e/win64-abi-5.0.tar.gz)
∗ installed ocaml-variants.5.0.0+pr11846
∗ installed ocaml-config.3
[ERROR] The compilation of ocaml.5.0.0 failed at "ocaml
        C:\\Users\\bjt2\\AppData\\Local\\opam\\5.0\\share\\ocaml-config/gen_ocam
l_config.ml
        5.0.0 ocaml".

#=== ERROR while compiling ocaml.5.0.0 ========================================#
# context     2.2.0~beta1 | win32/x86_64 | ocaml-option-mingw.1 | git+https://gi
thub.com/dra27/opam-repository#windows-5.0
# path        ~\AppData\Local\opam\5.0\.opam-switch\build\ocaml.5.0.0
# command     ~\AppData\Local\opam\5.0\bin\ocaml.exe C:\Users\bjt2\AppData\Local
\opam\5.0\share\ocaml-config/gen_ocaml_config.ml 5.0.0 ocaml
# exit-code   2
# env-file    ~\AppData\Local\opam\log\ocaml-21776-1362bf.env
# output-file ~\AppData\Local\opam\log\ocaml-21776-1362bf.out
### output ###
# [...]
# Called from Persistent_env.read_pers_struct in file "typing/persistent_env.ml"
, line 197, characters 12-29
# Called from Persistent_env.read in file "typing/persistent_env.ml", line 255,
characters 6-53
# Called from Env.read_signature in file "typing/env.ml", line 2513, characters
12-42
# Called from Topcommon.load_topdirs_signature in file "toplevel/topcommon.ml",
line 292, characters 11-53
# Called from Toploop.run_script in file "toplevel/toploop.ml", line 117, charac
ters 2-37
# Called from Topmain.input_argument in file "toplevel/byte/topmain.ml", line 18
1, characters 24-59
# Called from Stdlib__Arg.parse_and_expand_argv_dynamic_aux in file "arg.ml", li
ne 279, characters 11-20
# Called from Compenv.parse_arguments in file "driver/compenv.ml", line 747, cha
racters 6-78
# Re-raised at Compenv.process_deferred_actions.(fun) in file "driver/compenv.ml
", line 725, characters 34-131
# Called from Topmain.main in file "toplevel/byte/topmain.ml", line 214, charact
ers 2-61
# Called from Topmain.main in file "toplevel/byte/topmain.ml", line 223, charact
ers 8-15
# Called from Topstart in file "toplevel/topstart.ml", line 16, characters 13-29



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫

┌─ The following actions failed
│ λ build ocaml 5.0.0
└─
┌─ The following changes have been performed (the rest was aborted)
│ ∗ install base-bigarray      base
│ ∗ install base-threads       base
│ ∗ install base-unix          base
│ ∗ install flexdll            0.43
│ ∗ install ocaml-config       3
│ ∗ install ocaml-option-mingw 1
│ ∗ install ocaml-variants     5.0.0+pr11846
└─
@dra27
Copy link
Member

dra27 commented Mar 1, 2024

No, that's not expected! If you still have the script, please could you run opam upgrade -v so I can see the whole stack trace? If not, simply adding -v to the opam switch create should do the same thing.

@bjeannet2
Copy link
Author

bjeannet2 commented Mar 4, 2024

I am sorry to have bothered you: I tried again this morning, and it now works....
I am not sure what changes I did, although I made several attempts before creating the issue...
Anyway, I succeeded to install ocaml-5.0.0, (+ ctypes, zarith) (and also ocaml-5.1.0).
Congratulation for all the work done by you and your colleagues !

I still block on ocaml-5.0.0 with the installation of "conf-pkg-config".

$ ./opam install conf-pkg-config -v
The following actions will be performed:
=== install 1 package
  ∗ conf-pkg-config 2

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫


#=== ERROR while compiling conf-pkg-config.2 ==================================#
"pkg-config": command not found.


<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫

┌─ The following actions failed
│ λ build conf-pkg-config 2
└─
╶─ No changes have been performed
'E:\ws\cygwin64\tmp\opam.exe install conf-pkg-config -v' failed.

Although pkg-config| is in the path:

$ which pkg-config
/usr/bin/pkg-config
$ pkg-config
Please specify at least one package name on the command line.

I saw that a problem with pkg-config on windows was solved three years ago (issue #18174).
In attachement the more detailed log obtained with ./opam install conf-pkg-config -v --debug-level=1
opam.log

@fenginsc
Copy link

fenginsc commented Mar 5, 2024

I can't install it either, it says it can't find gcc, how does cygwin install gcc?

@bjeannet2
Copy link
Author

bjeannet2 commented Mar 5, 2024

You need anyway to install x86_64-w64-mingw32-gcc using the cygwin installer

@fenginsc
Copy link

fenginsc commented Mar 6, 2024

Thanks, following your tips I've successfully installed it.

@bjeannet2
Copy link
Author

main problem solved

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

3 participants