I managed to install fisher on my OpenBSD box by downloading the function w/ curl as recommended. fisher itself works, but this happens when I try installing any package:
$ fisher add jethrokuan/z
fetching https://codeload.github.com/jethrokuan/z/tar.gz/master
cannot install github.com/jethrokuan/z -- is this a valid package?
done in 1.00s
Thank you for your help in advance!
@bertalanp99 How can I get my hands on an OpenBSD box? Could you help with that?
@bertalanp99 In the meantime, can you try a few things for me?
First, I want to make sure we can get the tarball. The following should write it to standard output. It should look like a lot of nonsense.
curl -Ss https://codeload.github.com/jethrokuan/z/tar.gz/master 2>&1
If that works, let's see if we can extract the package. The following should extract the package to a directory named tmp in your current working directory.
mkdir tmp
curl -Ss https://codeload.github.com/jethrokuan/z/tar.gz/master 2>&1 | tar -xzf- -C ./tmp --strip-components=1
la tmp
@jorgebucaran Thank you for your quick replies, I appreciate them!
I can get the tarball, but curl -Ss <url> 2>&1 does not output its contents into the terminal. If the -s (silent) flag is dropped we can see that curl avoids printing binary output to the terminal (so it does not mess it up) but this can be enforced by --output -. Thus
curl -Ss --output - https://codeload.github.com/jethrokuan/z/tar.gz/master 2>&1
does what you have asked for.
As to tar, OpenBSD's implementation does not have the --strip-components option. I can extract the tarball by issuing for example
curl -Ss --output - https://codeload.github.com/jethrokuan/z/tar.gz/master 2>&1 | tar -xzf- -C ./tmp
I get the z-master files in my tmp folder of course.
PS What do you mean about getting your hands on an OBSD machine? I don't know how to help you with that, perhaps you could virtualize one? Again, thanks for your support.
@bertalanp99 I meant how to virtualize it. I managed to virtualize FreeBSD, not OpenBSD (which does support --strip-components by the way).
The problem must be tar then. We're not actually writing the package to the terminal, so we can leave curl as it is.
@jorgebucaran Oh, I see. I don't really know, I haven't ever done it myself, but maybe I can look into it later today. You mean the problem could be because of --strip-components in tar?
@bertalanp99 What git version are you using?
@jorgebucaran I am using v2.19.1, why?
@bertalanp99 How can I get my hands on an OpenBSD box? Could you help with that?
I just ran into this same issue and had tracked it down to OpenBSD tar lacking --strip-components, and only found this GitHub issue while Googling alternatives... Wish I'd found this issue an hour sooner, would have saved myself the debugging.
Anyway, I have an OpenBSD 6.4 system running on Google Cloud and could give you a shell on it for testing. Or I could help you get one up and running. IIRC, I originally followed some variation on this to make it work: https://marc.info/?l=openbsd-misc&m=138757967321855&w=2
Thank you, @kelp. 馃檶
In the meantime, you could work around this by installing GNU tar.
I appreciate you trying to help, but I was able to run OpenBSD on vultr. Not free, but it was easy.
@jorgebucaran
Wow, I am so stupid, I should have thought of this temporary fix before. OpenBSD has a gtar package in ports that is the GNU tar... As a temporary workaround I simply changed tar to gtar in the function.
@bertalanp99 @kelp 39e9f3f34079a1705f4580fa232fe15d10b632c0 馃帀
@jorgebucaran I ran into this issue while setting fisher on OpenBSD today. Judging by https://man.openbsd.org/tar, it looks like OpenBSD tar doesn't support GNU-style options like --extract or --gzip? Would it make sense to switch the tar command to use the shorter options so that it works on OpenBSD, too? Otherwise, thanks for the tip @bzp99 I aliased tar to gtar and that works!
Let's change --extract and --gzip back to -xz then. Can you make sure that'll work on OpenBSD and open a PR?
I no longer use fisher but can confirm that -xz works on OpenBSD, I use it all the time.
@jorgebucaran I can take a stab at that. What's the recommended workflow for testing out fisher changes while I also have fisher installed?
Clone this repository and using the same method described in the README, source ./fisher/fisher.fish and fisher install ./fisher), add your changes, fisher update, lather, rinse, repeat.
See also https://github.com/jorgebucaran/fisher/blob/main/.github/workflows/ci.yml.