z-a-eval icon indicating copy to clipboard operation
z-a-eval copied to clipboard

No files for compliation found

Open HeroCC opened this issue 1 year ago • 2 comments

# before
zinit lucid wait has'pyenv-virtualenv-init' atclone'pyenv virtualenv-init - > pyenv-venv.zsh' atpull'%atclone' pick'pyenv-venv.zsh' nocompile'!' id-as'pyenv-venv2' for @zdharma-continuum/null

Downloading zdharma-continuum/null… (at label: pyenv-venv2…)
Cloning into '$HOME/.local/share/zinit/plugins/pyenv-venv2'...
==> Compiling pyenv-venv.zsh [OK]

# after 
zinit lucid wait has'pyenv-virtualenv-init' eval'pyenv virtualenv-init -' id-as'pyenv-venv1' for @zdharma-continuum/null

Downloading zdharma-continuum/null… (at label: pyenv-venv1…)
Cloning into '$HOME/.local/share/zinit/plugins/pyenv-venv1'...
==> No files for compilation found
Warning: ∞zinit-compile-plugin-hook hook returned with 1
[eval] Caching output of (`pyenv virtualenv-init -…')

I notice the "No files for compilation found" warning when using the eval ice. However, the zwc file does exist:

ls $HOME/.local/share/zinit/plugins/pyenv-venv1
LICENSE.md  evalcache.zsh  evalcache.zsh.zwc  readme.md

Is there a way to make sure zinit loaded the complied version? Is this error benign / can it be fixed?

HeroCC avatar Dec 08 '23 19:12 HeroCC

Zinit by default attempts to compile a plugin before the atclone ice runs. In your original command, you used the ice nocompile'!', which forces compilation to occur after your atclone ice.

When using zdharma-continuum/null, Zinit throws that error by default due to no files being available to compile, this may be a bug/feature introduced at some point as I believe Zinit used to not throw this error when using zdharma-continuum/null

The cache generation in z-a-eval runs during the atclone process of loading a plugin and thus when used with zdharma-continuum/null Zinit attempts to compile the plugin before z-a-eval creates the cache. To avoid this error message for now, you can add nocompile'!' as you used in your first example.

zinit lucid wait has'pyenv-virtualenv-init' eval'pyenv virtualenv-init -' nocompile'!' id-as'pyenv-venv1' for @zdharma-continuum/null

Regardless the message is harmless as the cache is still being sourced during a plugin load and Zsh always uses the compiled version when it is available. I'll do some research to see if there is anything I can do about the error but the above should solve your problem if you care about hiding that error message.

NICHOLAS85 avatar Dec 11 '23 05:12 NICHOLAS85

Great, thank you! I'll leave the ticket open for your investigation, but your workaround worked successfully.

HeroCC avatar Dec 17 '23 03:12 HeroCC