Hello,

Fixed this issue by correcting the patch for toolsetup.bat.

Here's the correct patch:

--- C://toolsetup-f25d437f.003.bat    Tue Jan 13 19:06:06 2026
+++ C:/edk/edk2/BaseTools/toolsetup.bat    Tue Jan 13 18:59:08 2026
@@ -249,18 +249,20 @@
     ) else (
       set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32
     )
-    if not defined FORCE_REBUILD (
-      if not defined REBUILD (
-        if not exist "%EDK_TOOLS_BIN%" (
-          echo.
-          echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!
-          echo Please check the directory %EDK_TOOLS_BIN%
-          echo Or configure EDK_TOOLS_BIN env to point to Bin directory.
-          echo.
-        )
-      )
-    )
-  )
+    )
+
+    if not defined FORCE_REBUILD (
+        if not defined REBUILD (
+            if not exist "%EDK_TOOLS_BIN%" (
+                echo.
+                echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!
+                echo Please check the directory %EDK_TOOLS_BIN%
+                echo Or configure EDK_TOOLS_BIN env to point to Bin directory.
+                echo.
+            )
+        )
+    )
+
   set PATH=%EDK_TOOLS_BIN%;%PATH%
   set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%
   goto PATH_ok
^-----------------------------------------------------------------------------^

For what it's worth, I also updated by prep.bat to include phyton 3.
Not sure if it is needed.

set WORKSPACE=%CD%
set PACKAGES_PATH=%WORKSPACE%\edk2-libc;%WORKSPACE%\edk2
set EDK_TOOLS_PATH=%WORKSPACE%\edk2\BaseTools

cd %WORKSPACE%\edk2

set NASM_PREFIX=C:\pcpgmr\asm\nasm\win32\216\
set PYTHON_HOME=C:\Users\me\AppData\Local\Programs\Python\Python39
set PYTHON3_ENABLE=TRUE

edksetup.bat %1 %2 %3 %4 %5 %6


On Tue, Jan 13, 2026 at 2:10 AM David F. <[email protected]> wrote:
>
> Hello,
>
> I've been using the EDK2 for a long time as was still using VS2008 tool set.
>
> I decided to start fresh to move to vs2022 - I cloned fresh new
> directories (and found out I had to also get submodules).   Ran the
> "edksetup.bat Rebuild VS2022".  I found that toolsetup.bat has a bug -
> I'll put the patch at the bottom below.
>
> So now it came time to build one of my UEFI applications.  I renamed
> the C:\edk\Build directory to get a fresh build.  I start it:  "call
> build -a X64 -y release_report.txt -p acme\superapp.dsc -b RELEASE"
> but when it starts the build I get:
>
> Traceback (most recent call last):
>   File "C:\edk\edk2\BaseTools\Source\Python\build\build.py", line
> 2588, in <module>
>     LogQMaxSize = ThreadNum() * 10
>   File "C:\edk\edk2\BaseTools\Source\Python\build\build.py", line
> 2567, in ThreadNum
>     ThreadNumber =
> TargetObj.Target.TargetTxtDictionary[TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER]
>   File "C:\edk\edk2\BaseTools\Source\Python\Common\TargetTxtClassObject.py",
> line 163, in Target
>     self._GetTarget()
>   File "C:\edk\edk2\BaseTools\Source\Python\Common\TargetTxtClassObject.py",
> line 182, in _GetTarget
>     ConfDirectoryPath = mws.join(os.environ["WORKSPACE"], 'Conf')
>   File "C:\edk\edk2\BaseTools\Source\Python\Common\MultipleWorkspace.py",
> line 70, in join
>     for Pkg in cls.PACKAGES_PATH:
> TypeError: 'NoneType' object is not iterable
>
> Could someone point out what I need to do to fix it?
>
> Here's that patch I mentioned above:
>
>
> --- C:/toolsetup-f25d437f.001.bat    Tue Jan 13 02:02:15 2026
> +++ C:/edk/edk2/BaseTools/toolsetup.bat    Mon Jan 12 22:13:07 2026
> @@ -15,6 +15,8 @@
>  set PYTHON_VER_MAJOR=3
>  set PYTHON_VER_MINOR=6
>
> +setlocal EnableDelayedExpansion
> +
>  @REM ##############################################################
>  @REM # You should not have to modify anything below this line
>  @REM #
> @@ -251,7 +253,7 @@
>      )
>      if not defined FORCE_REBUILD (
>        if not defined REBUILD (
> -        if not exist "%EDK_TOOLS_BIN%" (
> +        if not exist "!EDK_TOOLS_BIN!" (
>            echo.
>            echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!
>            echo Please check the directory %EDK_TOOLS_BIN%


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121754): https://edk2.groups.io/g/devel/message/121754
Mute This Topic: https://groups.io/mt/117240892/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to