sbang.py: use os.uname and branch on kernel version#52373
Open
sbang.py: use os.uname and branch on kernel version#52373
Conversation
Signed-off-by: Harmen Stoppels <me@harmenstoppels.nl>
tgamblin
requested changes
May 5, 2026
Comment on lines
+25
to
+26
| major, minor = (int(x) for x in release.split(".")[:2]) | ||
| system_shebang_limit = 255 if (major, minor) >= (5, 1) else 127 |
Member
There was a problem hiding this comment.
Why risk IndexError when you don't have to?
Suggested change
| major, minor = (int(x) for x in release.split(".")[:2]) | |
| system_shebang_limit = 255 if (major, minor) >= (5, 1) else 127 | |
| version_tuple = tuple(int(x) for x in release.split(".")) | |
| system_shebang_limit = 255 if version_tuple >= (5, 1) else 127 |
Member
Author
There was a problem hiding this comment.
Slicing doesn't have that issue:
>>> [][:2]
[]
Member
|
@finkandreas @tvoskui @AndresYague @jonasjucker does this still work for you? This is a simpler approach than #43290 and will work regardless of whether kernel headers are installed. |
I just tried this out and I get inconsistent results. 4.18 would put it at the lower limit, but the header is at 256 Also, the proposed code fails on that release string too |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove Linux headers as a dependency of Spack.
The value has changed exactly only once in git history, and seems non-configurable.