topgrade-rs / topgrade

Upgrade all the things
GNU General Public License v3.0
2.08k stars 141 forks source link

Oh-my-zsh step is ran instead of Zplug #514

Closed NovaViper closed 1 year ago

NovaViper commented 1 year ago

Erroneous Behavior

Ohmyzsh step is being ran instead of zplug step, as mentioned in here.

Expected Behavior

Zplug step should be running instead of ohmyzsh

Steps to reproduce

Install and setup Zsh with zplug with the following plugin configurations on NixOS:

        {
          name = "romkatv/powerlevel10k";
          tags = [ "as:theme" "depth:1" ];
        }
        #Docs https://github.com/jeffreytse/zsh-vi-mode#-usage
        {
          name = "jeffreytse/zsh-vi-mode";
        }
        #{ name = "mattmc3/zfunctions"; tags = [ from:gh-r ]; }
        { name = "Aloxaf/fzf-tab"; }
        { name = "MichaelAquilina/zsh-auto-notify"; }
        {
          name = "plugins/sudo";
          tags = [ "from:oh-my-zsh" ];
        }
        { name = "chisui/zsh-nix-shell"; }
      ];

Possible Cause (Optional)

This could be possibly caused by me using the sudo plugin from the ohmyzsh framework, since that's the only plugin that's coming directly from there, as when I run echo $ZSH it does report back with /home/novaviper/.config/zsh/zplug/repos/robbyrussell/oh-my-zsh

Problem persists without calling from topgrade

Configuration file (Optional)

[commands]
"Run garbage collection on Nix store" = "nix-collect-garbage"

[linux]
nix_arguments = "--flake ./Desktop/nix-config"

[misc]
cleanup = true
pre_sudo = true
skip_notify = false

[post_commands]
"Make Doom Emacs org-bable work again" = "sed -i -e \"/'org-babel-tangle-collect-blocks/,+1d\" ~/.config/emacs/bin/org-tangle"

[pre_commands]
"Discard org-bable changes for upgrade" = "git -C ~/.config/emacs reset --hard"

Additional Details

Verbose Output (topgrade -v)

DEBUG Loaded configuration: ConfigFile { include: None, misc: Some(Misc { pre_sudo: Some(true), git_repos: None, predefined_git_repos: None, disable: None, ignore_failures: None, remote_topgrades: None, remote_topgrade_path: None, ssh_arguments: None, git_arguments: None, tmux_arguments: None, set_title: None, display_time: None, assume_yes: None, yay_arguments: None, aura_aur_arguments: None, aura_pacman_arguments: None, no_retry: None, run_in_tmux: None, cleanup: Some(true), notify_each_step: None, accept_all_windows_updates: None, skip_notify: Some(false), bashit_branch: None, only: None, no_self_update: None }), sudo_command: None, pre_commands: Some({"Discard org-bable changes for upgrade": "git -C ~/.config/emacs reset --hard"}), post_commands: Some({"Make Doom Emacs org-bable work again": "sed -i -e \"/'org-babel-tangle-collect-blocks/,+1d\" ~/.config/emacs/bin/org-tangle"}), commands: Some({"Run garbage collection on Nix store": "nix-collect-garbage"}), python: None, composer: None, brew: None, linux: Some(Linux { yay_arguments: None, aura_aur_arguments: None, aura_pacman_arguments: None, arch_package_manager: None, show_arch_news: None, garuda_update_arguments: None, trizen_arguments: None, pikaur_arguments: None, pamac_arguments: None, dnf_arguments: None, nix_arguments: Some("--flake ./Desktop/nix-config"), apt_arguments: None, enable_tlmgr: None, redhat_distro_sync: None, suse_dup: None, rpm_ostree: None, emerge_sync_flags: None, emerge_update_flags: None }), git: None, windows: None, npm: None, yarn: None, vim: None, firmware: None, vagrant: None, flatpak: None, distrobox: None }
DEBUG Version: 12.0.0
DEBUG OS: x86_64-unknown-linux-gnu
DEBUG Args { inner: ["topgrade", "--config=/home/novaviper/.config/topgrade2.toml", "--disable=home_manager", "--disable=emacs", "--dry-run", "-v"] }
DEBUG Binary path: Ok("/nix/store/gv6h16d1wss33rqk53zjp6gxgl4qvfg7-topgrade-12.0.0/bin/topgrade")
DEBUG Self Update: false
DEBUG Detected "/home/novaviper/.nix-profile/bin/git" as "git"
DEBUG Cannot find "pwsh"
DEBUG Cannot find "powershell"
DEBUG Path "/home/novaviper/.config/emacs" exists
DEBUG Path "/home/novaviper/.emacs.d" doesn't exist
DEBUG Path "/home/novaviper/.config/emacs/bin/doom" exists
DEBUG Cannot find "doas"
DEBUG Cannot find "please"
DEBUG Detected "/run/wrappers/bin/sudo" as "sudo"

── 01:04:42 - Discard org-bable changes for upgrade ────────────────────────────
Dry running: /nix/store/jg5k4ksj3silfqyw0id9wd99rakcz0ws-zsh-5.9/bin/zsh -c 'git -C ~/.config/emacs reset --hard'

── 01:04:42 - Sudo ─────────────────────────────────────────────────────────────
Dry running: /run/wrappers/bin/sudo -v
DEBUG Step "packer.nu"
DEBUG Step "System update"

── 01:04:42 - System update ────────────────────────────────────────────────────
Dry running: /run/wrappers/bin/sudo /run/current-system/sw/bin/nixos-rebuild switch --upgrade --flake ./Desktop/nix-config
Dry running: /run/wrappers/bin/sudo /run/current-system/sw/bin/nix-collect-garbage -d
DEBUG Step "config-update"
DEBUG Step "Brew"
DEBUG Step "am"
DEBUG Step "appman"
DEBUG Step "deb-get"
DEBUG Step "toolbx"
DEBUG Step "Flatpak"
DEBUG Step "snap"
DEBUG Step "pacstall"
DEBUG Step "pacdef"
DEBUG Step "protonup"
DEBUG Step "distrobox"
DEBUG Step "dkp-pacman"
DEBUG Step "pihole"
DEBUG Step "Firmware upgrades"
DEBUG Step "Restarts"
DEBUG Step "yadm"
DEBUG Step "nix"
DEBUG Detected "/run/current-system/sw/bin/nix" as "nix"
DEBUG Detected "/run/current-system/sw/bin/nix-channel" as "nix-channel"
DEBUG Detected "/run/current-system/sw/bin/nix-env" as "nix-env"
DEBUG nix profile: "/home/novaviper/.nix-profile"
DEBUG Executing command `/run/current-system/sw/bin/nix-env --query nix`
DEBUG Command failed: Err(
   0: Command failed: `/run/current-system/sw/bin/nix-env --query nix`

      Stderr:
      error: selector 'nix' matches no derivations
   1: `/run/current-system/sw/bin/nix-env` failed: exit status: 1

Location:
   src/steps/os/unix.rs:366

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.)
DEBUG nix-env output: Err(
   0: Command failed: `/run/current-system/sw/bin/nix-env --query nix`

      Stderr:
      error: selector 'nix' matches no derivations
   1: `/run/current-system/sw/bin/nix-env` failed: exit status: 1

Location:
   src/steps/os/unix.rs:366

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.)

── 01:04:42 - Nix ──────────────────────────────────────────────────────────────
DEBUG Multi user nix: true
DEBUG Step "guix"
DEBUG Step "asdf"
DEBUG Step "pkgin"
DEBUG Step "bun"
DEBUG Step "zr"
DEBUG Detected "/home/novaviper/.nix-profile/bin/zsh" as "zsh"
DEBUG Step "antibody"
DEBUG Detected "/home/novaviper/.nix-profile/bin/zsh" as "zsh"
DEBUG Step "antidote"
DEBUG Detected "/home/novaviper/.nix-profile/bin/zsh" as "zsh"
DEBUG Step "antigen"
DEBUG Detected "/home/novaviper/.nix-profile/bin/zsh" as "zsh"
DEBUG Step "zgenom"
DEBUG Detected "/home/novaviper/.nix-profile/bin/zsh" as "zsh"
DEBUG Step "zplug"
DEBUG Detected "/home/novaviper/.nix-profile/bin/zsh" as "zsh"
DEBUG Step "zinit"
DEBUG Detected "/home/novaviper/.nix-profile/bin/zsh" as "zsh"
DEBUG Step "zi"
DEBUG Detected "/home/novaviper/.nix-profile/bin/zsh" as "zsh"
DEBUG Step "zim"
DEBUG Detected "/home/novaviper/.nix-profile/bin/zsh" as "zsh"
DEBUG Executing command `zsh -c '[[ -n ${ZIM_HOME} ]] && print -n ${ZIM_HOME}'`
DEBUG Command failed: Err(
   0: Command failed: `zsh -c '[[ -n ${ZIM_HOME} ]] && print -n ${ZIM_HOME}'`
   1: `zsh` failed: exit status: 1

Location:
   src/steps/zsh.rs:151

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.)
DEBUG Step "oh-my-zsh"
DEBUG Detected "/home/novaviper/.nix-profile/bin/zsh" as "zsh"
DEBUG Path "/home/novaviper/.config/zsh/zplug/repos/robbyrussell/oh-my-zsh" exists

── 01:04:42 - oh-my-zsh ────────────────────────────────────────────────────────
DEBUG Executing command `zsh -c 'test $ZSH_CUSTOM && echo -n $ZSH_CUSTOM'`
DEBUG Command failed: Err(
   0: Command failed: `zsh -c 'test $ZSH_CUSTOM && echo -n $ZSH_CUSTOM'`
   1: `zsh` failed: exit status: 1

Location:
   src/steps/zsh.rs:181

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.)
DEBUG Running zsh returned Command failed: `zsh -c 'test $ZSH_CUSTOM && echo -n $ZSH_CUSTOM'`. Using default path: /home/novaviper/.config/zsh/zplug/repos/robbyrussell/oh-my-zsh/custom
DEBUG oh-my-zsh custom dir: /home/novaviper/.config/zsh/zplug/repos/robbyrussell/oh-my-zsh/custom
DEBUG Checking if /home/novaviper/.config/zsh/zplug/repos/robbyrussell/oh-my-zsh/custom is a git repository
DEBUG Executing command `/home/novaviper/.nix-profile/bin/git rev-parse --show-toplevel`
DEBUG Checking if /home/novaviper/.config/zsh/zplug/repos/robbyrussell/oh-my-zsh/custom/plugins is a git repository
DEBUG Executing command `/home/novaviper/.nix-profile/bin/git rev-parse --show-toplevel`
DEBUG Checking if /home/novaviper/.config/zsh/zplug/repos/robbyrussell/oh-my-zsh/custom/plugins/example is a git repository
DEBUG Executing command `/home/novaviper/.nix-profile/bin/git rev-parse --show-toplevel`
DEBUG /home/novaviper/.config/zsh/zplug/repos/robbyrussell/oh-my-zsh/custom/example.zsh is a file. Checking /home/novaviper/.config/zsh/zplug/repos/robbyrussell/oh-my-zsh/custom
DEBUG Checking if /home/novaviper/.config/zsh/zplug/repos/robbyrussell/oh-my-zsh/custom is a git repository
DEBUG Executing command `/home/novaviper/.nix-profile/bin/git rev-parse --show-toplevel`
DEBUG Checking if /home/novaviper/.config/zsh/zplug/repos/robbyrussell/oh-my-zsh/custom/themes is a git repository
DEBUG Executing command `/home/novaviper/.nix-profile/bin/git rev-parse --show-toplevel`
DEBUG /home/novaviper/.config/zsh/zplug/repos/robbyrussell/oh-my-zsh/custom/themes/example.zsh-theme is a file. Checking /home/novaviper/.config/zsh/zplug/repos/robbyrussell/oh-my-zsh/custom/themes
DEBUG Checking if /home/novaviper/.config/zsh/zplug/repos/robbyrussell/oh-my-zsh/custom/themes is a git repository
DEBUG Executing command `/home/novaviper/.nix-profile/bin/git rev-parse --show-toplevel`
Dry running: zsh /home/novaviper/.config/zsh/zplug/repos/robbyrussell/oh-my-zsh/tools/upgrade.sh
DEBUG Step "oh-my-bash"
DEBUG Detected "/nix/store/51sszqz1d9kpx480scb1vllc00kxlx79-bash-5.2-p15/bin/bash" as "bash"
DEBUG Step "fisher"
DEBUG Step "bash-it"
DEBUG Step "oh-my-fish"
DEBUG Step "fish-plug"
DEBUG Step "fundle"
DEBUG Step "tmux"
DEBUG Step "TLDR"
DEBUG Step "pearl"
DEBUG Step "Gnome Shell Extensions"
DEBUG Step "SDKMAN!"
DEBUG Detected "/nix/store/51sszqz1d9kpx480scb1vllc00kxlx79-bash-5.2-p15/bin/bash" as "bash"
DEBUG Step "rcm"
DEBUG Step "maza"
DEBUG Step "apm"
DEBUG Step "fossil"
DEBUG Step "rustup"
DEBUG Step "juliaup"
DEBUG Step ".NET"
DEBUG Step "choosenim"
DEBUG Step "cargo"
DEBUG Step "Flutter"
DEBUG Step "go-global-update"
DEBUG Step "gup"
DEBUG Step "opam"
DEBUG Step "vcpkg"
DEBUG Step "pipx"
DEBUG Step "conda"
DEBUG Step "mamba"
DEBUG Step "pip3"
DEBUG Detected "/nix/store/1r6n7v2wam7gkr18gxccpg7p5ywgw551-python3-3.10.12/bin/python" as "python"
DEBUG Executing command `/nix/store/1r6n7v2wam7gkr18gxccpg7p5ywgw551-python3-3.10.12/bin/python -V`
DEBUG Detected "/nix/store/1r6n7v2wam7gkr18gxccpg7p5ywgw551-python3-3.10.12/bin/python3" as "python3"
DEBUG Executing command `/nix/store/1r6n7v2wam7gkr18gxccpg7p5ywgw551-python3-3.10.12/bin/python3 -V`
DEBUG Executing command `/nix/store/1r6n7v2wam7gkr18gxccpg7p5ywgw551-python3-3.10.12/bin/python -m pip`
DEBUG Command failed: Err(
   0: Command failed: `/nix/store/1r6n7v2wam7gkr18gxccpg7p5ywgw551-python3-3.10.12/bin/python -m pip`

      Stderr:
      /nix/store/1r6n7v2wam7gkr18gxccpg7p5ywgw551-python3-3.10.12/bin/python: No module named pip
   1: `/nix/store/1r6n7v2wam7gkr18gxccpg7p5ywgw551-python3-3.10.12/bin/python` failed: exit status: 1

Location:
   src/steps/generic.rs:385

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.)
DEBUG Step "pip-review"
DEBUG Step "pip-review (local)"
DEBUG Step "pipupgrade"
DEBUG Step "ghcup"
DEBUG Step "stack"
DEBUG Step "tlmgr"
DEBUG Step "myrepos"
DEBUG Step "chezmoi"
DEBUG Step "jetpack"
DEBUG Step "vim"
DEBUG Step "Neovim"
DEBUG Detected "/home/novaviper/.nix-profile/bin/nvim" as "nvim"
DEBUG Path "/home/novaviper/.config/nvim/init.lua" exists

── 01:04:42 - Neovim ───────────────────────────────────────────────────────────
DEBUG Wrote vim script to "/run/user/1000/.tmpOMLzfq"
Dry running: /home/novaviper/.nix-profile/bin/nvim -u /home/novaviper/.config/nvim/init.lua --headless -V1 -nS /run/user/1000/.tmpOMLzfq
DEBUG Step "The Ultimate vimrc"
DEBUG Step "voom"
DEBUG Step "Kakoune"
DEBUG Step "helix"
DEBUG Step "npm"
DEBUG Detected "/home/novaviper/.nix-profile/bin/npm" as "npm"

── 01:04:42 - Node Package Manager ─────────────────────────────────────────────
DEBUG Executing command `/home/novaviper/.nix-profile/bin/npm --version`
DEBUG Executing command `/home/novaviper/.nix-profile/bin/npm root '--location=global'`
DEBUG Step "yarn"
DEBUG Step "pnpm"
DEBUG Step "Containers"
DEBUG Step "deno"
DEBUG Step "composer"
DEBUG Step "krew"
DEBUG Step "helm"
DEBUG Step "gem"
DEBUG Step "rubygems"
DEBUG Step "julia"
DEBUG Step "haxelib"
DEBUG Step "sheldon"
DEBUG Step "stew"
DEBUG Step "rtcl"
DEBUG Step "bin"
DEBUG Step "gcloud"
DEBUG Step "micro"
DEBUG Step "raco"
DEBUG Step "spicetify"
DEBUG Step "GitHub CLI Extensions"
DEBUG Step "Bob"
DEBUG /home/novaviper/.vim does not exists
DEBUG Checking if /home/novaviper/.config/nvim is a git repository
DEBUG Executing command `/home/novaviper/.nix-profile/bin/git rev-parse --show-toplevel`
DEBUG Command failed: Err(
   0: Command failed: `/home/novaviper/.nix-profile/bin/git rev-parse --show-toplevel`

      Stderr:
      fatal: not a git repository (or any of the parent directories): .git
   1: `/home/novaviper/.nix-profile/bin/git` failed: exit status: 128

Location:
   src/steps/git.rs:166

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.)
DEBUG /home/novaviper/.ideavimrc does not exists
DEBUG /home/novaviper/.intellimacs does not exists
DEBUG /home/novaviper/.dotfiles does not exists
DEBUG /home/novaviper/.zshrc does not exists
DEBUG /home/novaviper/.tmux does not exists
DEBUG /home/novaviper/.config/fish does not exists
DEBUG /home/novaviper/.config/openbox does not exists
DEBUG /home/novaviper/.config/bspwm does not exists
DEBUG /home/novaviper/.config/i3 does not exists
DEBUG /home/novaviper/.config/sway does not exists
DEBUG Step "Git repositories"
DEBUG Step "Run garbage collection on Nix store"

── 01:04:43 - Run garbage collection on Nix store ──────────────────────────────
Dry running: /nix/store/jg5k4ksj3silfqyw0id9wd99rakcz0ws-zsh-5.9/bin/zsh -c nix-collect-garbage
DEBUG Step "Vagrant boxes"

── 01:04:43 - Summary ──────────────────────────────────────────────────────────
packer.nu: SKIPPED: Cannot find "nu" in PATH
System update: OK
config-update: OK
Brew: SKIPPED: Cannot find "brew" in PATH
am: SKIPPED: Cannot find "am" in PATH
appman: SKIPPED: Cannot find "appman" in PATH
deb-get: SKIPPED: Cannot find "deb-get" in PATH
toolbx: SKIPPED: Cannot find "toolbox" in PATH
Flatpak: SKIPPED: Cannot find "flatpak" in PATH
snap: SKIPPED: Cannot find "snap" in PATH
pacstall: SKIPPED: Cannot find "pacstall" in PATH
pacdef: SKIPPED: Cannot find "pacdef" in PATH
protonup: SKIPPED: Cannot find "protonup" in PATH
distrobox: SKIPPED: Cannot find "distrobox" in PATH
dkp-pacman: SKIPPED: Cannot find "dkp-pacman" in PATH
pihole: SKIPPED: Cannot find "pihole" in PATH
Firmware upgrades: SKIPPED: Cannot find "fwupdmgr" in PATH
Restarts: SKIPPED: Cannot find "needrestart" in PATH
yadm: SKIPPED: Cannot find "yadm" in PATH
nix: SKIPPED: Nix on NixOS must be upgraded via nixos-rebuild switch
guix: SKIPPED: Cannot find "guix" in PATH
asdf: SKIPPED: Cannot find "asdf" in PATH
pkgin: SKIPPED: Cannot find "pkgin" in PATH
bun: SKIPPED: Cannot find "bun" in PATH
zr: SKIPPED: Cannot find "zr" in PATH
antibody: SKIPPED: Cannot find "antibody" in PATH
antidote: SKIPPED: Path "/home/novaviper/.antidote" doesn't exist
antigen: SKIPPED: Path "/home/novaviper/.zshrc" doesn't exist
zgenom: SKIPPED: Path "/home/novaviper/.zshrc" doesn't exist
zplug: SKIPPED: Path "/home/novaviper/.zshrc" doesn't exist
zinit: SKIPPED: Path "/home/novaviper/.zshrc" doesn't exist
zi: SKIPPED: Path "/home/novaviper/.zshrc" doesn't exist
zim: SKIPPED: Path "/home/novaviper/.zim" doesn't exist
oh-my-zsh: OK
oh-my-bash: SKIPPED: Path "/home/novaviper/.oh-my-bash" doesn't exist
fisher: SKIPPED: Cannot find "fish" in PATH
bash-it: SKIPPED: Path "/home/novaviper/.bash_it" doesn't exist
oh-my-fish: SKIPPED: Cannot find "fish" in PATH
fish-plug: SKIPPED: Cannot find "fish" in PATH
fundle: SKIPPED: Cannot find "fish" in PATH
tmux: SKIPPED: Path "/home/novaviper/.tmux/plugins/tpm/bin/update_plugins" doesn't exist
TLDR: SKIPPED: Cannot find "tldr" in PATH
pearl: SKIPPED: Cannot find "pearl" in PATH
Gnome Shell Extensions: SKIPPED: Cannot find "gdbus" in PATH
SDKMAN!: SKIPPED: Path "/home/novaviper/.sdkman/bin/sdkman-init.sh" doesn't exist
rcm: SKIPPED: Cannot find "rcup" in PATH
maza: SKIPPED: Cannot find "maza" in PATH
apm: SKIPPED: Cannot find "apm" in PATH
fossil: SKIPPED: Cannot find "fossil" in PATH
rustup: SKIPPED: Cannot find "rustup" in PATH
juliaup: SKIPPED: Cannot find "juliaup" in PATH
.NET: SKIPPED: Cannot find "dotnet" in PATH
choosenim: SKIPPED: Cannot find "choosenim" in PATH
cargo: SKIPPED: Path "/home/novaviper/.local/share/cargo" doesn't exist
Flutter: SKIPPED: Cannot find "flutter" in PATH
go-global-update: SKIPPED: Cannot find "go" in PATH
gup: SKIPPED: Cannot find "go" in PATH
opam: SKIPPED: Cannot find "opam" in PATH
vcpkg: SKIPPED: Cannot find "vcpkg" in PATH
pipx: SKIPPED: Cannot find "pipx" in PATH
conda: SKIPPED: Cannot find "conda" in PATH
mamba: SKIPPED: Cannot find "mamba" in PATH
pip3: SKIPPED: pip does not exists
pip-review: SKIPPED: Cannot find "pip-review" in PATH
pip-review (local): SKIPPED: Cannot find "pip-review" in PATH
pipupgrade: SKIPPED: Cannot find "pipupgrade" in PATH
ghcup: SKIPPED: Cannot find "ghcup" in PATH
stack: SKIPPED: Cannot find "stack" in PATH
tlmgr: SKIPPED: tlmgr must be explicity enabled in the configuration to run in Android/Linux
myrepos: SKIPPED: Cannot find "mr" in PATH
chezmoi: SKIPPED: Cannot find "chezmoi" in PATH
jetpack: SKIPPED: Cannot find "jetpack" in PATH
vim: SKIPPED: Cannot find "vim" in PATH
Neovim: OK
The Ultimate vimrc: SKIPPED: Path "/home/novaviper/.vim_runtime" doesn't exist
voom: SKIPPED: Cannot find "voom" in PATH
Kakoune: SKIPPED: Cannot find "kak" in PATH
helix: SKIPPED: Cannot find "helix" in PATH
npm: SKIPPED: NPM root is owned by another user which is not the current user. Set use_sudo = true under the NPM section in your configuration to run NPM as sudo
yarn: SKIPPED: Cannot find "yarn" in PATH
pnpm: SKIPPED: Cannot find "pnpm" in PATH
Containers: SKIPPED: Cannot find "docker" in PATH
deno: SKIPPED: Cannot find "deno" in PATH
composer: SKIPPED: Cannot find "composer" in PATH
krew: SKIPPED: Cannot find "kubectl-krew" in PATH
helm: SKIPPED: Cannot find "helm" in PATH
gem: SKIPPED: Cannot find "gem" in PATH
rubygems: SKIPPED: Path "/home/novaviper/.gem" doesn't exist
julia: SKIPPED: Cannot find "julia" in PATH
haxelib: SKIPPED: Cannot find "haxelib" in PATH
sheldon: SKIPPED: Cannot find "sheldon" in PATH
stew: SKIPPED: Cannot find "stew" in PATH
rtcl: SKIPPED: Cannot find "rupdate" in PATH
bin: SKIPPED: Cannot find "bin" in PATH
gcloud: SKIPPED: Cannot find "gcloud" in PATH
micro: SKIPPED: Cannot find "micro" in PATH
raco: SKIPPED: Cannot find "raco" in PATH
spicetify: SKIPPED: Cannot find "spicetify" in PATH
GitHub CLI Extensions: SKIPPED: Cannot find "gh" in PATH
Bob: SKIPPED: Cannot find "bob" in PATH
Git repositories: SKIPPED: No repositories to pull
Run garbage collection on Nix store: OK
Vagrant boxes: SKIPPED: Cannot find "vagrant" in PATH

── 01:04:43 - Make Doom Emacs org-bable work again ─────────────────────────────
Dry running: /nix/store/jg5k4ksj3silfqyw0id9wd99rakcz0ws-zsh-5.9/bin/zsh -c 'sed -i -e "/'\''org-babel-tangle-collect-blocks/,+1d" ~/.config/emacs/bin/org-tangle'
DEBUG Desktop notification: Topgrade finished successfully
 INFO perform: new
 INFO perform:write_command{command=Auth(Some(External), Some([49, 48, 48, 48]))}: new
 INFO perform:write_command{command=Auth(Some(External), Some([49, 48, 48, 48]))}: close
 INFO perform:read_command: new
 INFO perform:read_command: close
 INFO perform:write_command{command=NegotiateUnixFD}: new
 INFO perform:write_command{command=NegotiateUnixFD}: close
 INFO perform:read_command: new
 INFO perform:read_command: close
 INFO perform:write_command{command=Begin}: new
 INFO perform:write_command{command=Begin}: close
 INFO perform: close
 INFO socket reader: new
 INFO socket reader: close
SteveLauC commented 1 year ago

when I run echo $ZSH it does report back with /home/novaviper/.config/zsh/zplug/repos/robbyrussell/oh-my-zsh

Yes, this is the root cause, Topgrade detects whether you have oh-my-zsh installed by checking the existence of:

  1. environment variable ZSH
  2. ~/.oh-my-zsh

I currently don't have any good solution to this issue, and I am sorry to say that you cannot disable oh-my-zsh update at present, the only option that is available is to disable all the shell-related steps via:

[misc]
disable = ["shell"]
SteveLauC commented 1 year ago

515 feature request issue created

Un1q32 commented 1 year ago

Yes, this is the root cause, Topgrade detects whether you have oh-my-zsh installed by checking the existence of:

  1. environment variable ZSH
  2. ~/.oh-my-zsh

For me, topgrade runs oh-my-zsh even though ~/.oh-my-zsh is NOT present on my fedora system. The $ZSH environment variable is set by my .zshrc for unrelated reasons, but it is not exported, and unsetting it doesn't fix the issue.

Changing the variable name to $ZSHDATA fixed it

SteveLauC commented 1 year ago

but it is not exported

This is kinda weird, did you run topgrade over ssh?

Un1q32 commented 1 year ago

but it is not exported

This is kinda weird, did you run topgrade over ssh?

yes

SteveLauC commented 1 year ago

but it is not exported

This is kinda weird, did you run topgrade over ssh?

yes

Get it, I should enhance the impl then:)

NovaViper commented 1 year ago

@SteveLauC Hey so I've been looking at the source code for zplug and it appears that zplug actually does this to make oh-my-zsh plugins work.. perhaps maybe the oh-my-zsh step should also check to ensure that zplug isn't installed on the system? That way if zplug isn't there, the program would assume that oh-my-zsh is actually installed and if it is there, then it must be the case that oh-my-zsh was installed using zplug and thus, should actually trigger the zplug step.

I noticed zplug in particular seems to be the only plugin manager doing this, because I switched over to antidote and it doesn't trigger the same behavior as observed when using zplug

SteveLauC commented 1 year ago

it appears that zplug actually does this to make oh-my-zsh plugins work

Would you like to give me a link to this?

And, one thing I noted was that the zplug steps was not activated on your system cause you don't have a .zshrc file, from the source code of the zplug step:

https://github.com/topgrade-rs/topgrade/blob/9d3662c3ea520c630ac368927ae598207a3fc5f8/src/steps/zsh.rs#L97-L112

It checks:

  1. zsh is installed and can be found in the PATH
  2. .zshrc file exists
  3. Environment variable ZPLUG_HOME (fall back to ~/.zplug) points to an existing directory
NovaViper commented 1 year ago

it appears that zplug actually does this to make oh-my-zsh plugins work

Would you like to give me a link to this?

Here: https://github.com/zplug/zplug/blob/ac6c2a3e9eea6a488d96d98c752ef887e7d5aae3/base/core/load.zsh#L89-L95

And, one thing I noted was that the zplug steps was not activated on your system cause you don't have a .zshrc file, from the source code of the zplug step:

https://github.com/topgrade-rs/topgrade/blob/9d3662c3ea520c630ac368927ae598207a3fc5f8/src/steps/zsh.rs#L97-L112

It checks:

1. `zsh` is installed and can be found in the `PATH`

2. `.zshrc` file exists

3. Environment variable `ZPLUG_HOME` (fall back to `~/.zplug`) points to an existing directory

I do have a .zshrc folder, it's located in the ~/.config/zsh folder (using the XDG_CONFIG_HOME variable that's defined in the XDG standard), and the ZPLUG_HOME variable also points to ~/.config/zsh/zplug

SteveLauC commented 1 year ago

I do have a .zshrc folder, it's located in the ~/.config/zsh folder (using the XDG_CONFIG_HOME variable that's defined in the XDG standard), and the ZPLUG_HOME variable also points to ~/.config/zsh/zplug

I love this spec, but does zsh respect its environment variables? The last time I searched this, they told me that zsh does not support the XDG spec, and you have to hack it with the environment variable ZDOTDIR

NovaViper commented 1 year ago

Yeah it doesn't use them by default but I do have the environment configs for zsh pointing to the XDG paths

SteveLauC commented 1 year ago

Yeah it doesn't use them by default but I do have the environment configs for zsh pointing to the XDG paths

By hacking the src of zsh or the env var ZDOTDIR?

If it is the latter, then Topgrade should be able to detect your zshrc file

NovaViper commented 1 year ago

Yeah it doesn't use them by default but I do have the environment configs for zsh pointing to the XDG paths

By hacking the src of zsh or the env var ZDOTDIR?

If it is the latter, then Topgrade should be able to detect your zshrc file

Using the ZDOTDIR environment variable, using Home Manager like this

  programs.zsh = {
    enable = true;
    dotDir = ".config/zsh";
... More stuff but not important for the snippet

Which all it simply does it change the ZDOTDIR environment variable: Declared here and here

SteveLauC commented 1 year ago

Using the ZDOTDIR environment variable

This is weird, from the verbose output you pasted:

zplug: SKIPPED: Path "/home/novaviper/.zshrc" doesn't exist

Your .zshrc file was not found by Topgrade...

Does

$ echo $ZDOTDIR

give you the path you configured?

NovaViper commented 1 year ago

Yes it does! 🤔 odd that it didn't catch that.

SteveLauC commented 1 year ago

Yes it does! 🤔 odd that it didn't catch that.

Is it exported?

NovaViper commented 1 year ago

Yes it does! thinking odd that it didn't catch that.

Is it exported?

From what I can tell what Home Manager+NixOS does, it directly creates a zshenv file in the home folder, which points to the zshenv file within the XDG_CONFIG_HOME/zsh path, and that contains the new ZDOTDIR variable that sets it to point to the ~/.config/zsh path, and it starts up this way by default, so yes, it seems to be exported as far as I can tell

SteveLauC commented 1 year ago

so yes, it seems to be exported as far as I can tell

Then I have no idea why Topgrade didn't find it...

BTW, it is easy to test whether it has been exported or not:

$ export -p | grep ZDOTDIR
NovaViper commented 1 year ago

so yes, it seems to be exported as far as I can tell

Then I have no idea why Topgrade didn't find it...

BTW, it is easy to test whether it has been exported or not:

$ export -p | grep ZDOTDIR

The command doesn't return anything back. The odd thing is that zsh and all other programs can clearly see that ZDOTDIR is set and points to ~/.config/zsh, but topgrade doesn't 🤷🏾‍♀️

Here's where exactly Home Manager sets up the zshenv files: https://github.com/nix-community/home-manager/blob/master/modules/programs/zsh.nix#L481C1-L493

And mine results like this

# Environment variables
. "/home/novaviper/.nix-profile/etc/profile.d/hm-session-vars.sh"

# Only source this once
if [[ -z "$__HM_ZSH_SESS_VARS_SOURCED" ]]; then
  export __HM_ZSH_SESS_VARS_SOURCED=1

fi

ZDOTDIR=$HOME/.config/zsh
SteveLauC commented 1 year ago

The command doesn't return anything back.

If it is exported, then it should be returned, see How do you determine whether shell variables are exported or not?

zsh and all other programs can clearly see ZDOTDIR

zsh will source its config file so it should be visible

SteveLauC commented 1 year ago

Here's where exactly Home Manager sets up the zshenv files: https://github.com/nix-community/home-manager/blob/master/modules/programs/zsh.nix#L481C1-L493

And mine results like this

# Environment variables
. "/home/novaviper/.nix-profile/etc/profile.d/hm-session-vars.sh"

# Only source this once
if [[ -z "$__HM_ZSH_SESS_VARS_SOURCED" ]]; then
  export __HM_ZSH_SESS_VARS_SOURCED=1

fi

ZDOTDIR=$HOME/.config/zsh

I am not a nix user, so I cannot understand this :<, sorry about this:(

NovaViper commented 1 year ago

The command doesn't return anything back.

If it is exported, then it should be returned, see How do you determine whether shell variables are exported or not?

zsh and all other programs can clearly see ZDOTDIR

zsh will source its config file so it should be visible

Ah so it's exported, but even though it's not exported, its variable seems to still be visible within ZSH (but not inside of bash, zsh is set as the default shell on my system).

Here's where exactly Home Manager sets up the zshenv files: https://github.com/nix-community/home-manager/blob/master/modules/programs/zsh.nix#L481C1-L493 And mine results like this

# Environment variables
. "/home/novaviper/.nix-profile/etc/profile.d/hm-session-vars.sh"

# Only source this once
if [[ -z "$__HM_ZSH_SESS_VARS_SOURCED" ]]; then
  export __HM_ZSH_SESS_VARS_SOURCED=1

fi

ZDOTDIR=$HOME/.config/zsh

So what it looks like it's doing directly is just making ZDOTDIR whatever value that's defined, but not exporting it to make it available for other shells. 🤔

SteveLauC commented 1 year ago

Ah so it's exported, but even though it's not exported, its variable seems to still be visible within ZSH (but not inside of bash, zsh is set as the default shell on my system).

$ bash
$ echo $ZDOTDIR

Another way to test if it is exported, launch a bash in zsh, bash won't source the zsh file, if it is exported, then bash can definitely see ZDOTDIR

but not exporting it to make it available for other shells. thinking

An exported variable can be inherited by its children processes

NovaViper commented 1 year ago

Ah so it's exported, but even though it's not exported, its variable seems to still be visible within ZSH (but not inside of bash, zsh is set as the default shell on my system).

$ bash
$ echo $ZDOTDIR

Another way to test if it is exported, launch a bash in zsh, bash won't source the zsh file, if it is exported, then bash can definitely see ZDOTDIR

Ah yeah, so the main issue is that the variable isn't being exported. I just made an issue over on Home Manager, hopefully the devs can address it

NovaViper commented 1 year ago

Hey just wanted to give an update to this, I did actually go ahead and make a PR on home-manager. Waiting for it to get reviewed and then merged 🎉

NovaViper commented 1 year ago

And the commit's been merged! So I'm going close the issue since the fix is merged in the master branch of HM!