tristanisham / zvm

zvm (Zig Version Manager) lets you easily install/upgrade between different versions of Zig.
https://www.zvm.app
MIT License
487 stars 32 forks source link

Install script doesn't work on Fedora 40 #90

Open chung-leong opened 5 months ago

chung-leong commented 5 months ago

Describe the bug

cleong@fedora:~$ curl https://raw.githubusercontent.com/tristanisham/zvm/master/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current Dload  Upload   Total   Spent    Left  Speed
100  3947  100  3947    0     0  18416      0 --:--:-- --:--:-- --:--:-- 18358
Installing zvm-linux-amd64.tar in /home/cleong/zvm
wget is installed. Using wget...
Unknown option 'show-progress'
tar: zvm.tar: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
rm: cannot remove 'zvm.tar': No such file or directory

Desktop (please complete the following information):

cleong@fedora:~$ uname -a
Linux fedora 6.8.5-301.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Apr 11 20:00:10 UTC 2024 x86_64 GNU/Linux
chung-leong commented 5 months ago

Fedora also uses .bashrc instead of .profile.

tristanisham commented 5 months ago

Thanks for taking the time to make this issue. I'll look into it and hopefully have a fix out soon.

i-am-wololo commented 5 months ago

looked into it, you're probably using wget2, which fedora uses by default instead of wget. wget2 doesnt have the --show-progress flag, causing the script to crash. As a quickfix you could tweak the install script a bit to use curl instead of wget

tristanisham commented 5 months ago

Nice find! I think the better solution would be to add a check on the version of wget and if the progress flag isn't supported we can run the equivalent on wget2 or use Curl if it's installed.

isFakeAccount commented 4 months ago

@chung-leong Can you try the #92?

curl https://raw.githubusercontent.com/isFakeAccount/zvm/master/install.sh | bash

I tested it on https://github.com/isFakeAccount/zvm/actions/runs/9982103634. Seems to work.

isFakeAccount commented 4 months ago

@i-am-wololo Does fedora alias wget to wget2?

timodempwolf commented 3 months ago

@isFakeAccount Yes it does alias it like that. ll /usr/bin/wget lrwxrwxrwx. 1 root root 5 Jul 2 02:00 /usr/bin/wget -> wget2

Right now i usually download the script and then remove the show-progress flags but that obviously still is a little extra work on each upgrade.

timodempwolf commented 3 months ago

Fedora also uses .bashrc instead of .profile.

I think here it would make more sense to provide a flag to set the config file. I will usually use my .zshenv for these kind of configs.

tristanisham commented 3 months ago

That would make sense. Some kind of automatic determination would be good too, with the flag as a backup in case it couldn't make a decision or the user knows what they want.

I realize I have a blind spot as I develop on Debian and test on SUSE.

Alfredoes234 commented 2 months ago

I was just messing around with the script to get it to work and the easiest fix would be to just have the verbose flag (as this is the same in each wget version but --show-pogress turns into --force-progress). But I suspect you want a more sophisticated option than this.

image

Alfredoes234 commented 2 months ago

You could have a big conditional to cover for it but it mean that red text saying " Unknown option 'show-progress' " but it works. wget --quiet --show-progress --max-redirect 5 -O zvm.tar "https://github.com/tristanisham/zvm/releases/latest/download/$1" || wget --quiet --force-progress --max-redirect 5 -O zvm.tar "https://github.com/tristanisham/zvm/releases/latest/download/$1"