jandamm/zgenom

zgenom save throws errors on minimal install

devth opened this issue ยท 8 comments

devth commented

Tried setting up a minimal install with:

# Download zgenom
[[ -f "${HOME}/.zgenom/zgenom.zsh" ]] ||
    git clone --depth 1 -- \
        https://github.com/jandamm/zgenom.git "${HOME}/.zgenom"

source "${HOME}/.zgenom/zgenom.zsh"

# zgenom autoupdate

# if the init script doesn't exist
if ! zgenom saved; then
  echo "Creating a zgenom save"
  # source ~/.dotfiles/zsh_prompt.sh

  # save all to init script
  zgenom save

  # Compile your zsh files
  zgenom compile "$HOME/.zshrc"
  zgenom compile $ZDOTDIR
fi

Opening a new shell throws errors, and takes several seconds:

Last login: Tue Nov 16 12:03:01 on ttys003
Creating a zgenom save
-- zgenom: Creating `/Users/trevorhartman/.zgenom/sources/init.zsh` ...
zgenom-save:3: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
__zgenom_write:1: no such file or directory: /Users/trevorhartman/.zgenom/sources/init.zsh
-- zgenom: Initializing completions ...
-- zgenom: Compiling files ...

Do I need to manually create a ~/.zgenom/sources dir? Should that be mentioned in the installation instructions?

devth commented

After manually creating a ~/.zgenom/sources dir, it now prints this on shell startup:

/Users/trevorhartman/.zgenom/sources/init.zsh:source:19: no such file or directory:
/Users/trevorhartman/.zgenom/sources/init.zsh:source:21: no such file or directory:

contents of init.zsh is:

# {{{
# Generated by zgenom.
# This file will be overwritten the next time you run zgenom save!

# Don't source twice or when zgenom was invoked otherwise.
[[ -z $ZGENOM_PLUGINS ]] || return 0

export PMSPEC=0fiPs
export ZPFX=/Users/trevorhartman/.zgenom/polaris

ZGENOM_PLUGINS=()

# ### Plugins & Completions
fpath=( ${fpath})

# ### General modules
typeset -ga zsh_loaded_plugins
zsh_loaded_plugins+=( "" )
ZERO="" source ""
zsh_loaded_plugins+=( "" )
ZERO="" source ""

autoload -Uz compinit && \
   compinit -C 

# }}}

Thanks for reporting.

It seems no one has previously tried zgen/zgenom without actually cloning any repository ๐Ÿ˜…

Is this something you encountered while testing things out or are you planning to use zgenom with local plugins only?

devth commented

Just testing things out. Rebuilding my zsh config since it's gotten slow over time. I was running some benchmarks and wanted to try zgenom without anything else to see if it added overhead.

Eventually I'd plan to add a few non-local plugins.

In my tests the overhead of zgenom wasn't even a millisecond with a generated init.zsh and autoupdate.

In my opinion the time of sourcing init.zsh doesn't really count as zgenom time since you'd have to modify fpath and source plugins anyway.

I tested it by commenting out all zgenom code and sourcing the init.zsh manually vs the "normal" setup.
I also checked when not sourcing the init.zsh with zmodload zsh/zprof and came to the same result.

devth commented

Awesome.

Should be working fine now ๐Ÿ‘

devth commented

Thanks!