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 installing ocamlfind 1.9.5 under Cygwin + opam 2.3.0~beta1 + ocaml 5.2.0 #84

Open
maroneze opened this issue Oct 23, 2024 · 2 comments

Comments

@maroneze
Copy link

maroneze commented Oct 23, 2024

In a new Windows system, I just installed Cygwin (including essential packages such as make, patch, unzip, etc), downloaded a Windows opam binary (2.3.0~beta1), did opam init and then tried to install ocamlfind (opam install ocamlfind --verbose), but I got this error:

...
λ compiled  ocamlfind.1.9.5
+ C:\OCaml64\bin\make.exe "install" (CWD=C:\Users\lsl\AppData\Local\opam\default\.opam-switch\build\ocamlfind.1.9.5)
- if [ "1" -eq 1 ]; then \
-     for x in camlp4 dbm graphics labltk num ocamlbuild; do \
-       if [ -f "C:\Users\lsl\AppData\Local\opam\default\lib/$x/META" ]; then \
-         if ! grep -Fq '[distributed with Ocaml]' "/C:\Users\lsl\AppData\Local\opam\default\lib/$x/META"; then \
-           rm -f site-lib-src/$x/META; \
-         fi; \
-       fi; \
-     done; \
-     test -f "site-lib-src/num/META" || rm -f "site-lib-src/num-top/META"; \
-   fi
- grep: /C:\Users\lsl\AppData\Local\opam\default\lib/num/META: No such file or directory
- grep: /C:\Users\lsl\AppData\Local\opam\default\lib/ocamlbuild/META: No such file or directory
- echo 'SITELIB_META =' > Makefile.packages.in
- for x in `ls site-lib-src`; do test ! -f "site-lib-src/$x/META" || echo $x >> Makefile.packages.in; done
- tr '\n' ' ' < Makefile.packages.in > Makefile.packages
- rm Makefile.packages.in
- install -d "C:\Users\lsl\AppData\Local\opam\default\bin"
- ./install: line 1: The: command not found
- ./install: line 3: syntax error near unexpected token `)'
- ./install: line 3: `1) configure the "findlib" library'
- make: *** [Makefile:21: install] Error 2

Among the existing issues, I did see mentions of issues when installing 1.9.6, or when upgrading to 1.9.6. But 1.9.5 seems to install fine for most people.

In any case, here's the full message without --verbose:

#=== ERROR while installing ocamlfind.1.9.5 ===================================#
# context     2.3.0~beta1 | win32/x86_64 | ocaml.5.2.0 | https://opam.ocaml.org#4ffa00429af77d1b2162442c6765ef9aa602be97
# path        C:\Users\lsl\AppData\Local\opam\default\.opam-switch\build\ocamlfind.1.9.5
# command     C:\OCaml64\bin\make.exe install
# exit-code   2
# env-file    C:\Users\lsl\AppData\Local\opam\log\ocamlfind-10116-74428d.env
# output-file C:\Users\lsl\AppData\Local\opam\log\ocamlfind-10116-74428d.out
### output ###
# if [ "1" -eq 1 ]; then \
# [...]
# grep: /C:\Users\lsl\AppData\Local\opam\default\lib/num/META: No such file or directory
# grep: /C:\Users\lsl\AppData\Local\opam\default\lib/ocamlbuild/META: No such file or directory
# echo 'SITELIB_META =' > Makefile.packages.in
# for x in `ls site-lib-src`; do test ! -f "site-lib-src/$x/META" || echo $x >> Makefile.packages.in; done
# tr '\n' ' ' < Makefile.packages.in > Makefile.packages
# rm Makefile.packages.in
# install -d "C:\Users\lsl\AppData\Local\opam\default\bin"
# ./install: line 1: The: command not found
# ./install: line 3: syntax error near unexpected token `)'
# ./install: line 3: `1) configure the "findlib" library'
# make: *** [Makefile:21: install] Error 2

I did note that my initial command to install opam (bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh)") resulted in:

## Downloading opam 2.2.1 for cygwin_nt-10.0-19045 on x86_64...
There may not yet be a binary release for your architecture or OS, sorry.

So maybe my setup is simply not supported; in which case, please feel free to close this issue.

(by the way, when doing opam init, I chose "2. Use Cygwin installation found in C:\OCaml64", instead of the recommended approach, which may be relevant to the issue; and the choice of C:\OCaml64 is simply because our users got used to it, but I didn't use anything based on the old Windows installers)

@gerdstolpmann
Copy link
Contributor

I think you have . in your PATH. Because of this, commands like install ... will try to run the text file INSTALL.

@tahina-pro
Copy link

Same here. This might come from dra27/mingw-w64-shims#2 (via ocaml/opam#6053)

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