NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18k stars 14.01k forks source link

spaceship not installed properly after upgrade - $fpath issue? #172213

Closed mhwombat closed 2 years ago

mhwombat commented 2 years ago

Describe the bug

Some time between 1 May (22.05pre372961.e10da1c7f54) and 9 May (22.05pre375061.c777cdf5c56), something seems to have changed so that spaceship-prompt is no longer installed properly.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install and configure zsh + spaceship.
  2. Verify that spaceship prompt is working.
  3. nixos-upgrade to 22.05pre375061.c777cdf5c56.
  4. Notice that prompts are messed up.
  5. Be sad.

Expected behavior

I'd like the spaceship prompt back.

Screenshots

Not applicable.

Additional context

Prior to today, my last nixos-rebuild was on 1 May. In a shell that was launched before that rebuild, spaceship is listed as an available theme. Note that $fpath includes a lot of things.

$ prompt -l
Currently available prompt themes:
adam1 adam2 bart bigfade clint default elite2 elite fade fire off oliver pws redhat restore suse walters zefram spaceship
$ echo $fpath
/nix/store/fwhaaayd1synhlkipap9jnh2xjvmkk5i-zsh-5.8.1/share/zsh/5.8.1/functions /run/current-system/sw/share/zsh/site-functions /run/current-system/sw/share/zsh/5.8.1/functions /run/current-system/sw/share/zsh/vendor-completions /nix/var/nix/profiles/default/share/zsh/site-functions /nix/var/nix/profiles/default/share/zsh/5.8.1/functions /nix/var/nix/profiles/default/share/zsh/vendor-completions /etc/profiles/per-user/amy/share/zsh/site-functions /etc/profiles/per-user/amy/share/zsh/5.8.1/functions /etc/profiles/per-user/amy/share/zsh/vendor-completions /home/amy/.nix-profile/share/zsh/site-functions /home/amy/.nix-profile/share/zsh/5.8.1/functions /home/amy/.nix-profile/share/zsh/vendor-completions

I then did a nixos-rebuild today (9 May). In a shell that was launched after that rebuild, spaceship is no longer there. Also, $fpath is much shorter.

> prompt -l
Currently available prompt themes:
adam1 adam2 bart bigfade clint default elite2 elite fade fire off oliver pws redhat restore suse walters zefram
> echo $fpath
/nix/store/9har53kbyf8b13d9h5kdywkiiwr17a9i-zsh-5.8.1/share/zsh/5.8.1/functions

Notify maintainers

@r-ryantm @Vonfry @malob

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.34, NixOS, 22.05 (Quokka), 22.05pre375061.c777cdf5c56`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.9.0pre20220503_9489b4b`
 - channels(amy): `""`
 - channels(root): `"nixos, stable-21.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos
mhwombat commented 2 years ago

I had misspelled @Vonfry initially, but I've corrected it now. This comment is just to make sure they see it.

Vonfry commented 2 years ago

During these days, the only commit proposed by me is about fcitx5 which isn't affect zsh any more. And I never modify modules of zsh in nixpkgs.

By the way, I'm not a user and maintainer of spaceship-prompt. According to the drv of it, there is no other dependencies for the package. The infomation that you provide shows spacing-prompt can be found by zsh. I think the problem may be caused by your zsh configuration.

I suggest that you can open zsh with set -x to check what happened really which may show some error messages.

mhwombat commented 2 years ago

The infomation that you provide shows spacing-prompt can be found by zsh.

Assuming you mean spaceship-prompt, I don't think that's correct. In the shell I launched before nixos-upgrade, prompt -l does find the theme. But in the shell I launched after nixos-upgrade, it doesn't find the spaceship theme and a lot of directories seem to be missing from $fpath. I think that's the crux of the problem.

I think the problem may be caused by your zsh configuration.

To test that, I deleted my .zshrc and started a new terminal. With no configuration, the problem still exists: the spaceship theme isn't found.

> prompt -l
Currently available prompt themes:
adam1 adam2 bart bigfade clint default elite2 elite fade fire off oliver pws redhat restore suse walters zefram
> echo $fpath
/nix/store/9har53kbyf8b13d9h5kdywkiiwr17a9i-zsh-5.8.1/share/zsh/5.8.1/functions

I can select other themes without problems, but not spaceship.

amy@wombat11k:~/ > prompt adam1
amy@wombat11k ~ % prompt bart
wombat11k [prompt bart] ~                                                                                                                                                                                                                                                    5:32
amy@wombat11k ~ % prompt fire
█▓▒░amy@wombat11k░▒▓██▓▒░ Tue May 10 05:33:10
~/ prompt pws
5:33% prompt zefram
[5.8.1]amy@wombat11k:~> prompt spaceship
Usage: prompt <options>
Options:
    -c              Show currently selected theme and parameters
    -l              List currently available prompt themes
    -p [<themes>]   Preview given themes (defaults to all)
    -h [<theme>]    Display help (for given theme)
    -s <theme>      Set and save theme
    <theme>         Switch to new theme immediately (changes not saved)

Use prompt -h <theme> for help on specific themes.
[5.8.1]amy@wombat11k:~>

I suggest that you can open zsh with set -x to check what happened really which may show some error messages.

I tried that, but I don't see any error messages.

[5.8.1]amy@wombat11k:~> set -x
+/run/current-system/sw/bin/zsh:13> set -x
+prompt_zefram_precmd:1> local exitstatus=0
+prompt_zefram_precmd:2> setopt localoptions noxtrace noksharrays
[5.8.1]amy@wombat11k:~> zsh
+/run/current-system/sw/bin/zsh:14> zsh
amy@wombat11k:~/ > promptinit
amy@wombat11k:~/ > prompt -l
Currently available prompt themes:
adam1 adam2 bart bigfade clint default elite2 elite fade fire off oliver pws redhat restore suse walters zefram
amy@wombat11k:~/ > prompt spaceship
Usage: prompt <options>
Options:
    -c              Show currently selected theme and parameters
    -l              List currently available prompt themes
    -p [<themes>]   Preview given themes (defaults to all)
    -h [<theme>]    Display help (for given theme)
    -s <theme>      Set and save theme
    <theme>         Switch to new theme immediately (changes not saved)

Use prompt -h <theme> for help on specific themes.
mhwombat commented 2 years ago

Just did another nixos-rebuild and the problem went away!