-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix(main/zig): check the Kernel version and stop if unsupported at install #25126
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
base: master
Are you sure you want to change the base?
Conversation
TomJo2000
commented
Jun 20, 2025
- (re-)closes [Bug]: Running some zig commands gives "illegal instruction" #20783
- (re-)closes [Bug]: Zig SIGILL (illegal opecodes) #25125
35aa8a6
to
737dbfb
Compare
737dbfb
to
1e215d0
Compare
|
There goes another 4 hours...
If the package cannot function on the device it is being installed on, should that package not stop its own installation? I suspect a simple warning and continue will not be sufficiently clear but I'm happy to have a discussion about it. |
fi | ||
;; | ||
pacman) | ||
if [ "$(vercmp "$_KERNEL_VERSION" "$_MINIMUM_VERSION")" != 1 ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will return 0 if kernel version is 3.16.0, should probably check if it is -1 instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh you're right I flipped the condition 3.16.0
would return 0
which is fine.
echo "Your device does not support any version of Zig" | ||
echo "There's nothing we can do to make it supported." | ||
fi | ||
exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failing in the preinst script is not a good idea, users then manually have to clean up by removing zig. It would be better to have the kernel version check in the actual zig binary.
Next best option would be to exit without an error here even if kernel version is not supported by zig, the error/warning is then printed and users might understand why the program does not work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the package cannot function on the device it is being installed on, should that package not stop its own installation?
If stopping meant that it uninstalled itself again and cleaned everything up, then that would work. When preinst script fails it leaves apt unusable though until user manually fixes it, and I don't think that is a situation we should ever create on purpose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep that's my mistake.
We can probably throw up a read -t 60
"press any key to continue" style warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nvm -t
is a bash addition to read