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

Runtime: let NVDA expose which runtime (32-bit or 64-bit) it is running on #16330

Closed
josephsl opened this issue Mar 23, 2024 · 2 comments · Fixed by #16726
Closed

Runtime: let NVDA expose which runtime (32-bit or 64-bit) it is running on #16330

josephsl opened this issue Mar 23, 2024 · 2 comments · Fixed by #16726
Labels
architecture/x64 p5 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.

Comments

@josephsl
Copy link
Collaborator

Hi,

Stems from #16304:

Introduction

As of 2024, Windows 10 is the last version to support 32-bit processors from Intel, AMD, and ARM, with Widows 11 supporintg 64-bit platforms only (AMD64 and ARM64). In 2025, consumer support for Windows 10 will end, with end of support for long-term servicing channel builds planned for 2032 (Windows 10 IoT Enterprise 2021 LTSC).

Originally, NVDA was written for 32-bit Python runtime. With impending end of support for 32-bit platforms, moving to 64-bit became a goal for NV Access and the NVDA community. According to #16304, a phased transition plan is proposed, with full transition tentatively scheduled for 2026.

Is your feature request related to a problem? Please describe.

During 32-bit to 64-bit transition, it becomes important to know which Python runtime NVDA is running on. This way NVDA Core and add-ons can execute appropriate code paths. For example, when accessing Widows Registry, WoW64 paths must be used if running 32-bit NVDA on 64-bit Windows and vice versa.

At the moment the following can be used to detect 32-bit versus 64-bit Python runtime:

  • os.environ (PROCESSOR_ARCHITECTURE variable)
  • sys.maxsize > 0x7fffffff (64-bit if greater, 32-bit otherwise)
  • platform.architecture()

Describe the solution you'd like

Expose a flag informing NVDA of 32-bit versus 64-bit platform. This can be either a boolean (True on 64-bit, False on 32-bit) or a string denoting the platform in use (can be set during NVDA compilation).

Describe alternatives you've considered

Standardize on one or more of the available platform detection options.

Additional context

Creating a flag informing NVDA Core and add-ons about Python runtime in use communicates willingness by NVDA community to take 64-bit transition seriously and can help people with editing code to take advantage of platform differences.

Thanks.

@seanbudd seanbudd added p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation. labels Mar 23, 2024
@seanbudd seanbudd added p5 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority and removed p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority labels Apr 26, 2024
@seanbudd
Copy link
Member

  • os.environ (PROCESSOR_ARCHITECTURE variable)
  • sys.maxsize > 0x7fffffff (64-bit if greater, 32-bit otherwise)
  • platform.architecture()

@josephsl - which of these do you recommend? Note that #16557 could close this

@josephsl
Copy link
Collaborator Author

Hi,

  1. os.environ: it exposes the actual Python/executable architecture string directly. This then can be compared with platform.machine()/winVersion.getWinVer().processorArchitecture when choosing code paths. A major limitation is that this is limited to Windows machines.
  2. sys.maxsize: it provides maximum integer value for 32-bit and 64-bit platforms. However, as the comparison is made against integers, this becomes a bit hard to understand for folks unfamiliar with binary representation.
  3. platform.architecture: at least the function returns 32-it or 64-bit string with compilation target (Windows PE/ELF/whatever). However, we wouldn't know the processor architecture.

Of these, I think the first option makes much sense as it communicates several things at once: actual processor architecture string, the Python runtime architecture, and the fact that NVDA targets Windows operating system. A flag can return True if the os.environ["PROCESSOR_ARCHITECTURE"] ends in "64".

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture/x64 p5 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
2 participants