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

zstd detection false positive on MacOS #3827

Closed
zbynek opened this issue Dec 26, 2024 · 7 comments · Fixed by #3845
Closed

zstd detection false positive on MacOS #3827

zbynek opened this issue Dec 26, 2024 · 7 comments · Fixed by #3845
Labels

Comments

@zbynek
Copy link

zbynek commented Dec 26, 2024

Describe the bug
The new version of mise install script tries to decide whether to use zstd or tar based on tar version and this fails on MacOS with tar version
bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.12 liblzma/5.4.3 bz2lib/1.0.8 (using MacOS 15.0.1).

To Reproduce
Run curl https://mise.run/ | sh on MacOS without zstd and the above mentioned version of tar.

Expected behavior
mise installed

Workaround:
Run export MISE_INSTALL_EXT=tar.gz before installing mise.

Note: the code introduced in https://github.com/jdx/mise/pull/3798/files checks for presence of zstd using command -v, doing that before the version check should fix the issue.

@zbynek zbynek added the bug label Dec 26, 2024
@roele
Copy link
Contributor

roele commented Dec 27, 2024

Odd, does not cause any issues on my side with this tar version (but i'm on macOS 15.2)

tar --version
bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.12 liblzma/5.4.3 bz2lib/1.0.8

curl https://mise.run/ | MISE_INSTALL_PATH=~/Downloads/test/mise sh -x

@zbynek
Copy link
Author

zbynek commented Dec 27, 2024

@roele do you know how did you get the zstd executable? I know it can be installed with Homebrew (https://formulae.brew.sh/formula/zstd ), but from a quick Google search I cannot find any evidence that it should be part of MacOS by default.

@roele
Copy link
Contributor

roele commented Dec 27, 2024

The debug output for my run did not show usage of zstd but tar and i did not realize i actually had zstd installed (as dependency of curl, openjdk via brew). So you're saying the zstd binary is still required also when using tar which claims it can automatically detect compression and extract it without mentioning a dependency on other binaries.

@jdx
Copy link
Owner

jdx commented Dec 27, 2024

I haven't had time to take a look but it's probably as OP said, the script does a check for whether it should use bsd tar or zstd but I may have the conditional flipped somewhere

EDIT: wait sorry, forget that. Yeah I had the impression @roele did but I didn't actually test without zstd installed. It seems weird to me that bsdtar's manpage doesn't mention zstd is actually required to use the --zstd flag in tar—or maybe I missed that.

@jdx jdx closed this as completed in #3845 Dec 27, 2024
@roele
Copy link
Contributor

roele commented Dec 27, 2024

I could not find much information on the behaviour around dependencies for bsdtar but some --use-compress-program flag caught my attention that simply refers a command to use as compression algorithm which seems what might be used somehow with auto detection.

@jdx
Copy link
Owner

jdx commented Dec 27, 2024

arguably we could just take the logic that uses bsdtar or zstd | tar out since it sounds like we're relying on zstd being installed regardless

@roele
Copy link
Contributor

roele commented Dec 27, 2024

Agreed. GNU tar does not seem to have this limitation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants