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

Add OS::get_version_alias() #11292

Closed
adamscott opened this issue Dec 5, 2024 · 5 comments · Fixed by godotengine/godot#100372
Closed

Add OS::get_version_alias() #11292

adamscott opened this issue Dec 5, 2024 · 5 comments · Fixed by godotengine/godot#100372

Comments

@adamscott
Copy link
Member

adamscott commented Dec 5, 2024

Describe the project you are working on

Reporting godotengine/godot#100055

Describe the problem or limitation you are having in your project

Especially on Windows 11, the system info Godot offers when selecting Help → Copy System Info is misleading, as Windows 10.0.22631 in reality means Windows 11, not Windows 10.

It stems from the use of OS::get_version() as the sole OS identifier.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

OS::get_version_alias() would return these values when called on different systems.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Alias Pseudo-rule of OS::get_version()
Windows 11  >= 10.0.22000
Windows 10 < 10.0.22000
Windows 8 >= 6.2.9200
Windows 7 < 6.2.9200 && >= 6.1.7601
Windows Vista < 6.2.9200
macOS Sequoia >= macOS 15.0.0
macOS Sonoma < macOS 15.0.0 >= macOS 14.0.0

If this enhancement will not be used often, can it be worked around with a few lines of script?

No, as it's a new API and needs to work in the editor.

Is there a reason why this should be core and not an add-on in the asset library?

Needs to be in the editor.

Edit: Updated macOS to show their names.

@Calinou
Copy link
Member

Calinou commented Dec 5, 2024

This method should also list the Windows update, as it's relevant to many issues. For instance, Windows 10 1903 or Windows 11 24H2. Insider builds will have "unknown" build numbers, so their build number should be listed directly instead.

Does macOS need special handling here? As far as I can tell, the major version number matches what you see in macOS' own UI.

@bruvzg
Copy link
Member

bruvzg commented Dec 5, 2024

Does macOS need special handling here?

Only if we translate it to names instead of numbers: 15.x.x → macOS Sequoia, 14.x.x → macOS Sonoma, and so on.

@adamscott
Copy link
Member Author

 This method should also list the Windows update, as it's relevant to many issues. For instance, Windows 10 1903 or Windows 11 24H2. Insider builds will have "unknown" build numbers, so their build number should be listed directly instead.

We could have OS::get_sub_version_alias() that returns 1903, 24H2, or 15.1.

@adamscott
Copy link
Member Author

I mean, we should absolutely copy something like "OS::get_version_alias() (OS::get_version())" when clicking on Help -> Copy System Info.

@adamscott
Copy link
Member Author

adamscott commented Dec 12, 2024

We could inspire ourselves from what Python does.

platform method Return value
mac_ver() ('15.1.1', ('', '', ''), 'arm64')
win32_ver()  ('11', '10.0.22631', 'SP0', 'Multiprocessor Free') 
freedesktop_os_release()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants