Giter Site home page Giter Site logo

cppyy-backend's People

Contributors

c-w avatar cernphsft avatar etejedor avatar finsberg avatar griels avatar hemker avatar jhominal avatar linev avatar mattip avatar maximusron avatar robertwb avatar stwunsch avatar sudo-panda avatar tengomucho avatar vgvassilev avatar wlav avatar xpressiv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cppyy-backend's Issues

_cppyy_backend.py causes error in python 3.11

In python 3.11 file.open("rU") (_cppyy_backend.py:95) cling/python/cppyy_backend/_cppyy_generator.py:95 causes an error. Removal of the U solves this issue without apparent side effects.

Build from source fails with gcc 13.2.1

I get this error trying to build cppyy-backend 1.14.11 with gcc 13.2.1:

gcc -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/cppyy-backend/src=/usr/src/debug/cppyy-backend -flto=auto -fPIC -I/usr/lib/python3.11/site-packages/cppyy_backend/include -I/usr/include/python3.11 -c src/clingwrapper.cxx -o build/temp.linux-x86_64-cpython-311/src/clingwrapper.o -O2 -pthread -std=c++1z -m64
In file included from /usr/lib/python3.11/site-packages/cppyy_backend/include/Rtypes.h:30,
                 from src/callcontext.h:11,
                 from src/clingwrapper.cxx:11:
/usr/include/string.h:506:15: error: declaration of ‘size_t strlcpy(char*, const char*, size_t) noexcept’ has a different exception specifier
  506 | extern size_t strlcpy (char *__restrict __dest,
      |               ^~~~~~~
In file included from /usr/lib/python3.11/site-packages/cppyy_backend/include/Rtypes.h:26:
/usr/lib/python3.11/site-packages/cppyy_backend/include/strlcpy.h:26:8: note: from previous declaration ‘size_t strlcpy(char*, const char*, size_t)’
   26 | size_t strlcpy(char *dst, const char *src, size_t siz);
      |        ^~~~~~~
/usr/include/string.h:512:15: error: declaration of ‘size_t strlcat(char*, const char*, size_t) noexcept’ has a different exception specifier
  512 | extern size_t strlcat (char *__restrict __dest,
      |               ^~~~~~~
/usr/lib/python3.11/site-packages/cppyy_backend/include/strlcpy.h:27:8: note: from previous declaration ‘size_t strlcat(char*, const char*, size_t)’
   27 | size_t strlcat(char *dst, const char *src, size_t siz);
      |        ^~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1

ERROR Backend subprocess exited when trying to invoke build_wheel

Can't install `cppyy-backend` 1.15.1 from PyPI as `--user` for Python 3.12 on Fedora 39

When running the following command, I get the error below.

$ python3 -m pip install --user --upgrade cppyy-backend

Collecting cppyy-backend
  Using cached cppyy-backend-1.15.1.tar.gz (35 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting cppyy-cling==6.30.0 (from cppyy-backend)
  Obtaining dependency information for cppyy-cling==6.30.0 from https://files.pythonhosted.org/packages/bc/de/8e15b32bb34f8726fa2cf9e2efcfb1b64b476aef482ac30d8023146e3caf/cppyy_cling-6.30.0-py2.py3-none-manylinux2014_x86_64.whl.metadata
  Using cached cppyy_cling-6.30.0-py2.py3-none-manylinux2014_x86_64.whl.metadata (2.0 kB)
Using cached cppyy_cling-6.30.0-py2.py3-none-manylinux2014_x86_64.whl (42.2 MB)
Building wheels for collected packages: cppyy-backend
  Building wheel for cppyy-backend (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for cppyy-backend (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [38 lines of output]
      running bdist_wheel
      running build
      running build_ext
      checking for build/temp.linux-x86_64-cpython-312
      creating build/temp.linux-x86_64-cpython-312
      creating build/temp.linux-x86_64-cpython-312/src
      gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fcf-protection -fexceptions -fcf-protection -fexceptions -fcf-protection -fexceptions -fPIC -I/tmp/pip-build-env-85x0u7o0/overlay/lib/python3.12/site-packages/cppyy_backend/include -I/usr/include/python3.12 -c src/clingwrapper.cxx -o build/temp.linux-x86_64-cpython-312/src/clingwrapper.o -O2 -pthread -std=c++2a -m64
      now building libcppyy_backend.so
      creating build/lib.linux-x86_64-cpython-312
      creating build/lib.linux-x86_64-cpython-312/cppyy_backend
      creating build/lib.linux-x86_64-cpython-312/cppyy_backend/lib
      g++ -shared build/temp.linux-x86_64-cpython-312/src/clingwrapper.o -L/usr/lib64 -o build/lib.linux-x86_64-cpython-312/cppyy_backend/lib/libcppyy_backend.so -Wl,-Bsymbolic-functions
      installing to build/bdist.linux-x86_64/wheel
      running install
      running install_lib
      creating build/bdist.linux-x86_64
      creating build/bdist.linux-x86_64/wheel
      creating build/bdist.linux-x86_64/wheel/cppyy_backend-1.15.1.data
      creating build/bdist.linux-x86_64/wheel/cppyy_backend-1.15.1.data/platlib
      creating build/bdist.linux-x86_64/wheel/cppyy_backend-1.15.1.data/platlib/cppyy_backend
      creating build/bdist.linux-x86_64/wheel/cppyy_backend-1.15.1.data/platlib/cppyy_backend/lib
      copying build/lib.linux-x86_64-cpython-312/cppyy_backend/lib/libcppyy_backend.so -> build/bdist.linux-x86_64/wheel/cppyy_backend-1.15.1.data/platlib/cppyy_backend/lib
      running install_egg_info
      running egg_info
      writing cppyy_backend.egg-info/PKG-INFO
      writing dependency_links to cppyy_backend.egg-info/dependency_links.txt
      writing requirements to cppyy_backend.egg-info/requires.txt
      writing top-level names to cppyy_backend.egg-info/top_level.txt
      reading manifest file 'cppyy_backend.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE.txt'
      writing manifest file 'cppyy_backend.egg-info/SOURCES.txt'
      Copying cppyy_backend.egg-info to build/bdist.linux-x86_64/wheel/cppyy_backend-1.15.1.data/platlib/cppyy_backend-1.15.1-py3.12.egg-info
      running install_scripts
      Now installing cppyy_backend
      Copying installation to: /usr/local/lib/python3.12/site-packages ...
      creating /usr/local/lib/python3.12
      error: could not create '/usr/local/lib/python3.12': Permission denied
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cppyy-backend
Failed to build cppyy-backend
ERROR: Could not build wheels for cppyy-backend, which is required to install pyproject.toml-based projects
WARNING: There was an error checking the latest version of pip.

The three lines before [end of output] are a bit sus, why is it trying to copy anything into anywhere else other than ~/.local/lib/python3.12/site-packages/ when --user is passed in?

Build from source failure on undeclared identifier _POSIX_SEM_VALUE_MAX

(Reporting here rather than cppyy repo because this issue is specific to the build here.)

I'm attempting to follow the instructions for building from source

Start with the cppyy-cling package (cppyy-backend repo, subdirectory “cling”), which requires source to be pulled in from upstream, and thus takes a few extra steps:

$ git clone https://github.com/wlav/cppyy-backend.git
$ cd cppyy-backend/cling
$ python setup.py egg_info
$ python create_src_directory.py
$ python -m pip install . --upgrade

This fails for me on two different systems and three compilers
Ubuntu (with clang16 or gcc11.4) and Fedora36 with gcc12.2

(Should I retry with other or older compilers?)

The SEM_VALUE_MAX error starts with commit 00c7bed "upgrade Cling from upstream (28.04)"
(before that commit there's another blocking error - a compile fail on a const qualifier).

Ubuntu 22.04.3 GCC11.4

      [ 97%] Generating G__ThreadLegacy.cxx, ../../lib/libThreadLegacy.rootmap
      In file included from input_line_8:16:
      In file included from /Data/home/will/repos/cppyy-backend/cling/builddir/include/ROOT/TReentrantRWLock.hxx:21:
      In file included from /usr/include/c++/11/condition_variable:47:
      In file included from /usr/include/c++/11/stop_token:37:
      In file included from /usr/include/c++/11/semaphore:35:
      /usr/include/c++/11/bits/semaphore_base.h:62:41: error: use of undeclared identifier '_POSIX_SEM_VALUE_MAX'; did you mean '_SC_SEM_VALUE_MAX'?
          static constexpr ptrdiff_t _S_max = _POSIX_SEM_VALUE_MAX;
                                              ^
      /usr/include/x86_64-linux-gnu/bits/confname.h:140:5: note: '_SC_SEM_VALUE_MAX' declared here
          _SC_SEM_VALUE_MAX,
          ^
      Error: /Data/home/will/repos/cppyy-backend/cling/builddir/core/rootcling_stage1/src/rootcling_stage1: compilation failure (/Data/home/will/repos/cppyy-backend/cling/builddir/lib/libThreadLegacyde1d7a8d17_dictUmbrella.h)
      gmake[2]: *** [core/thread/CMakeFiles/G__ThreadLegacy.dir/build.make:106: core/thread/G__ThreadLegacy.cxx] Error 1
      gmake[1]: *** [CMakeFiles/Makefile2:28486: core/thread/CMakeFiles/G__ThreadLegacy.dir/all] Error 2
      gmake[1]: *** Waiting for unfinished jobs....
      [ 97%] Built target Cling
      gmake: *** [Makefile:156: all] Error 2
      error: Failed to build cppyy-cling

Fedora36 GCC12.2

  [ 97%] Generating G__ThreadLegacy.cxx, ../../lib/libThreadLegacy.rootmap
  In file included from input_line_8:16:
  In file included from /home/will/repos/cppyy-backend/cling/builddir/include/ROOT/TReentrantRWLock.hxx:21:
  In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/condition_variable:46:
  In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/stop_token:37:
  In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/semaphore:35:
  /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/semaphore_base.h:59:41: error: use of undeclared identifier '_POSIX_SEM_VALUE_MAX'; did you mean '_SC_SEM_VALUE_MAX'?
      static constexpr ptrdiff_t _S_max = _POSIX_SEM_VALUE_MAX;
                                          ^
  /usr/include/bits/confname.h:140:5: note: '_SC_SEM_VALUE_MAX' declared here
      _SC_SEM_VALUE_MAX,
      ^
...

Fails to build/install via pip on python 3.10 (x86 macOS)

Can't install cppyy via pip on macOS Catalina (intel mac):

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.15.7
BuildVersion:	19H2026

$ python3 --version
Python 3.10.8

$ pip3 install cppyy
Collecting cppyy
  Using cached cppyy-2.4.1.tar.gz (24 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install backend dependencies did not run successfully.
  │ exit code: 1
  ╰─> [91 lines of output]
      Collecting cppyy-cling==6.27.0
        Using cached cppyy_cling-6.27.0-py2.py3-none-macosx_10_12_x86_64.whl (23.1 MB)
      Collecting cppyy-backend==1.14.9
        Using cached cppyy-backend-1.14.9.tar.gz (34 kB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
      Building wheels for collected packages: cppyy-backend
        Building wheel for cppyy-backend (pyproject.toml): started
        Building wheel for cppyy-backend (pyproject.toml): finished with status 'error'
        error: subprocess-exited-with-error

        × Building wheel for cppyy-backend (pyproject.toml) did not run successfully.
        │ exit code: 1
        ╰─> [67 lines of output]
            Error in sitecustomize; set PYTHONVERBOSE for traceback:
            AssertionError:
            /usr/local/lib/python3.10/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
              warnings.warn(msg, warning_class)
            running bdist_wheel
            running build
            running build_ext
            Error in sitecustomize; set PYTHONVERBOSE for traceback:
            AssertionError:
            /usr/local/Cellar/[email protected]/3.10.8/bin/python3.10: Error while finding module specification for 'cppyy_backend._cling_config' (ModuleNotFoundError: No module named 'cppyy_backend')
            Traceback (most recent call last):
              File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
                main()
              File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
                json_out['return_val'] = hook(**hook_input['kwargs'])
              File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 249, in build_wheel
                return _build_backend().build_wheel(wheel_directory, config_settings,
              File "/usr/local/lib/python3.10/site-packages/setuptools/build_meta.py", line 412, in build_wheel
                return self._build_with_temp_dir(['bdist_wheel'], '.whl',
              File "/usr/local/lib/python3.10/site-packages/setuptools/build_meta.py", line 397, in _build_with_temp_dir
                self.run_setup()
              File "/usr/local/lib/python3.10/site-packages/setuptools/build_meta.py", line 482, in run_setup
                super(_BuildMetaLegacyBackend,
              File "/usr/local/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
                exec(code, locals())
              File "<string>", line 182, in <module>
              File "/usr/local/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup
                return distutils.core.setup(**attrs)
              File "/usr/local/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
                return run_commands(dist)
              File "/usr/local/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
                dist.run_commands()
              File "/usr/local/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
                self.run_command(cmd)
              File "/usr/local/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
                super().run_command(command)
              File "/usr/local/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
                cmd_obj.run()
              File "/usr/local/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
                self.run_command('build')
              File "/usr/local/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
                self.distribution.run_command(command)
              File "/usr/local/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
                super().run_command(command)
              File "/usr/local/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
                cmd_obj.run()
              File "/usr/local/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 132, in run
                self.run_command(cmd_name)
              File "/usr/local/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
                self.distribution.run_command(command)
              File "/usr/local/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
                super().run_command(command)
              File "/usr/local/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
                cmd_obj.run()
              File "/usr/local/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
                self.build_extensions()
              File "/usr/local/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 466, in build_extensions
                self._build_extensions_serial()
              File "/usr/local/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 492, in _build_extensions_serial
                self.build_extension(ext)
              File "<string>", line 73, in build_extension
              File "<string>", line 58, in get_include_path
              File "/usr/local/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 421, in check_output
                return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
              File "/usr/local/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 526, in run
                raise CalledProcessError(retcode, process.args,
            subprocess.CalledProcessError: Command '['/usr/local/Cellar/[email protected]/3.10.8/bin/python3.10', '-m', 'cppyy_backend._cling_config', '--incdir']' returned non-zero exit status 1.
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for cppyy-backend
      Failed to build cppyy-backend
      ERROR: Could not build wheels for cppyy-backend, which is required to install pyproject.toml-based projects
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install backend dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

`You are probably missing the definition of std::allocator<char>::deallocate(char*, unsigned long)`

Unexpected behavior when building cppyy-backend master-branch from source using g++ >= 10.

  1. Have to pass -D_POSIX_SEM_VALUE_MAX=32767 flag manually or the following error occur:

In file included from .<...>/cling/builddir/include/ROOT/TReentrantRWLock.hxx:21:
In file included from /usr/include/c++/12/condition_variable:46:
In file included from /usr/include/c++/12/stop_token:37:
In file included from /usr/include/c++/12/semaphore:35:
/usr/include/c++/12/bits/semaphore_base.h:59:41: error: use of undeclared identifier '_POSIX_SEM_VALUE_MAX'; did you mean '_SC_SEM_VALUE_MAX'?
static constexpr ptrdiff_t _S_max = _POSIX_SEM_VALUE_MAX;

  1. After that I manage to build and install it in python. However when I run python code a few link error occur, the following one is one of them
import cppyy
cppyy.cppdef("""
#include <string>
void f() { std::string mPath; }
""")
from cppyy.gbl import f
f()

and error message is

IncrementalExecutor::executeFunction: symbol '_ZNSaIcE10deallocateEPcm' unresolved while linking symbol '__cf_4'!
You are probably missing the definition of std::allocator::deallocate(char*, unsigned long)
Maybe you need to load the corresponding shared library?

Building using g++-9 works great and both errors disappear. I assume it's more stable however some of the c++ codes that I am planning to expose to python only compile on newer compilers.
What might cause these link errors?
Any help is appreciated~

Different exception specifier when build cppyy

When I run python -m build in cppyy project root directory. It fails when compiling cppyy-backend. Here is the part of output:

  × Building wheel for cppyy-backend (pyproject.toml) did not run successfully.                                                                                                                
  │ exit code: 1                                                                                                                                                                               
  ╰─> [24 lines of output]                                                                                                                                                                     
      running bdist_wheel                                                                                                                                                                      
      running build                                                                                                                                                                            
      running build_ext                                                                                                                                                                        
      checking for build/temp.linux-x86_64-cpython-311                                                                                                                                         
      creating build/temp.linux-x86_64-cpython-311                                                                                                                                             
      creating build/temp.linux-x86_64-cpython-311/src                                                                                                                                         
      gcc -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-pro
tection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat
 -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexc
eptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -I/tmp/
pip-build-env-bkpyl8ui/overlay/lib/python3.11/site-packages/cppyy_backend/include -I/tmp/build-env-ov_r3zgr/include -I/usr/include/python3.11 -c src/clingwrapper.cxx -o build/temp.linux-x86_6
4-cpython-311/src/clingwrapper.o -O2 -pthread -std=c++1z -m64                                                                                                                                  
      In file included from /tmp/pip-build-env-bkpyl8ui/overlay/lib/python3.11/site-packages/cppyy_backend/include/Rtypes.h:30,                                                                
                       from src/callcontext.h:11,                                                                                                                                              
                       from src/clingwrapper.cxx:11:                                                                                                                                           
      /usr/include/string.h:506:15: error: declaration of ‘size_t strlcpy(char*, const char*, size_t) noexcept’ has a different exception specifier                                            
        506 | extern size_t strlcpy (char *__restrict __dest,                                                                                                                                  
            |               ^~~~~~~                                                                                                                                                            
      In file included from /tmp/pip-build-env-bkpyl8ui/overlay/lib/python3.11/site-packages/cppyy_backend/include/Rtypes.h:26:                                                                
      /tmp/pip-build-env-bkpyl8ui/overlay/lib/python3.11/site-packages/cppyy_backend/include/strlcpy.h:26:8: note: from previous declaration ‘size_t strlcpy(char*, const char*, size_t)’      
         26 | size_t strlcpy(char *dst, const char *src, size_t siz);                                                                                                                          
            |        ^~~~~~~                                                                                                                                                                   
      /usr/include/string.h:512:15: error: declaration of ‘size_t strlcat(char*, const char*, size_t) noexcept’ has a different exception specifier                                            
        512 | extern size_t strlcat (char *__restrict __dest,                                                                                                                                  
            |               ^~~~~~~                                                                                                                                                            
      /tmp/pip-build-env-bkpyl8ui/overlay/lib/python3.11/site-packages/cppyy_backend/include/strlcpy.h:27:8: note: from previous declaration ‘size_t strlcat(char*, const char*, size_t)’      
         27 | size_t strlcat(char *dst, const char *src, size_t siz);                                                                                                                          
            |        ^~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
   
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cppyy-backend
Failed to build cppyy-backend
ERROR: Could not build wheels for cppyy-backend, which is required to install pyproject.toml-based projects

My gcc version is 13.2.1, my clang version(I dont know whether this project uses system llvm) is 15.0.7

typedef cannot be referenced with a enum specifier in function call

While running regression tests on typedefed enums on cppyy v2.4.2 built from source, I was running into the following error when the line

import cppyy
        cppyy.cppdef("""\
        namespace TypedefedEnum {
        typedef enum {
            MONDAY    = 0,
            TUESDAY   = 1,
            WEDNESDAY = 2
        } Day;

        int func(const Day day) { return (int)day; }
        }""")

        ns = cppyy.gbl.TypedefedEnum

        assert ns.func(ns.WEDNESDAY) == 2

resulted in the error:

E   cppyy.gbl.std.runtime_error: int TypedefedEnum::func(const TypedefedEnum::Day day) =>
E       runtime_error: failed to resolve function

/home/maximus/cppyy/cppyy/test/test_regression.py:1234: runtime_error
----------------------------------------------- Captured stderr call ------------------------------------------------
input_line_275:6:60: error: typedef 'Day' cannot be referenced with a enum specifier
      new (ret) (int) (((int (&)(const enum TypedefedEnum::Day))TypedefedEnum::func)(*(const enum TypedefedEnum::Day*)args[0]));
                                                           ^
input_line_274:6:11: note: declared here
        } Day;
          ^

cppyy_get_all_cpp_names doesn't return all the names it should

Hi!

For this code:

namespace GG {
      struct S { 
            int a; 
            int c; 
            S(int a, int c): _a{a}, _c{c} { } 
            S(): _a{0}, _c{0} { } 
      }; 
}

Calling cppyy_get_all_cpp_names(handle_of_S, &count) returns just ["S", "~S“]. Data members are not included.
Also, it would be great to extend cppyy_get_all_cpp_names to work with any namespace, i.e. to return the names of classes, structs and all the other entities that are declared inside a namespace.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.