Ultimaker / cura-build-environment

CMake project to build dependencies for Cura
GNU Affero General Public License v3.0
24 stars 55 forks source link

Latest cbe docker image contains outdated Python #122

Open sunheat opened 2 years ago

sunheat commented 2 years ago
CMake Error at C:/Program Files/CMake/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Python3: Found unsuitable version "3.8.10", but required is
  exact version "3.10" (found C:/cura-build-environment/bin/python.exe, found
  components: Interpreter)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.21/Modules/FindPython/Support.cmake:3166 (find_package_handle_standard_args)
  C:/Program Files/CMake/share/cmake-3.21/Modules/FindPython3.cmake:485 (include)
  CMakeLists.txt:15 (find_package)

when trying to build using the Windows docker. Image name is ultimaker/cura-build-environment. Is there a newer image which should be used?

sunheat commented 2 years ago

Hi team, I kind of sort of found a possible cause. It is because I have using the defaults in build.ps1 and the default is to build from the master branch:

# Branch parameters
  [string]$CuraBranchOrTag = "master",
  [string]$UraniumBranchOrTag = "master",
  [string]$CuraEngineBranchOrTag = "master",
  [string]$CuraBinaryDataBranchOrTag = "master",
  [string]$FdmMaterialsBranchOrTag = "master",
  [string]$LibCharonBranchOrTag = "master",

But when I changed "master" to a tag such as "4.13.0" the build fails. I had a look in git show-ref and it would appear that in the remote repo (https://github.com/Ultimaker/Cura) the valid refspec is the branch 4.13, and no tag is a valid refspec which is what the build scripts look for. How do I build from tags using build.ps1 script under docker\windows in cura-build? I've tried "4.13.0" and "tags/4.13.0" with no luck.

sunheat commented 2 years ago

BTW I have tried using "4.12" in the branch parameters but with the latest cbe windows docker it still failed with the same error of Python version too low as in the first comment.

sunheat commented 2 years ago

Problem seems to be in libCharon.cmake under projects. It specifies the version 3.10:

CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNALPROJECT_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCURA_PYTHON_VERSION=3.10

And in CMakeList.txt in generated build folder:

find_package(Python3 ${CURA_PYTHON_VERSION} EXACT REQUIRED COMPONENTS Interpreter)
Ghostkeeper commented 2 years ago

Note that those are from cura-build, not this repository cura-build-environment.

ultimaker/cura-build-environment:win1809-master is the image to use for Windows. It's what Ultimaker uses on their build server, too.

It should be able to checkout the branches of 4.13 of Cura, Uranium, etc. However note that in Master we have updated to Python 3.10 and in Cura 4.13 we were still on Python 3.8. These are incompatible, so you won't get a working build. To rebuild Cura 4.13, you need to use the 4.13.0 tag here and use the docker image from back then.