fatal error C1090: PDB API call failed, error code '3'

Is anyone else seeing this while building on Windows? I have no problems building other (cmake, C++) projects, but cmake on Audacity gives up the ghost immediately:

M:\gh\aud-build-master>cmake -G "Visual Studio 16 2019" -A x64  -Daudacity_has_asio_support=On -B ..\aud-build -S .
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19043.
-- The C compiler identification is MSVC 19.29.30138.0
-- The CXX compiler identification is MSVC 19.29.30138.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/CMakeTestCCompiler.cmake:66 (message):
  The C compiler

    "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: M:/gh/aud-build/CMakeFiles/CMakeTmp

    Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/MSBuild.exe cmTC_50024.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=16.0 /v:m && Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
    Copyright (C) Microsoft Corporation. All rights reserved.

      Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30138 for x64
      Copyright (C) Microsoft Corporation.  All rights reserved.
      testCCompiler.c
      cl /c /Zi /W1 /WX- /diagnostics:column /Od /Ob0 /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_50024.dir\Debug\\" /Fd"cmTC_50024.dir\Debug\vc142.pdb" /external:W1 /Gd /TC /errorReport:queue "M:\gh\aud-build\CMakeFiles\CMakeTmp\testCCompiler.c"
    M:\gh\aud-build\CMakeFiles\CMakeTmp\testCCompiler.c : fatal error C1090: PDB API call failed, error code '3': M:\gh\aud-build\CMakeFiles\CMakeTmp\cmTC_50024.dir\Debug\vc142.pdb [M:\gh\aud-build\CMakeFiles\CMakeTmp\cmTC_50024.vcxproj]





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:140 (project)


-- Configuring incomplete, errors occurred!
See also "M:/gh/aud-build/CMakeFiles/CMakeOutput.log".
See also "M:/gh/aud-build/CMakeFiles/CMakeError.log".

For now I got around that by not making a debug build (so by passing passed -DAUDACITY_BUILD_LEVEL=2), since the error was something about pdb file, although I’m going to need that debug build at some point. (It’s apparently some kind of cmake bug. https://gitlab.kitware.com/cmake/cmake/-/issues/22476)

By the way, the instructions to install conan through pip were not the best for Windows, because the exe for conan didn’t get added to path when installed that way. It got dumped somewhere in \AppData\Roaming\Python\Python39\Scripts. But after adding that to the path, it made a lot more progress, only to die at

ERROR: expat/2.2.9@audacity/stable: Error in source() method, line 36
        os.rename(extracted_dir, self._source_subfolder)
        PermissionError: [WinError 5] Access is denied: 'expat-2.2.9' -> 'source_subfolder'
CMake Error at cmake-proxies/cmake-modules/conan.cmake:638 (message):
  Conan install failed='1'
Call Stack (most recent call first):
  cmake-proxies/cmake-modules/AudacityDependencies.cmake:255 (conan_cmake_install)
  cmake-proxies/cmake-modules/AudacityDependencies.cmake:274 (_conan_install)
  CMakeLists.txt:554 (resolve_conan_dependencies)


-- Configuring incomplete, errors occurred!
See also "M:/gh/aud-build/CMakeFiles/CMakeOutput.log".
See also "M:/gh/aud-build/CMakeFiles/CMakeError.log".

I’m guessing it’s expecting one would run the build as admin, which I normally don’t do (for security reasons).

See this post: https://forum.audacityteam.org/t/visual-studio-2019-16-8-3-has-a-bug-open-cmake-unknown-error/60836/1