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

Bug: zip not installed, unclear error message #1304

Open
Eonfge opened this issue Jul 24, 2024 · 3 comments
Open

Bug: zip not installed, unclear error message #1304

Eonfge opened this issue Jul 24, 2024 · 3 comments

Comments

@Eonfge
Copy link

Eonfge commented Jul 24, 2024

Bug report
When zip is not installed on a Linux system, there is no clear error message when unpacking a .zip file fails.

To reproduce

[kevin@fedora ~]$ sdk install java 21.0.4-amzn

Downloading: java 21.0.4-amzn

In progress...

####################################################################################################################################################################################################################################### 100.0%

Repackaging Java 21.0.4-amzn...
/usr/bin/env: ‘zip’: No such file or directory

Done repackaging...
unzip:  cannot find or open /home/kevin/.sdkman/tmp/java-21.0.4-amzn.zip, /home/kevin/.sdkman/tmp/java-21.0.4-amzn.zip.zip or /home/kevin/.sdkman/tmp/java-21.0.4-amzn.zip.ZIP.

Stop! The archive was corrupt and has been removed! Please try installing again.

System info

  • Fedora Linux 40 (Workstation Edition)
  • GNU bash, version 5.2.26(1)-release (x86_64-redhat-linux-gnu)
  • SDKMAN
    • script: 5.18.2
    • native: 0.4.3

** Triage **

  • For end-users, install zip with your package manager.
  • For SDKMAN, it would be best to use command -v zip to check if zip is installed
@Eonfge Eonfge added the bug label Jul 24, 2024
@marc0der
Copy link
Member

marc0der commented Jul 24, 2024

@Eonfge We've had issues with command -v in the past because not all systems support it.

For end-users: install SDKMAN via the official installation channel. The installer will halt if you don't have all the necessary dependencies (zip, unzip, curl) installed.

@marc0der marc0der removed the bug label Jul 24, 2024
@Eonfge
Copy link
Author

Eonfge commented Jul 26, 2024

Hey, I think there is a small gap in the functionality here: Once installed, there is no check when running SDKMAN.

I must have installed SDKMAN 2 years ago on this laptop, and in the meantime dependencies have changed for other applications. Thus, zip was removed. If SDKMAN were to be distributed with a reliable packaging method like DEB and/or RPM, this problem could have been avoided.

For now, it would be best to just add a runtime check for zip


Could you btw tell me which systems don't support command -v since it's a mandatory part of the POSIX standard which all Shells should support.

@marc0der
Copy link
Member

marc0der commented Jul 26, 2024

Okay, sorry for my misinformation. I went back and looked at the project history and found that we had introduced command -v elsewhere instead of using which.

If you were up for taking on this work on, your PR would be greatly appreciated. Also, with the Rust rewrite underway, keep in mind that these issues will disappear once we no longer rely on the bash functions.

@marc0der marc0der reopened this Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants