Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upfix: remove automatic compinit #678
Conversation
Raised by concerns in #674 about performance implications and unexpected intrusive behaviour
|
Update to docs still pending hence the WIP badge
Should probably instruct users to do this after sourcing asdf.sh as it adds to fpath, not before asdf.sh like it does now |
|
@andrewthauer @Strayer Could you test and review to ensure these changes do as you expect and resolve any performance issues you may have seen? Thanks |
|
Works great for me, I now only source |
|
Same. Back to normal |
|
I should point out that I noticed the following error could still occur if a user is sourcing the bash completions manually and using zsh (instead of bash):
I have a script that wraps the |
That was exactly what I was doing and got me to even look up the issue here. I think it is reasonable to assume that sourcing a file that specifically states |
Exactly. It didn't affect anything noticeable, which is why I probably didn't think twice about it. I did start seeing it in |
Given we were advising people to manually source the docs before v0.7.7:
Anyone have feelings on how we should handle deprecating things like https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/asdf/asdf.plugin.zsh as they are now doing needless work?
@Strayer thanks, but I am yet to setup GitHub sponsors yet. Has been on my backlog since the beta |
|
The more I get into the weeds of this the more I think we should not be adding things to the We recommend sourcing So I think the solution here is to:
Thoughts anyone? @nomasprime @philpennock? |
|
Documenting required steps and otherwise not doing anything WFM. Packagers can drop the completion into whatever directory their system sets up for such things (Homebrew/whatever), power-users who bypass such things can read the docs. |
|
As a power use myself, I already have the expectation of manually appending things to the For reference:
|
|
Thanks for weighing in @philpennock Thanks for the information @andrewthauer Then Homebrew ZSH change has been merged, so users installing with Homebrew should get the correct ZSH completions through that. I will update the docs to reflect this. I will try the symlink method used by zsh-completions in the oh-my-zsh asdf plugin and see if we can remove the usage of the bash completions there. And I will update the docs for the rest of people using other ZSH frameworks about manual fpath setup or looking at the aforementioned plugins to update their own ecosystems. Thanks for all your input everyone. @Stratus3D Perhaps once I get this fix in we can organise a patch release so others don't run into these same issues? |
|
The call to |
|
@juanibiapina Yes, the compinit will also be removed. Sorry for the disruption. |
|
@jthegedus yes, assuming no breaking changes have been merged since |
|
I think we are good to go now. Updates to plugins can hopefully be socialised by those who use them once they find this "feature" was reversed. |
|
@Stratus3D Please cut a new release when you have the time, cheers |
|
|
Summary
#544 released in https://github.com/asdf-vm/asdf/releases/tag/v0.7.7 changed:
which results in
compinitbeing executed multiple times (should people use a framework or explicitly use compinit in their ownzshrc``).compinit` is designed to be called once, so we should not automatically run it here and double up on those already calling it.This has performance implications and concerns were raised about asdf being unexpectedly intrusive.
Clearer documentation updates will rectify any issues with this removal. I would wager few ZSH users are relying on asdf to run
compinitso hopefully we see minimal affect.This was previously not a problem for ZSH users as we were:
bashcompinitand thus not interfering withcompinitzshrcfilesFixes: #674