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
stack assumes tar is GNU tar, but that's not always true #2283
Comments
In #416 (comment) (which lists the requirements before Stack supports OpenBSD), I suggested having |
That sounds reasonable, but neither bzcat nor xzcat (nor GNU tar) are installed by default on OpenBSD machines, so an error message telling the user to install xz would probably still be helpful to some folks. |
That message should already be there—Stack looks up It seems looking for Line 801 in 8e61e9a
with
The However, this would silently fallback to tar even on OpenBSD. Using a pipe would be more robust but a bit trickier (that is, not a 5-minute job). |
Makes sense to me! |
Since OpenBSD's tar does not support xz, use only `gtar` there. Prefer `gtar` elsewhere so I can test this. The UX is not adequate but it might be useful.
I looked at the code and this was easy. I learned I have easy access to both the platform and the archive type, so I ended up doing something slightly different in 90ecd0c, and closer to what @bonds described—on OpenBSD I require Right now I'm defaulting to |
OpenBSD
@Blaisorblade I'll try out the '2283-openbsd-hack' branch and let you know how it goes. |
Verified '2283-openbsd-hack' works as expected on OpenBSD, that is to say, it handles xz compressed archives now. Without gtar installed:
With gtar installed:
|
@bonds Good to hear! |
If you're up for it, I suggest pass j and z, that way gtar isn't required when it wouldn't otherwise be needed. |
Since OpenBSD's tar does not support xz, use only `gtar` there. Stick to `tar` elsewhere. The UX is not perfect but it's already useful.
Agreed and done (in 0ae5411), PR in #2456. I'm using |
Support OpenBSD's tar where possible, require GNU tar for xz support (#2283)
The PR has been merged, so I think this is fixed! Good stuff! |
As long as nobody objects to requiring I might be a wimp for not trying to use piping, but since you can get that wrong (signals/threading/exceptions/whatnot) I also feel I shouldn't try unless I'm an expert in getting that right ;-). |
Seems reasonable to require that on openbsd. Seems fine to not use piping too! |
I tried installing GHC using stack, but I got an error:
OpenBSD's tar doesn't support xz. I happened to have the GNU tar packages installed, its binary is named
gtar
on OpenBSD, so I worked around the issue by symlinking gtar as tar. Would be neat if stack looked for gtar instead of tar on OpenBSD and told the user to go install gtar if they haven't. I won't be offended if you have higher priority stuff to do though, just thought I'd throw this out there, just in case. :)The text was updated successfully, but these errors were encountered: