-
Notifications
You must be signed in to change notification settings - Fork 47
meson: verify that all shell_versions match gnome_shell_req
#1514
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,28 @@ | |
| gnome_shell_req = ['>=46.0', '<50'] | ||
| shell_versions = ['46', '47', '48', '49'] | ||
|
|
||
| # Verify that all shell_versions match gnome_shell_req | ||
|
|
||
| shell_versions_expanded = [] | ||
|
|
||
| foreach shell_version : shell_versions | ||
| if shell_version.contains('.') | ||
| shell_versions_expanded += [shell_version] | ||
| else | ||
| foreach suffix : ['0', '1', '9', 'alpha', 'beta', 'rc'] | ||
| shell_versions_expanded += f'@shell_version@.@suffix@' | ||
| endforeach | ||
| endif | ||
| endforeach | ||
|
|
||
| foreach shell_version : shell_versions_expanded | ||
| foreach shell_version_req : gnome_shell_req | ||
| if not shell_version.version_compare(shell_version_req) | ||
| error(f'Shell version @shell_version@ does not match @shell_version_req@') | ||
|
Check failure on line 51 in meson.build
|
||
| endif | ||
| endforeach | ||
| endforeach | ||
|
Comment on lines
+48
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Consider simplifying the validation approach. Once the expansion logic is fixed to only include The current nested loop approach is correct but potentially over-engineered for this use case. 🧰 Tools🪛 GitHub Check: ci / bundle[failure] 51-51: [failure] 51-51: 🤖 Prompt for AI Agents |
||
|
|
||
| summary('Target GNOME Shell version', gnome_shell_req, list_sep: ', ') | ||
|
|
||
| gjs_shebang = get_option('shebang_override') | ||
|
|
||
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.
Pre-release version suffixes cause validation to fail.
The expansion logic includes
'alpha','beta', and'rc'suffixes, which create pre-release versions (e.g.,46.alpha) that semantically come before the corresponding release version (e.g.,46.0). In version comparison semantics,46.alpha < 46.0, so these pre-release versions fail the>=46.0requirement.This is causing the CI failure:
Shell version 46.alpha does not match >=46.0To validate that short versions like
"46"fall within the required range, you only need to check the.0release version. The additional minor versions ('1','9') and pre-release suffixes are unnecessary and cause false negatives.🔎 Proposed fix
Remove the problematic suffixes and only check
.0for short versions:foreach shell_version : shell_versions if shell_version.contains('.') shell_versions_expanded += [shell_version] else - foreach suffix : ['0', '1', '9', 'alpha', 'beta', 'rc'] - shell_versions_expanded += f'@shell_version@.@suffix@' - endforeach + shell_versions_expanded += f'@shell_version@.0' endif endforeach📝 Committable suggestion
🤖 Prompt for AI Agents