-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
brainstormscriptRelated to the script provided by the websiteRelated to the script provided by the website
Description
REPOST FROM: ocaml/dune#10963 by @edwintorok
Expected Behavior
$ dune --version
"Dune Developer Preview: build 2024-09-28T01:30:13+00:00, git revision
17071ec30d10390badcb6cb1f6a43984b1be54a6"
$ echo $PATH
/var/home/edwin/.dune/bin:/var/home/edwin/.opam/5.2.0+fp/bin:/var/home/edwin/.cargo/bin:/var/home/edwin/.local/bin:/var/home/edwin/.dune/bin:/var/home/edwin/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/var/home/edwin/.dotnet/tools
Actual Behavior
$ dune --version
3.16.0
$ zsh -l
$ echo $PATH
/var/home/edwin/.opam/5.2.0+fp/bin:/var/home/edwin/.cargo/bin:/var/home/edwin/.local/bin:/var/home/edwin/.nix-profile/bin:/var/home/edwin/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/var/home/edwin/.dotnet/tools
$ zsh
$ echo $PATH
/var/home/edwin/.opam/5.2.0+fp/bin:/var/home/edwin/.cargo/bin:/var/home/edwin/.local/bin:/var/home/edwin/.nix-profile/bin:/var/home/edwin/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/var/home/edwin/.dotnet/tools
Reproduction
You can find my full ZSH config here:
https://gitlab.com/edwintorok/dotfiles/-/tree/master/zsh?ref_type=heads
However for the purposes of this bug you can repro it with:
- PR with a reproducing test:
opam install duneecho 'return 0' >.zshrccurl https://dune.ci.dev/install | bash
1.zsh -ldune --versionecho $PATH
Specifications
- Version of
dune(output ofdune --version): 3.16.0 - Version of
ocaml(output ofocamlc --version): 5.2.0 - Operating system (distribution and version): Fedora 40
Additional information
Dune added this to my .zshrc, but that has no effect
# dune
export PATH="/var/home/edwin/.dune/bin:$PATH"
If I instead I add it to .zshenv it is better, but still in the wrong place (opam takes precedence):
/var/home/edwin/.opam/5.2.0+fp/bin:/var/home/edwin/.dune/bin:/var/home/edwin/.cargo/bin:/var/home/edwin/.local/bin:/var/home/edwin/.nix-profile/bin:/var/home/edwin/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/var/home/edwin/.dotnet/tools
The reason it doesn't work in .zshrc because mine ends like this:
# Setup highlighting {{{
# Must be last according to its docs
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
#SYNTAX=/usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
SYNTAX=~/dotfiles/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
[[ -s ${SYNTAX} ]] && . ${SYNTAX}
return 0
So I need to move the export PATH before the 'return 0', so this works:
export PATH="/var/home/edwin/.dune/bin:$PATH"
# Setup highlighting {{{
# Must be last according to its docs
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
#SYNTAX=/usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
SYNTAX=~/dotfiles/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
[[ -s ${SYNTAX} ]] && . ${SYNTAX}
return 0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
brainstormscriptRelated to the script provided by the websiteRelated to the script provided by the website