Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpython: avoid invalid configurations #25500

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

valgur
Copy link
Contributor

@valgur valgur commented Oct 3, 2024

Summary

Changes to recipe: cpython/[*]

Motivation

The cpython recipe is currently marked as invalid on

  • macOS x86_64 due to tk and ncurses not supporting cross-building.
    tk/8.6.10: Invalid: The tk conan recipe does not currently support Macos cross-builds. A contribution to add this functionality would be welcome.
    ncurses/6.4: Invalid: Cross building to/from arm is (currently) not supported
  • cpython/*:shared=False on MSVC for v3.10 and greater due to build errors.
    cpython/3.12.7: Invalid ID: Static msvc build disabled (>=3.10) due to "AttributeError: module 'sys' has no attribute 'winver'"

Both of these are avoidable.

This affects the build of these configurations for nanobind, for example: #20297 (comment)

/cc @Ahajha

Details


@conan-center-bot

This comment has been minimized.

@Ahajha
Copy link
Contributor

Ahajha commented Oct 4, 2024

I like the goal here. There's another invalid config, relating to mpdecimal on Windows/shared. The cxx option is enabled by default, but is incompatible with the shared option on Windows, so the Windows/all shared build is invalid. So probably want to also just disable the cxx option, at least on Windows.

Fixing the issues that come up from these might not be trivial, but I can take a look if I have some spare time. It might not be a bad idea to split this into a few PRs if it gets difficult.

# Static CPython on Windows is only loosely supported, see https://github.com/python/cpython/issues/110234
# 3.10 fails during the test, 3.11 fails during the build (missing symbol that seems to be DLL specific: PyWin_DLLhModule)
# Disabling static MSVC builds (>=3.10) due to "AttributeError: module 'sys' has no attribute 'winver'"
self.package_type = "static-library"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be shared-library?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely. Thanks!

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ❌

Warning

Conan Center will stop receiving updates for Conan 1.x packages soon - please see announcement.

Failure in build 2 (783662d82e196a7ec8825b461937615ed98e769e):

  • cpython/3.12.2:
    CI failed to create some packages (All logs)

    Logs for packageID 451718e84cd9d74d2f16bcb2e39f52a6f0d5e1a3:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=5
    os=Linux
    [options]
    cpython:shared=True
    
    [...]
    -- Conan: Adjusting language standard
    -- This project seems to be plain C, using 'GNU' compiler
    -- Conan: Compiler GCC>=5, checking major version 5
    -- Conan: Checking correct version: 5
    -- Conan: C++ stdlib: libstdc++11
    -- Found PythonInterp: /home/conan/workspace/prod-v1/bsr/106344/ccfda/.conan/data/cpython/3.12.2/_/_/package/451718e84cd9d74d2f16bcb2e39f52a6f0d5e1a3/bin/python3.12 (found version "3.12.2")
    -- Found PythonLibs: /home/conan/workspace/prod-v1/bsr/106344/ccfda/.conan/data/cpython/3.12.2/_/_/package/451718e84cd9d74d2f16bcb2e39f52a6f0d5e1a3/lib/libpython3.12.a (found version "3.12.2")
    -- FindPythonInterp:
    -- PYTHON_VERSION_STRING: 3.12.2
    -- PYTHON_VERSION_MAJOR: 3
    -- PYTHON_VERSION_MINOR: 12
    -- PYTHON_VERSION_PATCH: 2
    -- =============================================
    -- FindPythonLibs:
    -- PYTHON_LIBRARIES: /home/conan/workspace/prod-v1/bsr/106344/ccfda/.conan/data/cpython/3.12.2/_/_/package/451718e84cd9d74d2f16bcb2e39f52a6f0d5e1a3/lib/libpython3.12.a
    -- PYTHON_INCLUDE_PATH: /home/conan/workspace/prod-v1/bsr/106344/ccfda/.conan/data/cpython/3.12.2/_/_/package/451718e84cd9d74d2f16bcb2e39f52a6f0d5e1a3/include/python3.12 (deprecated)
    -- PYTHON_INCLUDE_DIRS: /home/conan/workspace/prod-v1/bsr/106344/ccfda/.conan/data/cpython/3.12.2/_/_/package/451718e84cd9d74d2f16bcb2e39f52a6f0d5e1a3/include/python3.12
    -- PYTHON_DEBUG_LIBRARIES:  (deprecated)
    -- PYTHONLIBS_VERSION_STRING: 3.12.2
    -- Configuring incomplete, errors occurred!
    Using Python_ADDITIONAL_VERSIONS: 3.12.2;3.12;3;3.12.2;3.12;3
    CMake Error at /home/conan/workspace/prod-v1/bsr/106344/ccfda/.conan/data/cmake/3.30.1/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
      Could NOT find Python3 (missing: Python3_LIBRARIES Development
      Development.Embed) (found version "3.12.2")
    Call Stack (most recent call first):
      /home/conan/workspace/prod-v1/bsr/106344/ccfda/.conan/data/cmake/3.30.1/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
      /home/conan/workspace/prod-v1/bsr/106344/ccfda/.conan/data/cmake/3.30.1/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/share/cmake-3.30/Modules/FindPython/Support.cmake:3984 (find_package_handle_standard_args)
      /home/conan/workspace/prod-v1/bsr/106344/ccfda/.conan/data/cmake/3.30.1/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/share/cmake-3.30/Modules/FindPython3.cmake:596 (include)
      CMakeLists.txt:80 (find_package)
    
    
    WARN: **************************************************
    WARN: *** Conan 1 is legacy and on a deprecation path **
    WARN: *********** Please upgrade to Conan 2 ************
    WARN: **************************************************
    WARN: openssl/3.3.2: requirement zlib/[>=1.2.11 <2] overridden by cpython/3.12.2 to zlib/1.3.1 
    WARN: tcl/8.6.10: requirement zlib/[>=1.2.11 <2] overridden by tk/8.6.10 to zlib/1.3.1 
    WARN: fontconfig/2.13.93: requirement expat/[>=2.6.2 <3] overridden by tk/8.6.10 to expat/2.6.3 
    WARN: freetype/2.13.2: requirement zlib/[>=1.2.10 <2] overridden by fontconfig/2.13.93 to zlib/1.3.1 
    WARN: libpng/1.6.44: requirement zlib/[>=1.2.11 <2] overridden by freetype/2.13.2 to zlib/1.3.1 
    cpython/3.12.2 (test package): WARN: 
         ************************************************
         The 'cmake' generator is deprecated.
         Please update your code and remove it.
         *************************************************
    
    cpython/3.12.2 (test package): WARN: **** The 'from conans import CMake' helper is deprecated. Please update your code and remove it. ****
    ERROR: cpython/3.12.2 (test package): Error in build() method, line 69
    	cmake.configure()
    	ConanException: Error 1 while executing cd '/home/conan/workspace/prod-v1/bsr/cci-c77bba71/recipes/cpython/all/test_v1_package/build/b35e4350eea385efec098ee946833071b40a57f8' && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCONAN_IN_LOCAL_CACHE="OFF" -DCONAN_COMPILER="gcc" -DCONAN_COMPILER_VERSION="5" -DCONAN_CXX_FLAGS="-m64" -DCONAN_SHARED_LINKER_FLAGS="-m64" -DCONAN_C_FLAGS="-m64" -DCONAN_LIBCXX="libstdc++11" -DCMAKE_INSTALL_PREFIX="/home/conan/workspace/prod-v1/bsr/cci-c77bba71/recipes/cpython/all/test_v1_package/build/b35e4350eea385efec098ee946833071b40a57f8/package" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DCONAN_EXPORTED="1" -DBUILD_MODULE="True" -DPY_VERSION_MAJOR_MINOR="3.12" -DPY_FULL_VERSION="3.12.2" -DPY_VERSION="3.12.2" -DPY_VERSION_SUFFIX="" -DPYTHON_EXECUTABLE="/home/conan/workspace/prod-v1/bsr/106344/ccfda/.conan/data/cpython/3.12.2/_/_/package/451718e84cd9d74d2f16bcb2e39f52a6f0d5e1a3/bin/python3.12" -DUSE_FINDPYTHON_X="True" -DPython3_EXECUTABLE="/home/conan/workspace/prod-v1/bsr/106344/ccfda/.conan/data/cpython/3.12.2/_/_/package/451718e84cd9d74d2f16bcb2e39f52a6f0d5e1a3/bin/python3.12" -DPython3_ROOT_DIR="/home/conan/workspace/prod-v1/bsr/106344/ccfda/.conan/data/cpython/3.12.2/_/_/package/451718e84cd9d74d2f16bcb2e39f52a6f0d5e1a3" -DPython3_USE_STATIC_LIBS="False" -DPython3_FIND_FRAMEWORK="NEVER" -DPython3_FIND_REGISTRY="NEVER" -DPython3_FIND_IMPLEMENTATIONS="CPython" -DPython3_FIND_STRATEGY="LOCATION" -Wno-dev '/home/conan/workspace/prod-v1/bsr/cci-c77bba71/recipes/cpython/all/test_v1_package'
    
  • cpython/3.9.19:
    Didn't run or was cancelled before finishing

  • cpython/3.12.7:
    Didn't run or was cancelled before finishing

  • cpython/3.11.9:
    Didn't run or was cancelled before finishing

  • cpython/3.10.14:
    Didn't run or was cancelled before finishing

  • cpython/3.8.19:
    Didn't run or was cancelled before finishing


Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.


Conan v2 pipeline ❌

Note: Conan v2 builds are now mandatory. Please read our discussion about it.

The v2 pipeline failed. Please, review the errors and note this is required for pull requests to be merged. In case this recipe is still not ported to Conan 2.x, please, ping @conan-io/barbarians on the PR and we will help you.

Failure in build 2 (783662d82e196a7ec8825b461937615ed98e769e):

  • cpython/3.12.2:
    Didn't run or was cancelled before finishing

  • cpython/3.12.7:
    CI failed to create some packages (All logs)

    Logs for packageID 16a2174902a9bbd88e19d7a2baff4a7af1bbdb23:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=gcc
    compiler.cppstd=17
    compiler.libcxx=libstdc++11
    compiler.version=11
    os=Linux
    [options]
    */*:shared=False
    
    [...]
    -- Conan: Component target declared 'xorg::xcb-xfixes'
    -- Conan: Component target declared 'xorg::xcb-xinerama'
    -- Conan: Component target declared 'xorg::xcb'
    -- Conan: Component target declared 'xorg::xcb-atom'
    -- Conan: Component target declared 'xorg::xcb-aux'
    -- Conan: Component target declared 'xorg::xcb-event'
    -- Conan: Component target declared 'xorg::xcb-util'
    -- Conan: Component target declared 'xorg::xcb-dri3'
    -- Conan: Component target declared 'xorg::xcb-cursor'
    -- Conan: Component target declared 'xorg::xcb-dri2'
    -- Conan: Component target declared 'xorg::xcb-glx'
    -- Conan: Component target declared 'xorg::xcb-present'
    -- Conan: Component target declared 'xorg::xcb-composite'
    -- Conan: Component target declared 'xorg::xcb-ewmh'
    -- Conan: Component target declared 'xorg::xcb-res'
    -- Conan: Component target declared 'xorg::uuid'
    -- Conan: Component target declared 'xorg::sm'
    -- Conan: Target declared 'xorg::xorg'
    -- Conan: Component target declared 'ncurses::tinfo'
    -- Conan: Component target declared 'ncurses::libcurses++'
    -- Conan: Component target declared 'ncurses::libcurses'
    -- Conan: Component target declared 'ncurses::panel'
    -- Conan: Component target declared 'ncurses::menu'
    -- Conan: Component target declared 'ncurses::form'
    -- Conan: Component target declared 'ncurses::ticlib'
    -- Conan: Component target declared 'ncurses::curses++'
    -- Conan: Target declared 'Curses::Curses'
    -- Conan: Including build module from '/home/conan/workspace/prod-v2/bsr/94868/aebeb/p/ncursd4659b2179361/p/lib/cmake/conan-official-ncurses-targets.cmake'
    -- Conan: Including build module from '/home/conan/workspace/prod-v2/bsr/94868/aebeb/p/b/cpyth1059c4f00163e/p/lib/cmake/use_conan_python.cmake'
    CMake Error at /home/conan/workspace/prod-v2/bsr/94868/aebeb/p/cmakefaa1321642d5b/p/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
      Could NOT find Python3 (missing: Development.Embed) (found version
      "3.12.7")
    
          Reason given by package: 
              Development: Cannot find the library "/home/conan/workspace/prod-v2/bsr/94868/aebeb/p/b/cpyth1059c4f00163e/p/lib/cmake/../libpython3.12.a"
    
    Call Stack (most recent call first):
      /home/conan/workspace/prod-v2/bsr/94868/aebeb/p/cmakefaa1321642d5b/p/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
      /home/conan/workspace/prod-v2/bsr/94868/aebeb/p/cmakefaa1321642d5b/p/share/cmake-3.30/Modules/FindPython/Support.cmake:3984 (find_package_handle_standard_args)
      /home/conan/workspace/prod-v2/bsr/94868/aebeb/p/cmakefaa1321642d5b/p/share/cmake-3.30/Modules/FindPython3.cmake:596 (include)
      /home/conan/workspace/prod-v2/bsr/94868/aebeb/p/b/cpyth1059c4f00163e/p/lib/cmake/use_conan_python.cmake:14 (include)
      build/gcc-11-x86_64-17-release/generators/Python3Config.cmake:38 (include)
      CMakeLists.txt:4 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    
    ERROR: cpython/3.12.7 (test package): Error in build() method, line 92
    	cmake.configure()
    	ConanException: Error 1 while executing
    
  • cpython/3.11.9:
    Didn't run or was cancelled before finishing

  • cpython/3.9.19:
    Didn't run or was cancelled before finishing

  • cpython/3.10.14:
    Didn't run or was cancelled before finishing

  • cpython/3.8.19:
    Didn't run or was cancelled before finishing


Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants