<div dir="ltr">I've figured out some of the <i>what</i> but I still don't understand the <i>why</i>.<div><br></div><div>I checked the Windows registry, and found some remnants referencing Python 3.6.  I doubt that's related, but I obliterated them anyway.</div><div><br></div><div>I scrutinized the very noisy output of Cmake and discovered two things:</div><div><br></div><div>1.  Cmake found my Python 3.8, right where it should be, then it said, "Could NOT find Python3 (missing: Development)".  I'm not sure why it didn't think that version has the development files--it does.</div><div>2.  Next, Cmake found Python 3.7 buried in the Visual Studio 2019 installation tree.  (I keep forgetting that VS smuggles other software onto the machine.)  I have no idea HOW Cmake found this version.  It's not anywhere in the PATH.  It's not referenced by any other environment variables.  If it's referenced from the Windows registry, I couldn't find it.  It's just magic, I guess.</div><div><br></div><div>So I spun up the Visual Studio Installer and removed every package that mentioned Python.  I then trashed my build tree and started again.</div><div><br></div><div>This time, Cmake selected my Python 3.8 tree, apparently satisfied that it does indeed have the development files.  (Why does the presence of an unreferenced Python 3.7 cause Cmake to think the easy-to-find 3.8 installation doesn't have development files???  Sounds like a Cmake bug to me.)</div><div><br></div><div>So, for the moment, I have a working build again.</div><div><br></div><div>It's interesting to note that, in the four or five times since last fall that I've been bit by the wrong-version-of-Python-while-building-LLDB bug, the "solution" has been different.  I wonder what it'll be next time.</div><div><br></div><div>Thanks to the folks who sent me advice off-list.</div><div><br></div><div>Adrian.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 3, 2020 at 1:42 PM Adrian McCarthy <<a href="mailto:amccarth@google.com">amccarth@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">After rebasing, my local LLDB builds have again broken because it goes looking for the wrong Python DLL.  I'm searching through git logs, but I'm not seeing a related change.<div><br></div><div>Does anyone know what causes CMake to get confused about which Python versions are installed?<div><br></div><div><font face="monospace" size="1">LINK : fatal error LNK1104: <b>cannot open file 'python37_d.lib'</b></font><br></div><div><font face="monospace" size="1"><br></font></div>Why is it looking for 3.7?  My CMake command uses every hint I know about to ensure that it finds Python 3.8:<div><br></div><div><font size="1" face="monospace">cmake -GNinja -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON -DCMAKE_BUILD_TYPE=Debug -DLLDB_TEST_DEBUG_TEST_CRASHES=1 -DPYTHON_HOME="C:\Program Files\Python<b>38</b>" -DLLDB_PYTHON_HOME="C:\Program Files\Python<b>38</b>" -DPython3_ROOT_DIR="C:\Program Files\Python<b>38</b>" -DPython3_FIND_REGISTRY=LAST -DLLDB_TEST_COMPILER=D:\src\llvm\build\ninja_dbg\bin\clang.exe ..\..\llvm-project\llvm -DLLVM_ENABLE_ZLIB=OFF -DLLVM_ENABLE_PROJECTS="clang;lld;lldb;clang-tools-extra;compiler-rt"</font><br></div><div><br></div><div>My environment doesn't reference any other version of Python:</div><div><br></div><div><font size="1" face="monospace">D:\src\llvm\llvm-project>set | find /I "python"<br>Path=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.24.28314\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\corpam;C:\Windows\ccmsetup;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;D:\src\util\GnuWin32\bin;C:\Program Files\doxygen\bin;C:\Program Files\Notepad++;D:\src\llvm\build\ninja_dbg\bin;D:\src\llvm\llvm-project\clang\tools\clang-format;C:\Program Files\Python38;D:\src\llvm\llvm-project\llvm\utils\git-svn\;D:\src\util;D:\src\util\swigwin-3.0.12;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja<br>__VSCMD_PREINIT_PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\corpam;C:\Windows\ccmsetup;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;D:\src\util\GnuWin32\bin;C:\Program Files\doxygen\bin;C:\Program Files\Notepad++;D:\src\llvm\build\ninja_dbg\bin;D:\src\llvm\llvm-project\clang\tools\clang-format;<b>C:\Program Files\Python38</b>;D:\src\llvm\llvm-project\llvm\utils\git-svn\;D:\src\util;D:\src\util\swigwin-3.0.12</font><font face="monospace"><br></font></div><div><font size="1" face="monospace"><br></font></div><div><font face="monospace">D:\src\llvm\llvm-project>where python<br>C:\Program Files\Python38\python.exe<font size="1"><br></font></font></div><div><font face="monospace"><br></font></div><div><font face="monospace">D:\src\llvm\build\ninja_dbg>which python<br>/c/Program Files/Python38/python<br></font></div><div><font face="monospace"><br></font></div>I do not have 3.7 on my machine.  For a long while now, I've had to keep exactly one version of Python on my machine specifically to prevent LLDB builds from trying to mix versions.</div><div><br></div><div>But I'm stumped once again.<br><div><br></div><div>Clues appreciated,</div><div>Adrian.<br><div><font size="1" face="monospace"><br></font></div></div></div></div>
</blockquote></div>