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

Migrating from V2 to V3 #450

Closed
jorgebucaran opened this issue Oct 5, 2018 · 25 comments
Closed

Migrating from V2 to V3 #450

jorgebucaran opened this issue Oct 5, 2018 · 25 comments
Labels
docs Docs and not so docs

Comments

@jorgebucaran
Copy link
Owner

jorgebucaran commented Oct 5, 2018

Migrating from V2 to V3

The easiest way to upgrade from V2 to the new fisher is to remove all packages and uninstall V2 first:

fisher ls | fisher rm
fisher self-uninstall

Now you can install V3 from scratch:

curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish

Notice we're just copying a file to a directory—this is not a curlpipe installer!

Too late for that...

If you already upgraded to V3 using the former fisher update you'll need to manually remove the old configuration directories and packages.

First, remove the old configuration directories.

rm -rf ~/.cache/fisherman ~/.config/fisherman

Now, there is no way to automate removing a package that was previously installed with V2, so go to your functions, completions, and cond.f directories inside your fish configuration path and remove all the files that you didn't put in there yourself.

If you were using a custom installation prefix, removing that directory should be good enough. ✂️

Note: Your fish configuration path is usually ~/.config/fish. If the XDG_CONFIG_HOME environment variable is defined on your system, use $XDG_CONFIG_HOME/fish instead.

I am using a custom installation prefix

The environment variable used to customize the installation prefix has been renamed to $fisher_path (to make it obvious it's a fisher feature and not a fish feature). If you were using a custom installation prefix, make sure to use $fisher_path and not $fish_path.

set fisher_path $fish_path
set -e fish_path

See changing the installation prefix in the documentation for details.

I'm done, what next?

Congratulations! You did it. 🎉

See V3's release notes to know what changed and what's new in fisher.

Help, it didn't work!

If you upgraded to V3 and something is not working like it should, feel free to ask a question here! If you think you completed the upgrade process correctly, but have a problem with something else—maybe you found a bug—consider creating a new issue instead.

@PatrickF1
Copy link
Contributor

It may be a good idea to reference this in the readme? Wish there was a mailing list for fisher!

@jorgebucaran
Copy link
Owner Author

Good idea. @patrickf3139 How long do you think it would be prudent to leave this information on the README?

@PatrickF1
Copy link
Contributor

PatrickF1 commented Oct 6, 2018 via email

@reitzig
Copy link

reitzig commented Oct 7, 2018

Given that there's no warning at all on the CLI before or after the update, and fisher just keeps working properly, I'd say the migration note should be as prominent in the README as possible, and there for a while.

@franciscolourenco
Copy link
Contributor

Is fisher self-uninstall supposed to uninstall packages as well?

@jorgebucaran
Copy link
Owner Author

@franciscolourenco Yes, it is. This is covered in the documentation here.

Uninstalling

You wish to know how to uninstall fisher and everything you've installed with it from your system. Or perhaps something went wrong and you want to start over. This will uninstall all the packages, purge the cache and then remove fisher from your fish functions directory.

fisher self-uninstall

@franciscolourenco
Copy link
Contributor

It is not mentioned in the upgrade instructions. It is quite unexpected that after executing the seemingly inocent commands all fish packages are gone. This should be mentioned and additionally it would be useful if the uninstall command listed the packages which are being uninstalled.

Also strange that fisher update installs 3.x when there is no backwards compatibility. Not sure how to solve this but I assume you thought about it.

@jorgebucaran
Copy link
Owner Author

@franciscolourenco I see. You asked a general question, so I assumed you meant V3. V3's self-uninstall removes all packages. V2 self-uninstall does not. I'll add this to the guide.

Also strange that fisher update installs 3.x when there is no backward-compatibility. Not sure how to solve this but I assume you thought about it.

No way to solve that at this point. That's why there is a "Too late for that..." section in the guide.

@reitzig
Copy link

reitzig commented Oct 8, 2018

No way to solve that at this point.

Yes. Next time, please include something in the auto-self-update that warns users and allows them to abort. Not every time is good for seemingly breaking the shell, hunting down the issue, and re-installing all packages manually.

@franciscolourenco
Copy link
Contributor

franciscolourenco commented Oct 8, 2018

V3's self-uninstall removes all packages. V2 self-uninstall does not.

After uninstalling V2 and installing V3, fisher ls doesn't show any packages. Are V2 packages still in the filesystem?

@jorgebucaran
Copy link
Owner Author

@franciscolourenco Yup, they should be in the previous ~/{.config,.cache}/fisherman directories.

What is your output?

la ~/.config/fisherman

@reitzig
Copy link

reitzig commented Oct 8, 2018

@jorgebucaran I appreciate all your work. I still think your perspective is skewed.

While routinely upgrading packages, I ran fisher update (or whatever it was called) on v2. Without any notice or chance to interact, v3 was installed. Apparently, the old caches or installed packages messed things up; I got the weirdest errors (e.g. "no such option --complete, if memory serves). That made me check out the fisherman doc and bugtracker, where I found the first note about the breaking upgrade. I then had to manually remove the old stuff and re-install all packages. Only after removing the old caches as well did things start behaving normally again.
This happened at home, so no big deal aside from time wasted.

Is upgrading theoretically easy? Yea, sure. On my work machine, I knew what to do and it took minutes.

Is it practically easy? No, it's completely broken, because users don't check the documentation before running updates on applications/tools unless the updater tells us to. Why would we? Had I broken a production system with this, it would have been a dealbreaker. Even wasting half an hour of work time would have been bad.

@jorgebucaran
Copy link
Owner Author

@reitzig Sorry, for your trouble. I was aware the migration wouldn't be easy for people inadvertently upgrading via fisher update. Thanks to #307 I almost left the project. That would've been worse. Trouble or not it was a risk I was willing to take in order to move forward with V3.

Note that #445 was open for almost a month and I filed #446 & #443 before that too. Too bad you missed them.

I think we're done discussing this. I am. You already shared your perpective. It is a valid perspective. I'm glad you were able to upgrade in your free time and that your production systems continue to operate smoothly.

Cheers!

@reitzig
Copy link

reitzig commented Oct 8, 2018

Gotcha. I agree that abandoning the project vs some migration pains is an easy choice to make.

I hope you understand you you'll almost never involve users in a discussion held on Github, at least not without explicitly inviting them to it. While we agree that the effects here were not ideal (I think?), I for one don't know what a good strategy would be for a tool like fisherman; breaking things after careful consideration and providing documentation on how to fix it may very well be the least evil. We can talk after I've faced a similar scenario myself. ;D

Cheers, hope you can take some joy out for working on this again!

@franciscolourenco
Copy link
Contributor

franciscolourenco commented Oct 8, 2018

@jorgebucaran the directory seems to be gone, but there are some symlinks still around

$ la ~/.config/fisherman
ls: cannot access '/Users/user/.config/fisherman': No such file or directory
$ ls -Alrth ~/.config/fish/functions
Click for details
total 192K
-rw-r--r-- 2 user staff  599 May 27  2016 humanize_duration.fish
lrwxr-xr-x 1 user staff   64 Apr  8  2017 upload.fish -> /Users/user/code/dotfiles/home/config/fish/functions/upload.fish
lrwxr-xr-x 1 user staff   66 Apr  8  2017 pastebin.fish -> /Users/user/code/dotfiles/home/config/fish/functions/pastebin.fish
lrwxr-xr-x 1 user staff   69 Apr  8  2017 fish_prompt.fish -> /Users/user/code/dotfiles/home/config/fish/functions/fish_prompt.fish
-rw-r--r-- 1 user staff    0 May 21  2017 fisher.fish.1495387995
lrwxr-xr-x 1 user staff   51 Jul 21  2017 __zo.fish -> /Users/user/.config/fisherman/z/functions/__zo.fish
lrwxr-xr-x 1 user staff   44 Mar 24  2018 test.fish -> /Users/user/.config/fisherman/done/test.fish
lrwxr-xr-x 1 user staff   52 Sep 26 16:57 npm.fish -> /Users/user/.config/fisherman/fnm/functions/npm.fish
lrwxr-xr-x 1 user staff   53 Sep 26 16:57 node.fish -> /Users/user/.config/fisherman/fnm/functions/node.fish
lrwxr-xr-x 1 user staff   44 Sep 26 16:57 menu.fish -> /Users/user/.config/fisherman/menu/menu.fish
lrwxr-xr-x 1 user staff   58 Sep 26 16:57 last_job_id.fish -> /Users/user/.config/fisherman/last_job_id/last_job_id.fish
lrwxr-xr-x 1 user staff   50 Sep 26 16:57 getopts.fish -> /Users/user/.config/fisherman/getopts/getopts.fish
lrwxr-xr-x 1 user staff   60 Sep 26 16:57 get_file_age.fish -> /Users/user/.config/fisherman/get_file_age/get_file_age.fish
lrwxr-xr-x 1 user staff   52 Sep 26 16:57 fnm.fish -> /Users/user/.config/fisherman/fnm/functions/fnm.fish
lrwxr-xr-x 1 user staff   52 Sep 26 16:57 fishtape.fish -> /Users/user/.config/fisherman/fishtape/fishtape.fish
-rw-r--r-- 1 user staff 1.3K Sep 26 16:57 fish_user_key_bindings.fish
lrwxr-xr-x 1 user staff   56 Sep 26 16:57 await.fish -> /Users/user/.config/fisherman/await/functions/await.fish
lrwxr-xr-x 1 user staff   56 Sep 26 16:57 __z_clean.fish -> /Users/user/.config/fisherman/z/functions/__z_clean.fish
lrwxr-xr-x 1 user staff   54 Sep 26 16:57 __z_add.fish -> /Users/user/.config/fisherman/z/functions/__z_add.fish
lrwxr-xr-x 1 user staff   50 Sep 26 16:57 __z.fish -> /Users/user/.config/fisherman/z/functions/__z.fish
lrwxr-xr-x 1 user staff   57 Sep 26 16:57 __fzfcmd.fish -> /Users/user/.config/fisherman/fzf/functions/__fzfcmd.fish
lrwxr-xr-x 1 user staff   70 Sep 26 16:57 __fzf_reverse_isearch.fish -> /Users/user/.config/fisherman/fzf/functions/__fzf_reverse_isearch.fish
lrwxr-xr-x 1 user staff   72 Sep 26 16:57 __fzf_parse_commandline.fish -> /Users/user/.config/fisherman/fzf/functions/__fzf_parse_commandline.fish
lrwxr-xr-x 1 user staff   59 Sep 26 16:57 __fzf_open.fish -> /Users/user/.config/fisherman/fzf/functions/__fzf_open.fish
lrwxr-xr-x 1 user staff   62 Sep 26 16:57 __fzf_get_dir.fish -> /Users/user/.config/fisherman/fzf/functions/__fzf_get_dir.fish
lrwxr-xr-x 1 user staff   64 Sep 26 16:57 __fzf_find_file.fish -> /Users/user/.config/fisherman/fzf/functions/__fzf_find_file.fish
lrwxr-xr-x 1 user staff   63 Sep 26 16:57 __fzf_complete.fish -> /Users/user/.config/fisherman/fzf/functions/__fzf_complete.fish
lrwxr-xr-x 1 user staff   57 Sep 26 16:57 __fzf_cd.fish -> /Users/user/.config/fisherman/fzf/functions/__fzf_cd.fish
lrwxr-xr-x 1 user staff   68 Sep 26 16:57 __fnm_version_which.fish -> /Users/user/.config/fisherman/fnm/functions/__fnm_version_which.fish
lrwxr-xr-x 1 user staff   71 Sep 26 16:57 __fnm_version_validate.fish -> /Users/user/.config/fisherman/fnm/functions/__fnm_version_validate.fish
lrwxr-xr-x 1 user staff   68 Sep 26 16:57 __fnm_version_query.fish -> /Users/user/.config/fisherman/fnm/functions/__fnm_version_query.fish
lrwxr-xr-x 1 user staff   68 Sep 26 16:57 __fnm_version_local.fish -> /Users/user/.config/fisherman/fnm/functions/__fnm_version_local.fish
lrwxr-xr-x 1 user staff   71 Sep 26 16:57 __fnm_version_download.fish -> /Users/user/.config/fisherman/fnm/functions/__fnm_version_download.fish
lrwxr-xr-x 1 user staff   58 Sep 26 16:57 __fnm_use.fish -> /Users/user/.config/fisherman/fnm/functions/__fnm_use.fish
lrwxr-xr-x 1 user staff   60 Sep 26 16:57 __fnm_usage.fish -> /Users/user/.config/fisherman/fnm/functions/__fnm_usage.fish
lrwxr-xr-x 1 user staff   65 Sep 26 16:57 __fnm_run_bin_as.fish -> /Users/user/.config/fisherman/fnm/functions/__fnm_run_bin_as.fish
lrwxr-xr-x 1 user staff   57 Sep 26 16:57 __fnm_rm.fish -> /Users/user/.config/fisherman/fnm/functions/__fnm_rm.fish
lrwxr-xr-x 1 user staff   65 Sep 26 16:57 __fnm_read_fnmrc.fish -> /Users/user/.config/fisherman/fnm/functions/__fnm_read_fnmrc.fish
lrwxr-xr-x 1 user staff   61 Sep 26 16:57 __fnm_mirror.fish -> /Users/user/.config/fisherman/fnm/functions/__fnm_mirror.fish
lrwxr-xr-x 1 user staff   59 Sep 26 16:57 __fnm_list.fish -> /Users/user/.config/fisherman/fnm/functions/__fnm_list.fish
lrwxr-xr-x 1 user staff   67 Sep 26 16:57 __fnm_index_update.fish -> /Users/user/.config/fisherman/fnm/functions/__fnm_index_update.fish
lrwxr-xr-x 1 user staff   52 Sep 26 16:57 zclean.awk -> /Users/user/.config/fisherman/z/functions/zclean.awk
lrwxr-xr-x 1 user staff   50 Sep 26 16:57 zadd.awk -> /Users/user/.config/fisherman/z/functions/zadd.awk
lrwxr-xr-x 1 user staff   47 Sep 26 16:57 z.awk -> /Users/user/.config/fisherman/z/functions/z.awk
lrwxr-xr-x 1 user staff   59 Sep 26 16:57 __z_complete.fish -> /Users/user/.config/fisherman/z/functions/__z_complete.fish
-rw-r--r-- 1 user staff  15K Oct  7 23:31 fisher.fish

@jorgebucaran
Copy link
Owner Author

jorgebucaran commented Oct 8, 2018

@franciscolourenco I suppose you ran fisher self-uninstall in V2. In that case, you need to remove the fish files V2 put in your fish functions directory. From the instructions:

Now, there is no way to automate removing a package that was previously installed with V2, so go to your functions, completions, and cond.f directories inside your fish configuration path and remove all the files that you didn't put in there yourself.

Based on your ls dump above you can remove all the files, except for fisher.fish and then run fisher again to commit changes in your fishfile.

@j-f1
Copy link

j-f1 commented Dec 29, 2018

I was able to downgrade by running this command:

curl https://raw.githubusercontent.com/jorgebucaran/fisher/2.13.0/fisher.fish\?nocache --create-dirs -sLo ~/.config/fish/functions/fisher.fish

I was then able to uninstall Fisher 2 and follow the instructions afterwards.

@jorgebucaran
Copy link
Owner Author

@j-f1 Thank you for sharing that! 💯

jakalada added a commit to jakalada/dotfiles that referenced this issue Dec 31, 2018
Migrating from V2 to V3 · Issue #450 · jorgebucaran/fisher
jorgebucaran/fisher#450
@Pyppe
Copy link

Pyppe commented Jan 1, 2019

With fish, version 3.0.0 and fisherman version 2.13.1 on macOS I'm seeing the following warning:

fisher self-uninstall
This will permanently remove fisherman from your system.
The following directories and files will be erased:

/Users/pyppe/.cache/fisherman
/Users/pyppe/.config/fisherman
/Users/pyppe/.config/fish/functions/fisher.fish
/Users/pyppe/.config/fish/completions/fisher.fish

fish: Unknown command '2'
~/.config/fish/functions/fisher.fish (line 2178):
            " &2
               ^
in function '__fisher_self_uninstall'
	called on line 217 of file ~/.config/fish/functions/fisher.fish

in function 'fisher'
	called on standard input
	with parameter list 'self-uninstall'

Continue? [Y/n]

It seems continuing did the trick, however.

@jorgebucaran
Copy link
Owner Author

@Pyppe Looks like an old bug. You did well. Welcome to Fisher 3.x 🎉

@aa8y
Copy link

aa8y commented Jan 5, 2019

So I followed the migration guide and removed the old version using

fisher ls | fisher rm
fisher self-uninstall

and installed the new version using

> /usr/bin/curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs https://git.io/fisher
> fisher --version
fisher version 3.2.2 ~/.config/fish/functions/fisher.fish

Also, I installed the latest version of fish shell.

> fish --version
fish, version 3.0.0

But when I try to install any package on Github, I get.

> fisher add edc/bass
fetching https://codeload.github.com/edc/bass/tar.gz/master
cannot add github.com/edc/bass -- is this a valid package?
done in 1485.86s

However, if I manually download the tar file from the link and decompress the package and install it using fisher, that works. These are the files I have and my fishfile is empty.

> find ~/.config/fisher
/home/aa8y/.config/fisher
/home/aa8y/.config/fisher/github.com
/home/aa8y/.config/fisher/github.com/edc
> find ~/.config/fish
/home/aa8y/.config/fish
/home/aa8y/.config/fish/conf.d
/home/aa8y/.config/fish/completions
/home/aa8y/.config/fish/completions/fisher.fish
/home/aa8y/.config/fish/fishd.foo
/home/aa8y/.config/fish/config.fish
/home/aa8y/.config/fish/fishfile
/home/aa8y/.config/fish/fish_variables
/home/aa8y/.config/fish/functions
/home/aa8y/.config/fish/functions/fisher.fish
/home/aa8y/.config/fish/functions/fish_prompt.fish
/home/aa8y/.config/fish/functions/nvm.fish
> wc -l ~/.config/fish/fishfile
0 /home/aa8y/.config/fish/fishfile

Not sure what the problem is, but I can definitely use some help :)

@jorgebucaran
Copy link
Owner Author

jorgebucaran commented Jan 5, 2019

@aa8y Can you create an issue with the problem and remove this comment later? This is just a migration guide.

The first wrong thing I see is "done in 1485.86s". That must be a bug (you didn't actually wait 25 mins did you?)

Then I would run:

curl -Ss https://codeload.github.com/edc/bass/tar.gz/master 2>&1 

...to make sure you are getting the correct output. Then use the full pipeline to make sure the tarball is being downloaded.

curl -Ss https://codeload.github.com/edc/bass/tar.gz/master 2>&1 | tar -xzf-
la

I suspect Fisher are erroring somewhere in between.

Why did you use /usr/bin/curl explicitly? Is there a reason why just curl wouldn't work on your system? curl is a requirement to use Fisher.

@aa8y
Copy link

aa8y commented Jan 6, 2019

@jorgebucaran I am sorry. I saw people commenting and figured that I'd leave one too :) However, after you asked me why I was using /usr/bin/curl specifically, that helped me solve my problem. What happened was that I had a version of curl installed by the system and another version installed via Linuxbrew. The latter was unable install Fisher due to lack of ca-certificates so I had to explicitly specify the system curl in /usr/bin. However, my problem was fixed after I removed curl installed via Linuxbrew.

@jorgebucaran
Copy link
Owner Author

@aa8y Great news, what about the "done in 1485.86s"? Seems like a bug. Can you run fisher again and report the ms time?

@aa8y
Copy link

aa8y commented Jan 8, 2019

@jorgebucaran The timing reported does still seem buggy. I ran it again without removing bass.

> fisher add edc/bass
fetching https://codeload.github.com/edc/bass/tar.gz/master
linking ~/.config/fish/functions/__bass.py
linking ~/.config/fish/functions/bass.fish
updated 1 package in -4497.20s

This is close to 75 minutes and it definitely did not take that long. So I decide to measure it.

> time -p fish -c 'fisher add edc/bass'
fetching https://codeload.github.com/edc/bass/tar.gz/master
linking ~/.config/fish/functions/__bass.py
linking ~/.config/fish/functions/bass.fish
updated 1 package in -4141.78s
real 15.94
user 13.84
sys 5.23

And ~16s seems more accurate. So if you want me to open an issue for that I can.

Repository owner locked as resolved and limited conversation to collaborators Jan 25, 2019
@jorgebucaran jorgebucaran unpinned this issue May 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
docs Docs and not so docs
Projects
None yet
Development

No branches or pull requests

7 participants