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 env toxic for fish shell #5458

Closed
mro opened this issue Mar 1, 2023 · 3 comments · Fixed by #4084
Closed

opam env toxic for fish shell #5458

mro opened this issue Mar 1, 2023 · 3 comments · Fixed by #4084

Comments

@mro
Copy link

mro commented Mar 1, 2023

over at ocaml/dune#6907 it turned out that the dune crash is triggered by a fishy $PATH from opam env. A typical output looks like

$ opam env
set -gx OPAM_SWITCH_PREFIX '/Users/mro/.opam/4.12.1';
set -gx CAML_LD_LIBRARY_PATH '/Users/mro/.opam/4.12.1/lib/stublibs:/Users/mro/.opam/4.12.1/lib/ocaml/stublibs:/Users/mro/.opam/4.12.1/lib/ocaml';
set -gx OCAML_TOPLEVEL_PATH '/Users/mro/.opam/4.12.1/lib/toplevel';
set -gx PKG_CONFIG_PATH '/Users/mro/.opam/4.12.1/lib/pkgconfig';
set -gx PATH ':/Users/mro/.opam/4.12.1/bin' '/opt/homebrew/bin' '/bin' '/sbin' '/usr/bin' '/usr/sbin' '/usr/local/bin' '/usr/local/MacGPG2/bin' '/Users/mro/bin';

The leading colon : is an issue as well as occasionally keeping . in the $PATH.

Shell is fish, version 3.6.0, seen on a macbook Air M1.

A workaround is to use

$ eval (opam env | sed -e "s/':/'/g;s/'\.'//g")
# opam config report
# opam-version      2.0.7 (4c1704d6a1a879625a132fbe4f1bb207965700b0)
# self-upgrade      no
# system            arch=arm64 os=macos os-distribution=homebrew os-version=11.7.4
# solver            builtin-mccs+glpk
# install-criteria  -removed,-count[version-lag,request],-count[version-lag,changed],-changed
# upgrade-criteria  -removed,-count[version-lag,solution],-new
# jobs              7
# repositories      1 (http) (default repo at 2370128e)
# pinned            0
# current-switch    4.12.1
@rjbou rjbou linked a pull request Mar 1, 2023 that will close this issue
@rjbou
Copy link
Collaborator

rjbou commented Mar 1, 2023

This was fixed in 2.0.8 & 2.1.

@rjbou rjbou closed this as completed Mar 1, 2023
@mro
Copy link
Author

mro commented Mar 1, 2023

thanks @rjbou
my opam is ages old!

I am surprised that opam hasn't self-upgraded since. Shouldn't it? How can I find out why?

@mro
Copy link
Author

mro commented Mar 1, 2023

(doing a manual https://opam.ocaml.org/doc/Install.html)

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

Successfully merging a pull request may close this issue.

2 participants