Errors when creating init.zsh
bduff9 opened this issue · 7 comments
Hello! I was using antigen in my zsh setup previously, however there were various issues I had with that setup and then realized it seems like its not maintained anymore. I found zgenom among some other options, however this seemed like the easiest and fastest option so set it up last night.
Loving how easy it was to setup, however, I am running into some errors I see when starting a new session. Unsure if they can be ignored or they point to other issues as things seem to be working thus far, though admittedly it is still very early.
When I first install or reset, I get this output:
❯ reloadzsh
Creating a zgenom save
/Users/bduffey2/.zgenom/sources/ohmyzsh/ohmyzsh/___/oh-my-zsh.sh:149: no matches found: ~/.oh-my-zsh/lib/*.zsh
-- zgenom: Creating `/Users/bduffey2/.zgenom/sources/init.zsh` ...
-- zgenom: Initializing completions ...
-- zgenom: Compiling files ...
__zgenom_compile:zcompile:3: can't write zwc file: /Users/bduffey2/.zcompdump-Brian Duffey’s iMac-5.3.zwc
__zgenom_compile:zcompile:3: can't write zwc file: /Users/bduffey2/.zcompdump-Brian Duffey’s iMac-5.6.2.zwc
__zgenom_compile:zcompile:3: can't write zwc file: /Users/bduffey2/.zcompdump-Brian Duffey’s iMac-5.7.1.zwc
__zgenom_compile:zcompile:3: can't write zwc file: /Users/bduffey2/.zcompdump-Brian Duffey’s iMac-5.8.zwc
Are these cause for concern? Thanks in advance.
First of all thanks for checking out zgenom 😊
The issue you're seeing just says that your compdump files cannot be compiled.
A compdump is a "completion dump" which is costly to load so compiling it gives probably the largest startup time boost.
The compdumps above aren't generated zgenom (unless you specified the name manually). So this error shouldn't be an issue.
It's however strange that this error occurs. Could you try renaming one of the files to .zcompdump-5.3.zwc
and check if it then works? It could also be an issue that the chmod
rights of the files are the issue.
The easiest solution to get rid of this issue would be to remove those files since they're probably unused. If they're still used it wouldn't be an issue to remove them since they'd be created again. Ideally you run zgenom reset after removing.
Thanks for your reply. I deleted those files and then ran zgenom reset
followed by reloadzsh
. I still get one of those errors despite the file not existing before running the reload (I ran it twice and verified it doesn't exist prior to reloading). The output hasn't changed much but here is the new output when reloading zsh:
❯ reloadzsh
Creating a zgenom save
/Users/bduffey2/.zgenom/sources/ohmyzsh/ohmyzsh/___/oh-my-zsh.sh:149: no matches found: ~/.oh-my-zsh/lib/*.zsh
-- zgenom: Creating `/Users/bduffey2/.zgenom/sources/init.zsh` ...
-- zgenom: Initializing completions ...
-- zgenom: Compiling files ...
__zgenom_compile:zcompile:3: can't write zwc file: /Users/bduffey2/.zcompdump-Brian Duffey’s iMac-5.8.zwc
It could be an issue since you're not restarting the shell. Thus the current shell might lock the file preventing it from being compiled.
Could you try zgenom reset; zsh
?
Just tried it, unfortunately no difference:
❯ zgenom reset; zsh
-- zgenom: Deleting `/Users/bduffey2/.zgenom/sources/init.zsh` ...
Creating a zgenom save
/Users/bduffey2/.zgenom/sources/ohmyzsh/ohmyzsh/___/oh-my-zsh.sh:149: no matches found: ~/.oh-my-zsh/lib/*.zsh
-- zgenom: Creating `/Users/bduffey2/.zgenom/sources/init.zsh` ...
-- zgenom: Initializing completions ...
-- zgenom: Compiling files ...
__zgenom_compile:zcompile:3: can't write zwc file: /Users/bduffey2/.zcompdump-Brian Duffey’s iMac-5.8.zwc
Alright, it's an easy fix.
Your Mac is probably called Brian Duffey’s iMac
. The issue is the ’
which causes zcompile
to fail. (Not an issue of zgenom but the underlying zsh builtin).
You have two options:
- Rename your Mac to
Brian Duffey's iMac
,Brian Duffeys iMac
or something else which hasn't special characters. - Set
ZGEN_CUSTOM_COMPDUMP="${ZDOTDIR:-$HOME}/.zcompdump_$ZSH_VERSION"
* before you source zgenom.
* You can use any path here, but this would match your current config but leave out your machines name.
On another note, you seem to have an issue in your ohmyzsh config:
/Users/bduffey2/.zgenom/sources/ohmyzsh/ohmyzsh/___/oh-my-zsh.sh:149: no matches found: ~/.oh-my-zsh/lib/*.zsh
Are you setting $ZSH
somewhere in your .zshrc
?
Cool, thanks. I set the compdump value and it seems to have resolved that issue.
Yes, I see that no matches found error before too. However I got my initial .zshrc file years ago when I first installed it had a line at the beginning that set the ZSH value. I removed that and now everything seems clean and correct:
❯ zgenom reset; zsh
-- zgenom: Deleting `/Users/brianduffey/.zgenom/sources/init.zsh` ...
Creating a zgenom save
-- zgenom: Creating `/Users/brianduffey/.zgenom/sources/init.zsh` ...
-- zgenom: Initializing completions ...
-- zgenom: Compiling files ...
I will still check to see how fast everything is with this new setup now that everything is working, but much appreciate all your help and assistance!