I ended up succesfully doing so. Just follow the MSVC build docs and prepare for a lot of time as packages are installed. And i mean a LOT.
Be sure to have no python path in the CMake commands (-Dxxxxxx).
I ended up succesfully doing so. Just follow the MSVC build docs and prepare for a lot of time as packages are installed. And i mean a LOT.
Be sure to have no python path in the CMake commands (-Dxxxxxx).
Ensure your kicad is at the latest head and not behind by a day or two.
Delete the cmake cache and reconfigure. This is different from a plain reconfigure. You can do this manually by just deleting the build/x64-Release or build/x64-Debug folder.
All repos are up to date.
No python paths anywhere, either. I got rid of the old CMakeSettings.json and used the template for a new one to get rid of any cruft.
Visual Studio suggested ādelete cache and reconfigureā by itself, but even deleting the build (sub)folders manually and letting VS (re)configure afterwards didnāt change anything, repeated cache deletion and reconfigure runs are still failing with the same error.
Starting from scratch and following the official instructions didnāt help, vcpkg install is still failing for wxpython when running ensurepip with the system-wide python install (which is included in PATH because other tools need to run it).
Thatās the issue. Donāt include python on system PATH, provide it to whatever tools need it on case by case basis.
Python just doesnāt handle this situation well.
It shouldnāt matter if python is on PATH or notā¦as I fixed it or it should be fixed now as of 3 days ago. I canāt reproduce any more conflicts
I believe the issue is wxpython not building, not kicad build failing. Did you patch wxpython in any way too?
wxpython is majorly under my control, i.e. I wrote a custom build process in cmake because the official wxpython build uses the deprecated and always broken python build tools
So yes, it should only be picking up the vcpkg python. Infact, vcpkg itself patches FindPython inside itās environment to pickup the vcpkg python when Development is specified as the find component which it is.
Can you give me some pointers for debugging? I havenāt seen much detail in the logs on how it found the wrong python installation.
vcpkg\buildtrees\wxpython\config-x64-windows-out.log
has the correct one:
-- Found Python3: C:/Users/.../vcpkg/installed/x64-windows/tools/python3/python.exe (found version "3.9.10") found components: Interpreter Development Development.Module Development.Embed
vcpkg\buildtrees\wxpython\stdout-x64-windows.log
is the one place with the system-wide path:
-- Found Python3: C:/Program Files/Python310/python.exe (found version "3.10.4") found components: Interpreter
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:158 (message):
Command failed: "C:/Program Files/Python310/python.exe" -m ensurepip
Any other path in this file is inside the vcpkg tree.
I see the problem
good news: cmake doesnāt find the system python.
bad news: cmake doesnāt find the vcpkg python either.
same as above: config is fine, stdout not:
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Python3 (missing: Python3_INCLUDE_DIRS Python3_LIBRARIES
Development Development.Module Development.Embed) (found version "3.10.4")
Yea Iāll fix it
Ok now itās fixed
looks good so far, wxpython is building now. both my old setup and the one started from scratch are working again, at least for building kicad.
Thanks!
Running kicad from Visual Studio is still (partly) broken because of some python related issues (starting pcbnew fails due to some pybind errors for the old setup - which broke a while ago, possibly by installing python). Iāll have to investigate that later.
Use the updated launch.vs.json provided in the instructions and then launch the non-install targets for debug.
Otherwise you should have zero pybind errors.
I have none, I have reproduced the setup on multiple machines and nobody else is reporting it.
Iām getting an error starting pcbnew as well. pcbnew runs ok though after you ācontinueā in the debugger. Btw, this is the non-install build.
The file is āeval.hā
yes, I copied the sample launch.vs.json verbatim and launched the non-install targets, but I got the same error.
Turns out, PYTHONPATH references a nonexisting folder: ā¦kicad\build\install\x64-Debug\pcbnew
(and kicad\scripting
, which does exist, obviously)
Changing the launch configuration from
"PYTHONPATH": "${cmake.installRoot}\\pcbnew;${projectDir}\\scripting",
to
"PYTHONPATH": "${cmake.buildRoot}\\pcbnew;${projectDir}\\scripting",
does help.
btw: the same error occurred with the new setup built from scratch by following the instructions exactly.
Confirmed, works. Thx.
@marekr FYI, new errors after your recent commits:
Starting pcbnew:
after ācancelā:
Keeps coming back on āokā, app has to be stopped in debugger.
Starting eeschema:
after ācancelā: