diff --git a/appveyor/scripts/setSconsArgs.ps1 b/appveyor/scripts/setSconsArgs.ps1 index 9c4dd3eca7b..397abeb1761 100644 --- a/appveyor/scripts/setSconsArgs.ps1 +++ b/appveyor/scripts/setSconsArgs.ps1 @@ -15,6 +15,8 @@ if(!$env:APPVEYOR_PULL_REQUEST_NUMBER) { $sconsArgs += " certFile=appveyor\authenticode.pfx certTimestampServer=http://timestamp.digicert.com" } $sconsArgs += " version_build=$env:APPVEYOR_BUILD_NUMBER" +# Use only 1 concurrent job when building +$sconsArgs += " -j1" # We use cmd to run scons because PowerShell throws exceptions if warnings get dumped to stderr. # It's possible to work around this, but the workarounds have annoying side effects. Set-AppveyorBuildVariable "sconsOutTargets" $sconsOutTargets diff --git a/sconstruct b/sconstruct index 634576820b9..9fbce6da25a 100755 --- a/sconstruct +++ b/sconstruct @@ -7,6 +7,7 @@ import sys import os import platform +import multiprocessing # Ensure we are inside the Python virtual environment. nvdaVenv = os.getenv("NVDA_VENV") @@ -121,9 +122,14 @@ env = Environment(variables=vars,HOST_ARCH='x86',tools=[ "recursiveInstall" ]) -# speed up subsiquent runs by checking timestamps of targets and dependencies, and only using md5 if timestamps differ. +# speed up subsequent runs by checking timestamps of targets and dependencies, and only using md5 if timestamps differ. env.Decider('MD5-timestamp') +# Make sure to run the build on multiple threads so it runs faster +env.SetOption('num_jobs', multiprocessing.cpu_count()) +realNumJobs = env.GetOption('num_jobs') +print(f"Building using {realNumJobs} job{'s' if realNumJobs != 1 else ''}") + #Make our recursiveCopy function available to any script using this environment env.AddMethod(recursiveCopy) diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index e0ebe69e087..1617cb567f3 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -92,6 +92,8 @@ This ensures code will honor the Windows user setting for swapping the primary m - ``LOCALE_SLANGUAGE``, ``LOCALE_SLIST`` and ``LOCALE_SLANGDISPLAYNAME`` are removed from ``languageHandler`` - use members of ``languageHandler.LOCALE`` instead. (#12753) - Switched from Minhook to Microsoft Detours as a hooking library for NVDA. Hooking with this library is mainly used to aid the display model. (#12964) - ``winVersion.WIN10_RELEASE_NAME_TO_BUILDS`` is removed. (#13211) +- SCons now builds with multiple concurrent jobs, equal to the number of logical processors in the system. +This can dramatically decrease build times on multi core systems. (#13226) -