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

--self-manage breaks usage of as:command #387

Closed
1 of 4 tasks
mruwek opened this issue Mar 27, 2017 · 11 comments
Closed
1 of 4 tasks

--self-manage breaks usage of as:command #387

mruwek opened this issue Mar 27, 2017 · 11 comments

Comments

@mruwek
Copy link

mruwek commented Mar 27, 2017

  • Type:
    • Bug
    • Enhancement
    • Feature Request
    • Question

Yep, I'm writing this from Cygwin, but the same bug is present on my Fedora25 linux machine (I'll update version strings accordingly when I'm back home).

  • zplug --version: 2.4.1
  • zsh --version: zsh 5.3 (x86_64-unknown-cygwin)
  • uname -a: CYGWIN_NT-6.1 opti77 2.7.0(0.306/5/3) 2017-02-12 13:18 x86_64 Cygwi

Minimal zshrc (with less than 30 lines)

source ~/.zplug/init.zsh

zplug 'zplug/zplug', hook-build:'zplug --self-manage'
zplug "k4rthik/git-cal", as:command

if ! zplug check --verbose; then
  zplug install
fi

zplug load

Step to reproduce

  1. Install zplug
  2. Add config above
  3. Reboot terminal and wait for installation to complete
  4. Reboot terminal
  5. git-cal
  6. echo $ZPLUG_BIN
  7. echo $PATH
  8. ls $ZPLUG_BIN
  9. ls $ZPLUG_HOME/repos/zplug/zplug/bin

Results

  1. git-cal is not found.
  2. $ZPLUG_BIN (/home/user/.zplug/bin by default) is different from relevant entry in the $PATH (/home/user/.zplug/repos/zplug/zplug/bin).
  3. Relevant commands are properly installed in $ZPLUG_BIN.
  4. $ZPLUG_HOME/repos/zplug/zplug/bin does not contain installed commands (git-cal in the example above).
mruwek added a commit to mruwek/dotfiles that referenced this issue Mar 28, 2017
@babarot
Copy link
Member

babarot commented Mar 30, 2017

Show me your zplug env

mruwek added a commit to mruwek/zplug that referenced this issue Mar 30, 2017
@mruwek
Copy link
Author

mruwek commented Mar 30, 2017

@b4b4r07

Show me your zplug env

Here it is:

ZPLUG_ROOT = /home/jacek/.zplug/repos/zplug/zplug
ZPLUG_HOME = /home/jacek/.zplug
ZPLUG_THREADS = 16
ZPLUG_PROTOCOL = HTTPS
ZPLUG_FILTER = fzf-tmux:fzf:peco:percol:fzy:zaw
ZPLUG_LOADFILE = /home/jacek/.zplug/packages.zsh
ZPLUG_USE_CACHE = true
ZPLUG_ERROR_LOG = /home/jacek/.zplug/.error_log
ZPLUG_BIN = /home/jacek/.zplug/bin
ZPLUG_CACHE_DIR = /home/jacek/.zplug/cache
ZPLUG_REPOS = /home/jacek/.zplug/repos
_ZPLUG_VERSION = 2.4.1
_ZPLUG_URL = https://github.com/zplug/zplug
_ZPLUG_OHMYZSH = robbyrussell/oh-my-zsh
_ZPLUG_PREZTO = sorin-ionescu/prezto
_ZPLUG_AWKPATH = /home/jacek/.zplug/repos/zplug/zplug/misc/contrib
_ZPLUG_CONFIG_SUBSHELL = :

Also promised update of version strings:

  • zplug --version: 2.4.1
  • zsh --version: zsh 5.2 (x86_64-redhat-linux-gnu)
  • uname -a: Linux srebrny-surfer 4.9.14-200.fc25.x86_64 Implement update command #1 SMP Mon Mar 13 19:26:40 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

@mruwek
Copy link
Author

mruwek commented Mar 30, 2017

Also as You can see I've probably found the source of the bug. Default value for ZPLUG_BIN was evaluated after the PATH was populated.

@mruwek
Copy link
Author

mruwek commented Mar 30, 2017

Posted #389 with proposed fix.

@fbergroth
Copy link

Did you test #372? It should fix it as well, but the PR has been ignored so far.

@mruwek
Copy link
Author

mruwek commented Mar 31, 2017

@fbergroth
No I didn't - I searched through issues, but not PRs (mea culpa!). I see now it's the same issue and quite similar approach to resolve it, only I've managed $ZPLUG_ROOT setting differently. Let's wait for the @b4b4r07 opinion about which solution he prefers.

@fbergroth
Copy link

@mruwek Your PR populates fpath with uninitialized variables. I cherrypicked your second commit into my branch, so hopefully #372 is a fix we can agree on.

zakame added a commit to zakame/dotfiles that referenced this issue Apr 3, 2017
`zplug --self-manage` isn't working for me now, so leave it out for the
time being, until zplug/zplug#387 gets resolved (e.g. via
zplug/zplug#372)
@dieggsy
Copy link

dieggsy commented Apr 12, 2017

For the record, I'm able to reproduce this exact issue.

arecarn added a commit to arecarn/dotfiles that referenced this issue Jun 6, 2017
@drrlvn
Copy link

drrlvn commented Aug 29, 2017

For some reason #372 was closed but the fix there works.

@yacoob
Copy link

yacoob commented Dec 29, 2017

Just bumped into this: commands are linked in $ZPLUG_BIN, but it's $ZPLUG_ROOT/bin that's being added to PATH. Any chance for an upstream fix? :)

@babarot
Copy link
Member

babarot commented Jan 31, 2020

I'm gonna redesign --self-manage flag: #540 so closing this now.

@babarot babarot closed this as completed Jan 31, 2020
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

6 participants