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.2.2~alpha2 env error on Windows 10 / 11 #5684

Closed
tmcgilchrist opened this issue Sep 21, 2023 · 3 comments · Fixed by #5715
Closed

opam.2.2~alpha2 env error on Windows 10 / 11 #5684

tmcgilchrist opened this issue Sep 21, 2023 · 3 comments · Fixed by #5715

Comments

@tmcgilchrist
Copy link

Running opam env eval on Windows includes extra chars. It seems to be choosing the wrong encoding for the active shell. I am running this in a cygwin64 terminal on either Windows 10 or 11.

tmcgilchrist@vdi7 ~/code/ocaml/ocaml-grpc
$  eval $(opam env --switch=5.0)
-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: $'\r': command not found

tmcgilchrist@vdi7 ~/code/ocaml/ocaml-grpc
$ opam --version
2.2.0~alpha2

tmcgilchrist@vdi7 ~/code/ocaml/ocaml-grpc
$ opam config report
# opam config report
# opam-version         2.2.0~alpha2
# self-upgrade         no
# system               arch=x86_64 os=win32 os-distribution=cygwin os-version=10.0.22621
# solver               builtin-mccs+glpk
# install-criteria     -removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed
# upgrade-criteria     -removed,-count[avoid-version,changed],-count[version-lag,solution],-count[missing-depexts,changed],-new
# jobs                 3
# repositories         3 (version-controlled)
# pinned               0
# current-switch       5.0
# invariant            ocaml = 5.0.0 & ocaml-option-mingw
# compiler-packages    flexdll.0.42, ocaml-option-mingw.1, ocaml-variants.5.0.0+pr11846
# ocaml:native         true
# ocaml:native-tools   true
# ocaml:native-dynlink true
# ocaml:stubsdir       C:/Users/tmcgilchrist/AppData/Local/opam/5.0/lib/ocaml/stublibs;C:/Users/tmcgilchrist/AppData/Local/opam/5.0/lib/ocaml
# ocaml:preinstalled   false
# ocaml:compiler       5.0.0+pr11846

Manually removing the \r like so eval $(opam env --switch=5.0 | tr -d '\r') fixes the issue.

@rjbou
Copy link
Collaborator

rjbou commented Sep 21, 2023

What shell are you using ? Cygwin one ?

@tmcgilchrist
Copy link
Author

I’m using Cygwin64 shell with Bash.

@maroneze
Copy link
Contributor

FWIW, I'm now temporarily avoiding this issue by running set -o igncr on Cygwin before running other commands. It helps when testing some issues, even if it's not necessarily a good long-term solution.

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

Successfully merging a pull request may close this issue.

3 participants