#1134315 rpy2: FTBFS: E ffi.error: symbol 'R_nchar' not found in library '/usr/lib/R/lib/libR.so': /usr/lib/R/lib/libR.so: undefined symbol: R_nchar

Package:
src:rpy2
Source:
src:rpy2
Submitter:
Santiago Vila
Date:
2026-06-29 16:47:03 UTC
Severity:
normal
Tags:
#1134315#5
Date:
2026-04-18 17:32:43 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202604/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:rpy2, so that this is still
visible in the BTS web page for this package.

Thanks.
--------------------------------------------------------------------------------
[...]
 debian/rules clean
dh clean --with python3 --buildsystem=pybuild
   dh_auto_clean -O--buildsystem=pybuild
   debian/rules execute_after_dh_auto_clean
make[1]: Entering directory '/<<PKGBUILDDIR>>'
rm -rfv .pybuild build */build src/*.egg-info */src/*.egg-info
find . -name __pycache__ | rm -rfv
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   dh_autoreconf_clean -O--buildsystem=pybuild
   dh_clean -O--buildsystem=pybuild
 debian/rules binary
dh binary --with python3 --buildsystem=pybuild
   dh_update_autotools_config -O--buildsystem=pybuild
   dh_autoreconf -O--buildsystem=pybuild
   dh_auto_configure -O--buildsystem=pybuild

[... snipped ...]

running install_scripts
creating build/bdist.linux-x86_64/wheel/rpy2-3.6.4.dist-info/WHEEL
creating '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/.tmp-p7nl4v5k/rpy2-3.6.4-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'rpy2/__init__.py'
adding 'rpy2/py.typed'
adding 'rpy2-3.6.4.dist-info/licenses/LICENSE'
adding 'rpy2-3.6.4.dist-info/METADATA'
adding 'rpy2-3.6.4.dist-info/WHEEL'
adding 'rpy2-3.6.4.dist-info/top_level.txt'
adding 'rpy2-3.6.4.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
Successfully built rpy2-3.6.4-py3-none-any.whl
I: pybuild plugin_pyproject:168: Unpacking wheel built for python3.13 with "installer" module
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   debian/rules override_dh_auto_test
make[1]: Entering directory '/<<PKGBUILDDIR>>'
TZ=America/New_York LC_ALL=C.UTF-8 LANGUAGE=C.UTF-8 dh_auto_test
I: pybuild base:385: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14/build; python3.14 -m pytest
============================= test session starts ==============================
platform linux -- Python 3.14.4, pytest-9.0.3, pluggy-1.6.0
rootdir: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14/build
configfile: pyproject.toml
plugins: typeguard-4.4.4
collected 894 items

rpy2/ipython/tests/test_ggplot.py .                                      [  0%]
rpy2/ipython/tests/test_html.py ........                                 [  1%]
rpy2/ipython/tests/test_rmagic.py ...............s.........ss            [  4%]
rpy2/rinterface/tests/rlike/test_container.py .......................... [  6%]
.........                                                                [  7%]
rpy2/rinterface/tests/rlike/test_functional.py ...                       [  8%]
rpy2/rinterface/tests/rlike/test_indexing.py .                           [  8%]
rpy2/rinterface/tests/test_bufferprotocol.py ...                         [  8%]
rpy2/rinterface/tests/test_callbacks.py .........s..........s...         [ 11%]
rpy2/rinterface/tests/test_conversion.py .                               [ 11%]
rpy2/rinterface/tests/test_embedded_r.py s.......s...................... [ 14%]
.............                                                            [ 16%]
rpy2/rinterface/tests/test_endr.py s                                     [ 16%]
rpy2/rinterface/tests/test_environment.py .............................  [ 19%]
rpy2/rinterface/tests/test_externalptr.py ...ss                          [ 20%]
rpy2/rinterface/tests/test_functions.py ......................           [ 22%]
rpy2/rinterface/tests/test_memorymanagement.py ...                       [ 23%]
rpy2/rinterface/tests/test_na.py .....s......................            [ 26%]
rpy2/rinterface/tests/test_noinitialization.py ssss                      [ 26%]
rpy2/rinterface/tests/test_openrlib.py ........                          [ 27%]
rpy2/rinterface/tests/test_sexp.py ..........................x...F.      [ 31%]
rpy2/rinterface/tests/test_symbol.py ....                                [ 31%]
rpy2/rinterface/tests/test_threading.py s                                [ 31%]
rpy2/rinterface/tests/test_vector_bool.py ..........                     [ 32%]
rpy2/rinterface/tests/test_vector_byte.py ............                   [ 34%]
rpy2/rinterface/tests/test_vector_complex.py .........                   [ 35%]
rpy2/rinterface/tests/test_vector_float.py ..........                    [ 36%]
rpy2/rinterface/tests/test_vector_int.py ..s...................          [ 38%]
rpy2/rinterface/tests/test_vector_lang.py ......                         [ 39%]
rpy2/rinterface/tests/test_vector_list.py .......                        [ 40%]
rpy2/rinterface/tests/test_vector_numpy.py ..s..                         [ 40%]
rpy2/rinterface/tests/test_vector_pairlist.py .....                      [ 41%]
rpy2/rinterface/tests/test_vector_str.py ...........                     [ 42%]
rpy2/rinterface/tests/test_vectors.py ...................                [ 44%]
rpy2/robjects/tests/robjects/lib/test_dbplyr.py .                        [ 44%]
rpy2/robjects/tests/robjects/lib/test_dplyr.py .....................     [ 47%]
rpy2/robjects/tests/robjects/lib/test_ggplot2.py ....................... [ 49%]
.......................                                                  [ 52%]
rpy2/robjects/tests/robjects/lib/test_grdevices.py ...                   [ 52%]
rpy2/robjects/tests/robjects/lib/test_grid.py ................           [ 54%]
rpy2/robjects/tests/robjects/lib/test_tidyr.py ...                       [ 54%]
rpy2/robjects/tests/robjects/test_array.py ....................          [ 57%]
rpy2/robjects/tests/robjects/test_conversion.py ........................ [ 59%]
.....                                                                    [ 60%]
rpy2/robjects/tests/robjects/test_conversion_numpy.py .................. [ 62%]
...................                                                      [ 64%]
rpy2/robjects/tests/robjects/test_dataframe.py ..................        [ 66%]
rpy2/robjects/tests/robjects/test_environment.py ...........             [ 67%]
rpy2/robjects/tests/robjects/test_formula.py ....                        [ 68%]
rpy2/robjects/tests/robjects/test_function.py .......................... [ 71%]
....                                                                     [ 71%]
rpy2/robjects/tests/robjects/test_help.py ...........                    [ 72%]
rpy2/robjects/tests/robjects/test_language.py .....                      [ 73%]
rpy2/robjects/tests/robjects/test_methods.py .......                     [ 74%]
rpy2/robjects/tests/robjects/test_packages.py ....................       [ 76%]
rpy2/robjects/tests/robjects/test_packages_utils.py .......              [ 77%]
rpy2/robjects/tests/robjects/test_pandas_conversions.py ................ [ 78%]
......................................................                   [ 84%]
rpy2/robjects/tests/robjects/test_robjects.py .............              [ 86%]
rpy2/robjects/tests/robjects/test_rs4.py ...                             [ 86%]
rpy2/robjects/tests/robjects/test_serialization.py .                     [ 86%]
rpy2/robjects/tests/robjects/test_translated_function.py ....            [ 87%]
rpy2/robjects/tests/robjects/test_vector.py ............................ [ 90%]
...........................X...................                          [ 95%]
rpy2/robjects/tests/robjects/test_vector_datetime.py ..x...............  [ 97%]
rpy2/robjects/tests/robjects/test_vector_extractdelegator.py ........... [ 98%]
.                                                                        [ 98%]
rpy2/robjects/tests/robjects/test_vector_factor.py .........             [100%]

=================================== FAILURES ===================================

               ^^^^^^^^^^

rpy2/rinterface/tests/test_sexp.py:269:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <rpy2.rinterface_lib.sexp.CharSexp object at 0x7f8fdd7bf390> [9]
what = <NCHAR_TYPE.Bytes: 0>

    def nchar(self, what: NCHAR_TYPE = NCHAR_TYPE.Bytes) -> int:
        try:
            openrlib.lock.acquire()
            # TODO: nchar_type is not parsed properly by cffi ?
rpy2/rinterface_lib/sexp.py:310: error
=============================== warnings summary ===============================
rpy2/robjects/lib/dplyr.py:27
  /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14/build/rpy2/robjects/lib/dplyr.py:27: UserWarning: This was designed against dplyr versions starting with 1.1. but you have 1.2.1
    warnings.warn(

rpy2/rinterface/tests/test_callbacks.py::test_console_read_with_error_abi
  /usr/lib/python3/dist-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored from cffi callback <function _callback_wrapper_ABI.<locals>.outer_func at 0x7f8febf671c0>, trying to convert the result back to C: None

  Traceback (most recent call last):
    File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.14/build/rpy2/rinterface/tests/test_callbacks.py", line 223, in test_console_read_with_error_abi
      res = callbacks._consoleread(prompt, buf, n, 0)
  TypeError: an integer is required


    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
               ^^^^^^^^^^

rpy2/rinterface/tests/test_sexp.py:269:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <rpy2.rinterface_lib.sexp.CharSexp object at 0x7f792dbcbe10> [9]
what = <NCHAR_TYPE.Bytes: 0>

    def nchar(self, what: NCHAR_TYPE = NCHAR_TYPE.Bytes) -> int:
        try:
            openrlib.lock.acquire()
            # TODO: nchar_type is not parsed properly by cffi ?
rpy2/rinterface_lib/sexp.py:310: error
=============================== warnings summary ===============================
rpy2/robjects/lib/dplyr.py:27
  /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/rpy2/robjects/lib/dplyr.py:27: UserWarning: This was designed against dplyr versions starting with 1.1. but you have 1.2.1
    warnings.warn(

rpy2/rinterface/tests/test_callbacks.py::test_console_read_with_error_abi
  /usr/lib/python3/dist-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored from cffi callback <function _callback_wrapper_ABI.<locals>.outer_func at 0x7f793c30e840>, trying to convert the result back to C: None

  Traceback (most recent call last):
    File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/rpy2/rinterface/tests/test_callbacks.py", line 223, in test_console_read_with_error_abi
      res = callbacks._consoleread(prompt, buf, n, 0)
  TypeError: an integer is required


    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

rpy2/rinterface/tests/test_embedded_r.py::test_initr
  /usr/lib/python3.13/multiprocessing/popen_fork.py:67: DeprecationWarning: This process (pid=804) is multi-threaded, use of fork() may lead to deadlocks in the child.
    self.pid = os.fork()

#1134315#10
Date:
2026-05-14 15:53:20 UTC
From:
To:
Please find a patch attached.
#1134315#17
Date:
2026-06-11 21:33:25 UTC
From:
To:
Upstream also hit what was probably this bug when they moved to R 4.6.x.
  Their response was to remove the feature that triggers it (which they
seem to think was the only option):

https://github.com/rpy2/rpy2/pull/1241/files#diff-59f3fd61503526281cb537669c488964788676ef0e7c7f648e398d84092668a3

The 3.6.7 package currently being tested on Salsa follows upstream in
removing the feature, but you are welcome to disagree.

(Due to unrelated issues with the R 4.5 -> 4.6 transition, this will not
immediately get rpy2 (or statsmodels) back into testing.)

#1134315#22
Date:
2026-06-29 16:44:44 UTC
From:
To:
How difficult would it be to resolve this bug?  Is the patch on Salsa
sufficient?

I maintain the pyinstaller-hooks-contrib package, which depends on statsmodel,
which is currently withheld from testing due to this bug.