nvdaHelper build: ARM64 and ARM64EC environments collide when building third-party deps under a native ARM64 Python interpreter

Open Beginner friendly
#21,236 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
66/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cmake, python
Domain
build-system

Research direction

Start in nvdaHelper/archBuild_sconscript and trace how isNVDACoreArch is evaluated for the ARM64 and ARM64EC environments created in sconstruct. The issue identifies the proposed condition and the conflicting third-party dependency outputs; reproduce the native ARM64 Python build if available and confirm the environments no longer target the same outputs. The reporter says they have a working fix, so coordinate before starting.

Written by the indexing model from the issue text.

Description

Title

nvdaHelper build: ARM64 and ARM64EC environments collide when building third-party deps under a native ARM64 Python interpreter

Related issues, PRs or discussions

Related to #18570 (ARM64EC libraries for X64 support on ARM64), #16580 (architecture enumerations), #13914 (enable Windows ARM64 support). None of these cover running NVDA's own process as native ARM64 Python, which is where this bug surfaces.

What is the current state of the codebase?

nvdaHelper/archBuild_sconscript computes isNVDACoreArch as:

isNVDACoreArch = (
    (PYTHON_PLATFORM == "win32" and TARGET_ARCH == "x86")
    or (PYTHON_PLATFORM == "win-amd64" and TARGET_ARCH == "x86_64")
    or (PYTHON_PLATFORM == "win-arm64" and TARGET_ARCH == "arm64")
)

envArm64EC (built in sconstruct) is envArm64.Clone() with isArm64EC = True — it keeps TARGET_ARCH == "arm64". The third condition above does not check isArm64EC, so when PYTHON_PLATFORM is actually "win-arm64" (i.e. SCons itself is running under a native ARM64 CPython interpreter, not x86/x64 emulated), both envArm64 and envArm64EC evaluate isNVDACoreArch as True simultaneously.

Third-party dependencies (espeak, liblouis, sonic, javaAccessBridge, uwp) are only built if isNVDACoreArch (same file, further down), and several of these (e.g. eSpeak NG via nvdaHelper/espeak/sconscript) use an absolute srcdir= outside any SCons variant_dir. With both arm64 and arm64ec environments believing they are the "core" arch, both try to build these third-party deps into the same output paths, with different compiler flags (/arm64EC vs none). SCons fails the build with:

scons: *** Two environments with different actions were specified for the same target:
<repo>\include\espeak\src\ucd-tools\src\case.obj
(action 1: cl ... (no /arm64EC flag))
(action 2: cl ... /arm64EC ...)

Why are changes required?

Today, nothing ever actually runs SCons under a native win-arm64 Python interpreter — NVDA's shipped builds run as x86/x64 Python, emulated on ARM64 Windows, so this branch of isNVDACoreArch is effectively dead code and the bug has never been exercised. It becomes reachable as soon as someone builds from source using the official python.org ARM64 CPython installer (available since 3.11) with a uv/pyproject.toml setup that resolves ARM64 wheels for NVDA's dependencies — which otherwise works today once this and two related build-script issues are fixed (see linked issues).

What technical changes are required?

Exclude the ARM64EC case from the arm64 branch of isNVDACoreArch:

isNVDACoreArch = (
    (PYTHON_PLATFORM == "win32" and TARGET_ARCH == "x86")
    or (PYTHON_PLATFORM == "win-amd64" and TARGET_ARCH == "x86_64")
    or (PYTHON_PLATFORM == "win-arm64" and TARGET_ARCH == "arm64" and not isArm64EC)
)

This mirrors the existing isArm64EC flag already used elsewhere in the same file (e.g. for isNVDAHelperLocalArch and MIDL/CCFLAGS branches).

Are the proposed technical changes API breaking?

No.

Are there potential risks or issues with the proposed implementation?

Low risk — this only changes behavior for the previously-unreachable PYTHON_PLATFORM == "win-arm64" branch. x86/x64 builds (the only configurations NVDA currently ships) are unaffected, since neither of their isNVDACoreArch conditions involve isArm64EC.

I have a working fix and can open a PR once this issue is triaged, as part of getting a native ARM64 Python build of NVDA building from source end to end.


Investigated and drafted with AI assistance (Claude); I reviewed the technical content and built/tested the fix myself before filing this.

Dominant language
Python
Stars
2.7k
Forks
842
Avg merge
2d 4h
Merged PRs (30d)
56

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nvaccess/nvda

All issues in nvaccess/nvda

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.