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

nanobind: add a new recipe #20297

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

nanobind: add a new recipe #20297

wants to merge 13 commits into from

Conversation

valgur
Copy link
Contributor

@valgur valgur commented Oct 3, 2023

Specify library name and version: nanobind/1.6.1

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@Ahajha
Copy link
Contributor

Ahajha commented Mar 22, 2024

I have some ideas regarding the failed find_package call for the CPython recipe, I think I can make it work seamlessly without any additional work. For now, you can follow the example in the CPython test package for how to get CMake to find the Conan package.

@valgur
Copy link
Contributor Author

valgur commented Mar 22, 2024

@Ahajha The issue is caused by the Conan package not exporting the Development.Module component and others, I think? Should this already be supported by the cpython recipe?

@Ahajha
Copy link
Contributor

Ahajha commented Mar 22, 2024

@valgur The recipe currently only exports cpython::python, cpython::embed, and cpython::_hidden, and to top it off the CMake config file is named cpython, so the built-in FindPython knows nothing about it. It needs to be fed some hints in order to find the Conan Python, otherwise it will just look for a system one.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@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 11 (d22cf0b6fbcef2a5f03bdd13f9a368495c271ad4):

  • nanobind/2.1.0:
    CI failed to create some packages (All logs)

    Logs for packageID 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=Visual Studio
    compiler.runtime=MD
    compiler.version=16
    os=Windows
    
    [...]
    Downloading conanfile.py
    Downloading conan_export.tgz
    tsl-robin-map/1.3.0: Downloaded recipe revision 8e8749774ce05bd101481875e1d29654
    cpython/3.12.7: Not found in local cache, looking in remotes...
    cpython/3.12.7: Trying with 'conan-center'...
    Downloading conanmanifest.txt
    Downloading conanfile.py
    Downloading conan_export.tgz
    cpython/3.12.7: Downloaded recipe revision c6f89b3dd5aeee00561f564c88cdc411
    zlib/1.3.1: Not found in local cache, looking in remotes...
    zlib/1.3.1: Trying with 'conan-center'...
    Downloading conanmanifest.txt
    Downloading conanfile.py
    Downloading conan_export.tgz
    zlib/1.3.1: Downloaded recipe revision f52e03ae3d251dec704634230cd806a2
    cmake/3.30.1: Not found in local cache, looking in remotes...
    cmake/3.30.1: Trying with 'conan-center'...
    Downloading conanmanifest.txt
    Downloading conanfile.py
    Downloading conan_export.tgz
    cmake/3.30.1: Downloaded recipe revision 6d832cf2d46f6ec969ca5ed5b41f91eb
    Version ranges solved
        zlib/* versions found in 'conan-center' remote
        Version range '>=1.2.11 <2' required by 'cpython/3.12.7' resolved to 'zlib/1.3.1' in remote 'conan-center'
        cmake/* versions found in 'conan-center' remote
        Version range '>=3.18 <4' required by 'nanobind/2.1.0 (test package)' resolved to 'cmake/3.30.1' in remote 'conan-center'
    
    nanobind/2.1.0 (test package): Installing package
    Requirements
        cpython/3.12.7 from 'conan-center' - Downloaded
        nanobind/2.1.0 from local cache - Cache
        tsl-robin-map/1.3.0 from 'conan-center' - Downloaded
        zlib/1.3.1 from 'conan-center' - Downloaded
    Packages
        cpython/3.12.7:INVALID - Invalid
        nanobind/2.1.0:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Download
        tsl-robin-map/1.3.0:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Download
        zlib/1.3.1:3fb49604f9c2f729b85ba3115852006824e72cab - Download
    Build requirements
        cmake/3.30.1 from 'conan-center' - Downloaded
    Build requirements packages
        cmake/3.30.1:ca33edce272a279b24f87dc0d4cf5bbdcffbc187 - Download
    
    Installing (downloading, building) binaries...
    WARN: **************************************************
    WARN: *** Conan 1 is legacy and on a deprecation path **
    WARN: *********** Please upgrade to Conan 2 ************
    WARN: **************************************************
    ERROR: There are invalid packages (packages that cannot exist for this configuration):
    cpython/3.12.7: Invalid ID: Static msvc build disabled (>=3.10) due to "AttributeError: module 'sys' has no attribute 'winver'"
    

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 11 (d22cf0b6fbcef2a5f03bdd13f9a368495c271ad4):

  • nanobind/2.1.0:
    CI failed to create some packages (All logs)

    Logs for packageID da39a3ee5e6b4b0d3255bfef95601890afd80709:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=apple-clang
    compiler.cppstd=17
    compiler.libcxx=libc++
    compiler.version=13
    os=Macos
    
    [...]
        gdbm/1.23#e33e95cba20c006ae47466e2770cd984 - Downloaded (conan-center)
        gnu-config/cci.20210814#dc430d754f465e8c74463019672fb97b - Downloaded (conan-center)
        libffi/3.4.4#72cccac6139293b6e97ec9cd676547ff - Downloaded (conan-center)
        libtool/2.4.7#08316dad5c72c541ed21e039e4cf217b - Downloaded (conan-center)
        libxcrypt/4.4.36#4b4e8f20794f1997dd59eeed0b7cdcfb - Downloaded (conan-center)
        m4/1.4.19#b38ced39a01e31fef5435bc634461fd2 - Downloaded (conan-center)
        meson/1.2.2#21b73818ba96d9eea465b310b5bbc993 - Downloaded (conan-center)
        mpdecimal/2.5.0#ef7f121607e10372c07a668830887b79 - Downloaded (conan-center)
        ncurses/6.4#78908f3ed548f188cf15e415f8949f2f - Downloaded (conan-center)
        ninja/1.12.1#fd583651bf0c6a901943495d49878803 - Downloaded (conan-center)
        openssl/3.3.2#9f9f130d58e7c13e76bb8a559f0a6a8b - Downloaded (conan-center)
        pkgconf/2.0.3#f996677e96e61e6552d85e83756c328b - Downloaded (conan-center)
        pkgconf/2.1.0#27f44583701117b571307cf5b5fe5605 - Downloaded (conan-center)
        sqlite3/3.45.2#60f2d3278e7bc12c8ef02ac75119c137 - Downloaded (conan-center)
        tcl/8.6.10#d694cc97f48640f0d66aa90b16cdc5cd - Downloaded (conan-center)
        tk/8.6.10#1e8cbe0b5d8257de6bc6904da048766f - Downloaded (conan-center)
        xz_utils/5.4.5#b885d1d79c9d30cff3803f7f551dbe66 - Downloaded (conan-center)
        zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Downloaded (conan-center)
    Resolved version ranges
        cmake/[>=3.18 <4]: cmake/3.30.1
        expat/[>=2.6.2 <3]: expat/2.6.3
        ninja/[>=1.10.2 <2]: ninja/1.12.1
        openssl/[>=1.1 <4]: openssl/3.3.2
        zlib/[>=1.2.11 <2]: zlib/1.3.1
    
    ======== Computing necessary packages ========
    Requirements
        bzip2/1.0.8#d00dac990f08d991998d624be81a9526:12b38c622ab94fbabd118653840a0f5f7c93b72d#50fc972585a2b17a8abf290e28e90075 - Download (conan-center)
        cpython/3.12.7#c6f89b3dd5aeee00561f564c88cdc411:8009f3f4a77f8aa01e7deb9d51f746eca4e5b054 - Missing
        expat/2.6.3#39b80d3109fbe578fddfe4951f0b1d57:e52f1242ee09dfd5972ef693a1ded9cf5ab1a9cc#fa8e32d8c6c81dbb277c9496e67757d5 - Download (conan-center)
        gdbm/1.23#e33e95cba20c006ae47466e2770cd984:c2e0b97811fca19961df06c6397496a898589b98#08c62dd2d703bd861d75036a8e2e5b42 - Download (conan-center)
        libffi/3.4.4#72cccac6139293b6e97ec9cd676547ff:d62dff20d86436b9c58ddc0162499d197be9de1e#ca50f569a69804fe253c46260f6f6527 - Download (conan-center)
        mpdecimal/2.5.0#ef7f121607e10372c07a668830887b79:07437550df3d1ee60a621eebe9bef2d6d7d7739d#76d1962ef4613c4e0320ef7c5e798303 - Download (conan-center)
        nanobind/2.1.0#bf68875cd28cba7082e1781fd62c7e89:da39a3ee5e6b4b0d3255bfef95601890afd80709#81f6943435304b6304b02254426bf32b - Download (c3i_PR-v2-20297)
        ncurses/6.4#78908f3ed548f188cf15e415f8949f2f:5087e0aa142baed7d665da64d886599eb85f31f7 - Invalid
        openssl/3.3.2#9f9f130d58e7c13e76bb8a559f0a6a8b:85a50ad6024a51a54e17f9661b5d30ecb2b33742#6859054fea9224247a21f725e992890f - Download (conan-center)
        sqlite3/3.45.2#60f2d3278e7bc12c8ef02ac75119c137:cba20dbd31e3a53330299d98db1e609461f2a3a1#f25de4d0dfcb84eb4ad0b4c7c76bcdb4 - Download (conan-center)
        tcl/8.6.10#d694cc97f48640f0d66aa90b16cdc5cd:c7e21e9e35eed4982e5c01594abf7240dda36f80#e544ae1d256dd524b4daf3ee6df79531 - Download (conan-center)
        tk/8.6.10#1e8cbe0b5d8257de6bc6904da048766f:226094012da68de0263ba6bb543df827f3167a39 - Invalid
        tsl-robin-map/1.3.0#8e8749774ce05bd101481875e1d29654:da39a3ee5e6b4b0d3255bfef95601890afd80709#2b4048704817e289c7535387a582d020 - Download (conan-center)
        xz_utils/5.4.5#b885d1d79c9d30cff3803f7f551dbe66:d62dff20d86436b9c58ddc0162499d197be9de1e#e7e701d5c6b6c1cefabf4d83a043f82a - Download (conan-center)
        zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:d62dff20d86436b9c58ddc0162499d197be9de1e#c4506d0ca4188035101e46f9b99cc29f - Download (conan-center)
    Build requirements
        cmake/3.30.1#6d832cf2d46f6ec969ca5ed5b41f91eb:9e5323c65b94ae38c3c733fe12637776db0119a5#a9d2ec3d84609a8a009de5f1d2b06322 - Download (conan-center)
        cpython/3.12.7#c6f89b3dd5aeee00561f564c88cdc411:cb5c6be30cbf4f724cfcf6054138a93c4993cb22#a5241008a7648fd226f32ca5ef1ace1b - Download (conan-center)
    Skipped binaries
        libxcrypt/4.4.36, autoconf/2.71, automake/1.16.5, bison/3.8.2, bzip2/1.0.8, expat/2.6.3, flex/2.6.4, gdbm/1.23, gnu-config/cci.20210814, libffi/3.4.4, libtool/2.4.7, libxcrypt/4.4.36, m4/1.4.19, meson/1.2.2, mpdecimal/2.5.0, ncurses/6.4, ninja/1.12.1, openssl/3.3.2, pkgconf/2.0.3, pkgconf/2.1.0, sqlite3/3.45.2, tcl/8.6.10, tk/8.6.10, xz_utils/5.4.5, zlib/1.3.1
    ERROR: There are invalid packages:
    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
    

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.

@valgur valgur marked this pull request as ready for review October 3, 2024 08:43
@Ahajha
Copy link
Contributor

Ahajha commented Nov 3, 2024

RE: #25500 (comment)

I don't think it's going to be easy (or even possible in its current state) to fix the cpython Mac cross-builds(unless we cheat and call a universal build a cross build. Wouldn't be the worst thing I suppose). That could probably be added as an invalid config for this recipe in the short term and we can revisit if/when we find a fix. Perhaps when C3I allows additional configs to be added, that could help the situation.

The Windows issues (in your PR) are certainly fixable though.

@Ahajha
Copy link
Contributor

Ahajha commented Nov 25, 2024

As a dumb idea - can you do something like

def requirements(self):
    try:
        self.requires("cpython/whatever"...)
        self.should_test = True
    catch ConanInvalidConfiguration:
        self.should_test = False

def test(self):
    if self.should_test:
        self.run(whatever...)

Doesn't have to be anything like this, but essentially just limit the test package to requiring cpython when it is valid, if it isn't then don't build or test anything.

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.

[request] nanobind
3 participants