zsh-users / antigen

The plugin manager for zsh.
http://antigen.sharats.me
MIT License
8.07k stars 279 forks source link

cache zcompile error #632

Open TheZoc opened 6 years ago

TheZoc commented 6 years ago

Hello,

I just installed antigen (using a git clone) and, every time I modify my .zshrc (located in /home/zoc/.zsh/.zshrc - I use ZDOTDIR to add a .zsh directory in there) and restart the shell, I get the error:

-antigen-cache-generate:zcompile:65: can't open file: /home/zoc/.zshrc

Is this a real bug or am I doing something wrong?

Thank you very much in advance!

desyncr commented 6 years ago

It's probably a bug, let me look into it.

devalnor commented 6 years ago

The issue is back on a fresh OSX 10.13.2 install with homebrew on zsh 5.4.2 and antigen 2.2.3

-antigen-cache-generate:zcompile:65: can't open file: zsh

desyncr commented 6 years ago

I'll look at the issue. What's your antigen config?

devalnor commented 6 years ago
# Load source from Homebrew Install
source /usr/local/share/antigen/antigen.zsh

# Load the oh-my-zsh's library
antigen use oh-my-zsh

antigen bundle <<EOBUNDLES
    # Bundles from the default repo (robbyrussell's oh-my-zsh)
    # git

    # Syntax highlighting bundle.
    zsh-users/zsh-syntax-highlighting

    # Fish-like auto suggestions
    zsh-users/zsh-autosuggestions

    # Extra zsh completions
    zsh-users/zsh-completions

EOBUNDLES

# Load the theme
antigen theme robbyrussell

# Tell antigen that you're done
antigen apply

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
desyncr commented 6 years ago

Thanks gonna take a look at this!

desyncr commented 6 years ago

Another quick question. Is that file .zshrc or some other sourced file?

devalnor commented 6 years ago

Yes it's the complete .zshrc no other files.

desyncr commented 6 years ago

Tried on a clean install (zsh 5.4.2, antigen 2.2.3) but it seems I can't reproduce it. Tries both OSX and debian.

root@7d07be6e5a4b:~# ls -ltra
total 40
-rw-r--r-- 1 root root  140 Nov 19  2007 .profile
-rw-r--r-- 1 root root  570 Jan 31  2010 .bashrc
-rw-r--r-- 1 root root   44 Dec  2 04:11 .gitconfig
drwxr-xr-x 1 root root 4096 Dec  2 04:11 .ssh
drwxr-xr-x 1 root root 4096 Jan 15 16:16 ..
-rw-r--r-- 1 root root  687 Jan 15 16:21 .zshrc
-r--r--r-- 1 root root 1640 Jan 15 16:21 .zshrc.zwc
drwxr-xr-x 3 root root 4096 Jan 15 16:21 .antigen
-rw------- 1 root root  341 Jan 15 16:22 .zsh_history
drwx------ 1 root root 4096 Jan 15 16:22 .
root@7d07be6e5a4b:~# zsh
➜  ~ pwd
/root
➜  ~ zsh --version
zsh 5.4.2 (x86_64-unknown-linux-gnu)
➜  ~ antigen version
Antigen v2.2.3 (ff391b5)
Revision date: 2018-01-02 13:19:57 +0100
desyncr commented 6 years ago

You may set ANTIGEN_AUTO_CONFIG to false to avoid this behavior.

mattmc3 commented 5 years ago

I had this same issue. Removing the *.zwc files in the antigen directory ($ADOTDIR) solved it. Antigen will respect $ZDOTDIR, but make sure that it is set in ~/.zshenv before running antigen for the firts time so that antigen picks it up.

willzhqiang commented 4 years ago

I had this same issue. Removing the *.zwc files in the antigen directory (ADOTDIR)solvedit.AntigenwillrespectZDOTDIR, but make sure that it is set in ~/.zshenv before running antigen for the firts time so that antigen picks it up.

Seems there are two zwc files in my home directory, called .zshrc.zwc and .antigen.zwc, so I removed both of them and problem solved. Thanks for the tips!

uhlajs commented 4 years ago

Is there any progress? I am getting the same error. Here is my ~/.zshenv.

# Export ZDOTDIR
export ZDOTDIR="$HOME/.config/zsh"

# Manualy source .zshenv
source "$ZDOTDIR/.zshenv"
sparcbr commented 4 years ago

You said 'Here is my ~/.zshenv'. What about your ~/.config/zsh/.zshenv ? And your .zshrc ? How are you loading antigen?

IvanGrund commented 2 years ago

@desyncr ~~There is pretty old version of antigen.zsh file cached on github FR mirror that might cause this and maybe other bugs. Check string "~/.zshrc" in attached antigenzsh.cached.curl.log There is HTTP response header x-served-by: cache-fra19128-FRA~~

Wrong. There is difference between develop and master branch in that file.

adamancini commented 1 year ago

https://github.com/zsh-users/antigen/issues/632#issuecomment-503733519 works for me when I encountered this after moving ~/.zshrc into ~/.zshrcd/ and configuring ~/.zshenv and $ZDOTDIR appropriately

wosym commented 1 year ago

Also encountering this issue. Version: Antigen v2.2.2 (6bd497f) Zsh version: zsh 5.8 (x86_64-ubuntu-linux-gnu)

shvchk commented 1 year ago

Encountering this issue with antigen.zsh from master, but not with v2.2.3.