Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 939789 - dev-python/contourpy-1.3.0 compile fail : error: macro "PYBIND11_MODULE" passed 3 arguments, but takes just 2
Summary: dev-python/contourpy-1.3.0 compile fail : error: macro "PYBIND11_MODULE" pass...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-17 18:00 UTC by Arniiiii
Modified: 2024-09-17 19:39 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (file_939789.txt,21.54 KB, text/plain)
2024-09-17 18:00 UTC, Arniiiii
Details
emerge --info (file_939789.txt,14.67 KB, text/plain)
2024-09-17 18:01 UTC, Arniiiii
Details
all files you may need in a lzip-tarball (dev-python_contourpy-1.3.0_compile_fail_PYBIND11.tar.lz,181.49 KB, application/x-lzip)
2024-09-17 18:01 UTC, Arniiiii
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arniiiii 2024-09-17 18:00:45 UTC
Created attachment 903232 [details]
build.log

from build.log:
```
FAILED: src/_contourpy.cpython-310-x86_64-linux-gnu.so.p/wrap.cpp.o
x86_64-pc-linux-gnu-g++ -Isrc/_contourpy.cpython-310-x86_64-linux-gnu.so.p -Isrc -I../contourpy-1.3.0/src -I/include -I/usr/include/python3.10 -fvisibility=hidden -flto=auto -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++17 -O3 -pipe -march=alderlake -mabm -mno-cldemote -mno-kl -mno-pconfig -mno-sgx -mno-widekl -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=30720 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -fgraphite-identity -floop-interchange -floop-strip-mine -floop-nest-optimize -ggdb3 -DNDEBUG -fPIC -DCONTOURPY_VERSION=1.3.0 -MD -MQ src/_contourpy.cpython-310-x86_64-linux-gnu.so.p/wrap.cpp.o -MF src/_contourpy.cpython-310-x86_64-linux-gnu.so.p/wrap.cpp.o.d -o src/_contourpy.cpython-310-x86_64-linux-gnu.so.p/wrap.cpp.o -c ../contourpy-1.3.0/src/wrap.cpp
../contourpy-1.3.0/src/wrap.cpp:21:54: error: macro "PYBIND11_MODULE" passed 3 arguments, but takes just 2
   21 | PYBIND11_MODULE(_contourpy, m, py::mod_gil_not_used()) {
      |                                                      ^
In file included from /usr/include/pybind11/attr.h:13,
                 from /usr/include/pybind11/detail/class.h:12,
                 from /usr/include/pybind11/pybind11.h:13,
                 from ../contourpy-1.3.0/src/common.h:4,
                 from ../contourpy-1.3.0/src/output_array.h:4,
                 from ../contourpy-1.3.0/src/chunk_local.h:4,
                 from ../contourpy-1.3.0/src/base.h:13,
                 from ../contourpy-1.3.0/src/base_impl.h:4,
                 from ../contourpy-1.3.0/src/wrap.cpp:1:
/usr/include/pybind11/detail/common.h:467: note: macro "PYBIND11_MODULE" defined here
  467 | #define PYBIND11_MODULE(name, variable)                                                           \
      |
../contourpy-1.3.0/src/wrap.cpp:21:1: error: ‘PYBIND11_MODULE’ does not name a type
   21 | PYBIND11_MODULE(_contourpy, m, py::mod_gil_not_used()) {
      | ^~~~~~~~~~~~~~~
../contourpy-1.3.0/src/wrap.cpp:19:28: warning: ‘mpl20xx_fill_type’ defined but not used [-Wunused-variable]
   19 | static contourpy::FillType mpl20xx_fill_type = contourpy::FillType::OuterCode;
      |                            ^~~~~~~~~~~~~~~~~
../contourpy-1.3.0/src/wrap.cpp:18:28: warning: ‘mpl20xx_line_type’ defined but not used [-Wunused-variable]
   18 | static contourpy::LineType mpl20xx_line_type = contourpy::LineType::SeparateCode;
      |                            ^~~~~~~~~~~~~~~~~
```
Comment 1 Arniiiii 2024-09-17 18:01:06 UTC
Created attachment 903233 [details]
emerge --info
Comment 2 Arniiiii 2024-09-17 18:01:51 UTC
Created attachment 903234 [details]
all files you may need in a lzip-tarball

inside of the tarball:
how_it_was_called.txt emerge_--info.txt /var/tmp/portage/dev-python/contourpy-1.3.0/{build-info/,files/,temp/,work/**{.log}} /var/lib/portage/ /etc/portage/ /var/log/portage/elog/dev-python/contourpy-1.3.0:20240917-172336.log
Comment 3 Arniiiii 2024-09-17 18:04:04 UTC
from /usr/include/pybind11/detail/common.h:
```
/** \rst
    This macro creates the entry point that will be invoked when the Python interpreter
    imports an extension module. The module name is given as the first argument and it
    should not be in quotes. The second macro argument defines a variable of type
    `py::module_` which can be used to initialize the module.

    The entry point is marked as "maybe unused" to aid dead-code detection analysis:
    since the entry point is typically only looked up at runtime and not referenced
    during translation, it would otherwise appear as unused ("dead") code.

    .. code-block:: cpp

        PYBIND11_MODULE(example, m) {
            m.doc() = "pybind11 example module";

            // Add bindings here
            m.def("foo", []() {
                return "Hello, World!";
            });
        }
\endrst */
#define PYBIND11_MODULE(name, variable)                                                           \
    static ::pybind11::module_::module_def PYBIND11_CONCAT(pybind11_module_def_, name)            \
        PYBIND11_MAYBE_UNUSED;                                                                    \
    PYBIND11_MAYBE_UNUSED                                                                         \
    static void PYBIND11_CONCAT(pybind11_init_, name)(::pybind11::module_ &);                     \
    PYBIND11_PLUGIN_IMPL(name) {                                                                  \
        PYBIND11_CHECK_PYTHON_VERSION                                                             \
        PYBIND11_ENSURE_INTERNALS_READY                                                           \
        auto m = ::pybind11::module_::create_extension_module(                                    \
            PYBIND11_TOSTRING(name), nullptr, &PYBIND11_CONCAT(pybind11_module_def_, name));      \
        try {                                                                                     \
            PYBIND11_CONCAT(pybind11_init_, name)(m);                                             \
            return m.ptr();                                                                       \
        }                                                                                         \
        PYBIND11_CATCH_INIT_EXCEPTIONS                                                            \
    }                                                                                             \
    void PYBIND11_CONCAT(pybind11_init_, name)(::pybind11::module_ & (variable))

PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)

```
Comment 4 Mike Gilbert gentoo-dev 2024-09-17 18:42:54 UTC
Thanks again for adjusting the attachments!
Comment 5 Larry the Git Cow gentoo-dev 2024-09-17 19:39:12 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=358f69aee41361ae8b0bb5cfb4276c6089a9c988

commit 358f69aee41361ae8b0bb5cfb4276c6089a9c988
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2024-09-17 19:36:39 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2024-09-17 19:38:35 +0000

    dev-python/contourpy: Fix minimal pybind11 version
    
    Closes: https://bugs.gentoo.org/939789
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 dev-python/contourpy/contourpy-1.3.0.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)