• Bug#1103023: ros2-ament-cmake FTCBFS: fails building a python extension

    From Helmut Grohne@21:1/5 to All on Sun Apr 13 21:30:01 2025
    Source: ros2-ament-cmake
    Version: 2.7.2-1
    Tags: patch
    User: debian-cross@lists.debian.org
    Usertags: ftcbfs

    ros2-ament-cmake fails to cross build from source.

    | Not searching for unused variables given on the command line.
    | -- Found ament_cmake_core: 2.7.2 (/build/reproducible-path/ros2-ament-cmake-2.7.2/debian/tmp/usr/share/ament_cmake_core/cmake)
    | -- Found Python3: /usr/bin/python3 (found version "3.13.3") found components: Interpreter
    | -- Found ament_cmake_python: 2.7.2 (/build/reproducible-path/ros2-ament-cmake-2.7.2/debian/tmp/usr/share/ament_cmake_python/cmake)
    | Traceback (most recent call last):
    | File "<string>", line 4, in <module>
    | if sysconfig.get_config_var('base') != os.path.normpath('/usr'):
    | ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
    | File "/usr/lib/python3.13/sysconfig/__init__.py", line 627, in get_config_var
    | return get_config_vars().get(name)
    | ~~~~~~~~~~~~~~~^^
    | File "/usr/lib/python3.13/sysconfig/__init__.py", line 601, in get_config_vars
    | _init_config_vars()
    | ~~~~~~~~~~~~~~~~~^^
    | File "/usr/lib/python3.13/sysconfig/__init__.py", line 538, in _init_config_vars
    | _init_posix(_CONFIG_VARS)
    | ~~~~~~~~~~~^^^^^^^^^^^^^^
    | File "/usr/lib/python3.13/sysconfig/__init__.py", line 396, in _init_posix | _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
    | ModuleNotFoundError: No module named '_sysconfigdata__linux_arm-linux-gnueabihf'
    | CMake Error at /build/reproducible-path/ros2-ament-cmake-2.7.2/debian/tmp/usr/share/ament_cmake_python/cmake/ament_cmake_python-extras.cmake:71 (message):
    | execute_process(/usr/bin/python3 -c 'import os
    |
    | import sysconfig
    |
    | kwargs = {'vars': {'base': '/usr'}}
    |
    | if sysconfig.get_config_var('base') != os.path.normpath('/usr'):
    |
    | schemes = sysconfig.get_scheme_names()
    | if 'deb_system' in schemes or 'osx_framework_library' in schemes:
    | kwargs['scheme'] = 'posix_prefix'
    | elif 'rpm_prefix' in schemes:
    | kwargs['scheme'] = 'rpm_prefix'
    |
    | print(os.path.relpath(sysconfig.get_path('purelib', **kwargs),
    | start='/usr').replace(os.sep, '/'))') returned error code 1
    | Call Stack (most recent call first):
    | /build/reproducible-path/ros2-ament-cmake-2.7.2/debian/tmp/usr/share/ament_cmake_python/cmake/ament_cmake_python-extras.cmake:22 (_ament_cmake_python_get_python_install_dir)
    | /build/reproducible-path/ros2-ament-cmake-2.7.2/debian/tmp/usr/share/ament_cmake_python/cmake/ament_python_install_package.cmake:38 (_ament_cmake_python_register_environment_hook)
    | CMakeLists.txt:8 (ament_python_install_package)
    |
    |
    | -- Configuring incomplete, errors occurred!
    | cd obj-arm-linux-gnueabihf/ament_cmake_test && tail -v -n \+0 CMakeCache.txt
    | ==> CMakeCache.txt <==

    This looks like it is trying to build a Python extension and fails as
    the sysconfigdata module for the host architecture is not found. Adding
    a dependency on libpython3-dev fixes this.

    Helmut

    diff --minimal -Nru ros2-ament-cmake-2.7.2/debian/changelog ros2-ament-cmake-2.7.2/debian/changelog
    --- ros2-ament-cmake-2.7.2/debian/changelog 2024-11-23 23:05:59.000000000 +0100
    +++ ros2-ament-cmake-2.7.2/debian/changelog 2025-04-12 19:59:29.000000000 +0200
    @@ -1,3 +1,11 @@
    +ros2-ament-cmake (2.7.2-1.1) UNRELEASED; urgency=medium
    +
    + * Non-maintainer upload.
    + * Fix FTCBFS: Missing Build-Depend: libpython3-dev for building a Python
    + extension. (Closes: #-1)
    +
    + -- Helmut Grohne <helmut@subdivi.de> Sat, 12 Apr 2025 19:59:29 +0200
    +
    ros2-ament-cmake (2.7.2-1) unstable; urgency=medium

    * New upstream version 2.7.2
    diff --minimal -Nru ros2-ament-cmake-2.7.2/debian/control ros2-ament-cmake-2.7.2/debian/control
    --- ros2-ament-cmake-2.7.2/debian/control 2024-11-23 23:05:59.000000000 +0100
    +++ ros2-ament-cmake-2.7.2/debian/control 2025-04-12 19:59:27.000000000 +0200
    @@ -11,6 +11,7 @@
    dh-ros,
    dh-sequence-python3,
    libgtest-dev <!nocheck>,
    + libpython3-dev,
    python3-ament-package,
    python3-catkin-pkg,
    python3-setuptools,

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usen