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

zsh : promptinit and compinit definition files not found #5571

Closed
MP2E opened this issue Jan 4, 2015 · 11 comments
Closed

zsh : promptinit and compinit definition files not found #5571

MP2E opened this issue Jan 4, 2015 · 11 comments

Comments

@MP2E
Copy link

MP2E commented Jan 4, 2015

Upon updating to the newest nixpkgs this evening I now receive warnings when I open zsh

/etc/zshrc:12: promptinit: function definition file not found
/home/cray/.zshrc:15: compinit: function definition file not found
/home/cray/.zshrc:16: promptinit: function definition file not found

Here is my configuration.nix : https://github.com/MP2E/nix-projects/blob/master/nixos-config/configuration.nix

Perhaps related to 766207c? I'll do some bisecting and report back.

@jagajaga
Copy link
Member

jagajaga commented Jan 4, 2015

When I was merging that PR, I've tested it locally and everything was ok...
cc @kirelagin

@MP2E
Copy link
Author

MP2E commented Jan 4, 2015

Hm, confirmed with the bisect. Very strange! I don't see how adding a path could break anything... The change looks good to me. My configs are available in the repo above in case there's something different from my machine to yours

@jagajaga
Copy link
Member

jagajaga commented Jan 4, 2015

Can you post
echo $FPATH
Before that commit and after?

@MP2E
Copy link
Author

MP2E commented Jan 4, 2015

Before:
/usr/local/share/zsh/site-functions:/nix/store/z2acn6qlpjr3jigkgdg4c75b58bmf9n7-zsh-5.0.7/share/zsh/site-functions:/nix/store/z2acn6qlpjr3jigkgdg4c75b58bmf9n7-zsh-5.0.7/share/zsh/5.0.7/functions

After:
/home/cray/.nix-profile/share/zsh/site-functions:/nix/var/nix/profiles/default/share/zsh/site-functions:/run/current-system/sw/share/zsh/site-functions

@kirelagin
Copy link
Member

Hm, sorry for that, my NixOS box is broken right now, so I couldn’t test the changes thoroughly.

This default value of $FPATH gets hardcoded during build of zsh (by the way, surprisingly, there is no easy way to get rid of /usr/local/share/zsh/site-functions). Of all the default paths only /nix/store/…-zsh-5.0.7/share/zsh/5.0.7/functions (which they call fndir) is interesting for us, because the other one is already handled by profileRelativeEnvVars.

Right now I see two possible solutions (in order of preference):

  1. Make profileRelativeEnvVars prepend paths. Why does it overwrite the variable, anyway? Is that a feature or a bug? (/cc @oxij @edolstra @nbp).
  2. Append this per-zsh-instance path separately during shell initialization.

@MP2E
Copy link
Author

MP2E commented Jan 6, 2015

1 sounds good to me, I think prepending is better behavior in this case

@RafalBabinicz
Copy link

Bump.
Today I upgraded to nixos-15.05pre55818.173f41c (and after that to 15.05.git.c68ed69M). Unfortunately, I forgot to check Issues page before that.

This is what I have:

zsh’s FPATH

zsh: profile-relative functions path · 766207c · NixOS/nixpkgs · GitHub
gives '/etc/zshrc:12: promptinit: function definition file not found'

Investigating (after reverting 766207c)

>echo $FPATH
/home/kmicu/fpath:/usr/local/share/zsh/site-functions:/nix/store/m6xrbr4p1nkd9zirdi3gnpjwqmy6yax1-zsh-5.0.7/share/zsh/site-functions:/nix/store/m6xrbr4p1nkd9zirdi3gnpjwqmy6yax1-zsh-5.0.7/share/zsh/5.0.7/functions

Checking each path:

> ls /home/kmicu/fpath
prompt_pure_setup

this is from my personal .zshrc.

 > ls /usr/local/share/zsh/site-functions

gives no such directory.

> ls /nix/store/m6xrbr4p1nkd9zirdi3gnpjwqmy6yax1-zsh-5.0.7/share/zsh/site-functions

gives empty directory.

> ls -all /nix/store/m6xrbr4p1nkd9zirdi3gnpjwqmy6yax1-zsh-5.0.7/share/zsh/5.0.7/functions

gives

total 5508
dr-xr-xr-x 1 root root  17412 Jan  1  1970 .
dr-xr-xr-x 1 root root     40 Jan  1  1970 ..
-r--r--r-- 1 root root   2809 Jan  1  1970 _a2ps
-r--r--r-- 1 root root    487 Jan  1  1970 _a2utils
…
-r--r--r-- 1 root root   1939 Jan  1  1970 prompt_fire_setup
-r--r--r-- 1 root root   5942 Jan  1  1970 promptinit
-r--r--r-- 1 root root   3307 Jan  1  1970 promptnl
…
-r--r--r-- 1 root root   6093 Jan  1  1970 _zypper

Workaround

For now just revert 766207c

environment.profileRelativeEnvVars =
{ FPATH = [ "/share/zsh/site-functions" ]; };

Additional info

nixos-version
15.05.git.c68ed69M (Dingo)

zsh --version
zsh 5.0.7 (x86_64-unknown-linux-gnu)

@jagajaga
Copy link
Member

@kirelagin @MP2E so reverting for now.

@oxij @edolstra what about the real workaround? #5571 (comment) has good suggestions.

tomberek referenced this issue Jan 14, 2015
This is needed mostly for autocompletion.
@tomberek
Copy link
Contributor

For those who might need it:

print -r /nix/store/*zsh-5.0.7/share/zsh/5.0.7/functions([-1]) 

Should give you a path to put into a configuration.nix:

environment.interactiveShellInit =  ''
export FPATH=/nix/store/LONG HASH-zsh-5.0.7/share/zsh/5.0.7/functions:$FPATH
""

nixos-rebuild switch and you have a usable system until 766207c is reverted.

@jagajaga
Copy link
Member

@tomberek 4f596fb

@MP2E
Copy link
Author

MP2E commented Feb 9, 2015

This issue has been fixed for me, so I'll close this.

Is there need for a more proper solution? If so comment/reopen

@MP2E MP2E closed this as completed Feb 9, 2015
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

No branches or pull requests

5 participants