Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +38 to +46
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

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.0 requirement.

This is causing the CI failure: Shell version 46.alpha does not match >=46.0

To validate that short versions like "46" fall within the required range, you only need to check the .0 release 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 .0 for 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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
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
if shell_version.contains('.')
shell_versions_expanded += [shell_version]
else
shell_versions_expanded += f'@shell_version@.0'
endif
endforeach
🤖 Prompt for AI Agents
In meson.build around lines 38 to 46 the expansion of short shell versions
incorrectly adds pre-release suffixes ('alpha','beta','rc') and unnecessary
minor versions, producing versions like "46.alpha" which compare lower than
"46.0" and fail the ">=46.0" check; change the expansion so that when a short
version (no dot) is encountered only the ".0" release variant is added (remove
'alpha','beta' and other extra suffixes and minor variants) so validation checks
use e.g. "46.0" only.


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

View workflow job for this annotation

GitHub Actions / ci / bundle

Problem encountered: Shell version 46.alpha does not match >=46.0

Check failure on line 51 in meson.build

View workflow job for this annotation

GitHub Actions / ci / bundle

Problem encountered: Shell version 46.alpha does not match >=46.0
endif
endforeach
endforeach
Comment on lines +48 to +54
Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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 .0 versions for short version strings, this nested loop validation will work correctly. However, checking one representative version (e.g., "46.0") per short version (e.g., "46") is sufficient to verify that the shell version falls within the required range.

The current nested loop approach is correct but potentially over-engineered for this use case.

🧰 Tools
🪛 GitHub Check: ci / bundle

[failure] 51-51:
Problem encountered: Shell version 46.alpha does not match >=46.0


[failure] 51-51:
Problem encountered: Shell version 46.alpha does not match >=46.0

🤖 Prompt for AI Agents
In meson.build around lines 48 to 54, the nested foreach loops validate every
expanded shell version against every requirement which is more complex than
necessary; instead, after fixing expansion to produce only .0 variants for short
versions, reduce validation to check a single representative expanded version
per short version (e.g., "46.0" for "46") against the gnome_shell_req list:
deduplicate or map short->representative expanded version and iterate that
reduced set, performing version_compare against the requirements and erroring if
any representative version does not satisfy the requirement.


summary('Target GNOME Shell version', gnome_shell_req, list_sep: ', ')

gjs_shebang = get_option('shebang_override')
Expand Down
Loading