Prerequisites
Before building NVDA, ensure you have:- Completed the development environment setup
- Cloned the NVDA repository with submodules
- Installed Python 3.13.12, Visual Studio 2022/2026, and uv
All build commands should be run from the root directory of the NVDA repository in a command prompt or PowerShell.
Preparing the Source Tree
Before running NVDA or creating builds, you must prepare the source tree:- Compiles C++ components (nvdaHelper)
- Generates COM interfaces
- Processes dependencies
- Sets up the development environment
When to Rebuild
Runscons source again whenever:
- The version of comtypes changes
- Language files are added or changed
- Git submodules are updated
- C++ code in nvdaHelper is modified
Including User Documentation
To access user documentation from the Help menu while running from source:Build Performance Optimization
Speed up builds by using multiple CPU cores:Using Specific Core Count
4 with the number of cores you want to use.
Using All Available Cores
Building across multiple cores can cause scrambled output and occasionally build errors.
Troubleshooting Build Errors
If you experience errors with multi-threaded builds, force a serial build:Running the Source Code
After preparing the source tree, launch NVDA directly from source:Command Line Options
View all available options:Making Binary Builds
Binary builds can run on systems without Python or NVDA’s development dependencies. These are used for snapshots and releases.Non-Archived Binary Build
Create a portable build without archiving:dist/ directory.
This is equivalent to an extracted portable archive and useful for testing the full distribution without creating installer packages.
Building the Installer
Create a launcher archive (one executable that allows installation or portable distribution):output/ directory.
File naming:
- Release builds:
nvda_<version>.exe - Snapshot builds:
nvda_snapshot_<version>.exe
Additional Build Targets
Debug Symbols Archive
Generate an archive of debug symbols for DLL/EXE binaries:output/nvda_<version>_debugSymbols.zip
Debug symbols are essential for analyzing crash dumps and debugging release builds.
Translation Template
Generate a gettext translation template for translators:output/nvda.pot
Controller Client
Build the controller client library:output/nvda_<version>_controllerClient.zip
Developer Documentation
Generate developer documentation (requires Doxygen):Customizing Builds
Build behavior can be customized using command-line variables:Available Build Variables
The version of this build
A unique number for this build
Whether this is a release versionEnables:
- C++ compiler optimizations (/O2)
- Whole-program optimization
- Optimized Python bytecode
The publisher of this build
Certificate file for code signing (PFX format with private key)
Password for the signing certificate’s private key
URL of the timestamping server for authenticode signatures
Directory where final built archives are placed
Example: Custom Version Build
nvda_snapshot_test1.exe in the output/ directory.
Example: Signed Release Build
Build Targets Summary
source
Prepare source tree for development
dist
Create non-archived binary build
launcher
Build installer executable
symbolsArchive
Generate debug symbols archive
pot
Create translation template
client
Build controller client
Build System Details
SCons Build System
NVDA uses SCons version 4.10.1 as its build system. SCons is a Python-based build tool similar to Make. Key SCons files:sconstruct- Main build configuration (720 lines)*/sconscript- Module-specific build scripts
Build Architectures
NVDA builds components for multiple architectures:- x86 (32-bit) - Legacy Windows support
- x86_64 (64-bit) - Primary Windows architecture
- ARM64 - Native ARM Windows support
- ARM64EC - ARM64 with x64 emulation compatibility
Python Virtual Environment
The build system automatically creates and manages a Python virtual environment:SCons must be executed through
scons.bat from the repository root. Running SCons directly from outside the virtual environment will fail.Advanced Build Configuration
nvdaHelper Debug Flags
For C++ component debugging:debugCRT- Use debug C runtimeRTC- Runtime checksanalyze- Static analysis
nvdaHelper Log Level
Control logging verbosity (0-59, lower is more verbose):Cleaning Builds
Remove built files:Troubleshooting
Build fails with 'SCons was started outside virtual environment'
Build fails with 'SCons was started outside virtual environment'
Always use
scons.bat from the repository root, not the system-wide SCons command:Multi-threaded build produces errors
Multi-threaded build produces errors
Force single-threaded build:
Comtypes changes not reflected
Comtypes changes not reflected
Rebuild the source tree:
Missing Visual Studio components
Missing Visual Studio components
Verify all required components are installed:Should show paths to Visual Studio 2022 or 2026 build tools.
Code signing fails
Code signing fails
Ensure:
- Certificate file exists and is in PFX format
- Certificate password is correct
- Timestamp server is accessible
- Certificate is valid for code signing
Next Steps
Running from Source
Learn how to run and test NVDA from source
Development Overview
Understand NVDA’s architecture and development workflow
Additional Resources
For more details, see:sconstruct(line 1-720 in/home/daytona/workspace/source/sconstruct)projectDocs/dev/buildingNVDA.mdin the source tree
