From a764e3a04cb980d65b1f389ffac68ab6324d9c7b Mon Sep 17 00:00:00 2001 From: Alexander Sherikov Date: Wed, 4 Sep 2024 21:14:38 +0400 Subject: [PATCH] cross_raspberry_pi: +PYTHON_SOABI; +cross_python_soabi target --- README.md | 5 +++++ ccws/make/cross.mk | 3 +++ ccws/profiles/build/cross_raspberry_pi/setup.bash | 6 ++++++ ccws/profiles/build/cross_raspberry_pi/toolchain_body.cmake | 1 + ccws/tests/test_cross.mk | 1 + 5 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 250fb1c..0736e14 100644 --- a/README.md +++ b/README.md @@ -335,11 +335,16 @@ Related software Raspberry Pi done in a different way. - -- `github` action that covers some of `CCWS` functionality. +- , + -- the core of ROS packaging infrastructure. + Complicated, specialized on handling of individual packages rather than + workspaces, not suitable for quick field redeployments. TODO ==== +- Investigate generation of debug and development packages. - Reproducible builds . - Replace `ccache` with . - Integrate diff --git a/ccws/make/cross.mk b/ccws/make/cross.mk index 9293f5a..f599f20 100644 --- a/ccws/make/cross.mk +++ b/ccws/make/cross.mk @@ -107,3 +107,6 @@ cross_purge: ${MAKE} cross_umount ${MAKE} wswraptarget TARGET=private_bp_${BUILD_PROFILE}_purge +cross_python_soabi: assert_CCWS_SYSROOT_must_be_mounted + printf "from sysconfig import get_config_var\nprint(get_config_var('SOABI'))\n" \ + | bash -c "${SETUP_SCRIPT}; sudo chroot \"\$${CCWS_SYSROOT}\" python3" diff --git a/ccws/profiles/build/cross_raspberry_pi/setup.bash b/ccws/profiles/build/cross_raspberry_pi/setup.bash index deee47a..0661428 100644 --- a/ccws/profiles/build/cross_raspberry_pi/setup.bash +++ b/ccws/profiles/build/cross_raspberry_pi/setup.bash @@ -19,6 +19,12 @@ CCWS_TRIPLE_ABI=gnueabihf source "$(dirname "${BASH_SOURCE[0]}")/../${1:-"common"}/setup.bash" "${@:2}" "" +# https://docs.ros.org/en/eloquent/Tutorials/Cross-compilation.html +# https://github.com/ros2/python_cmake_module/blob/humble/cmake/Modules/FindPythonExtra.cmake +# https://github.com/ros2/rosidl_python/issues/111 +PYTHON_SOABI=cpython-310-${CCWS_TRIPLE} +export PYTHON_SOABI + ROS_OS_OVERRIDE=debian:10:buster export ROS_OS_OVERRIDE diff --git a/ccws/profiles/build/cross_raspberry_pi/toolchain_body.cmake b/ccws/profiles/build/cross_raspberry_pi/toolchain_body.cmake index 6e4dbb0..dd196bc 100644 --- a/ccws/profiles/build/cross_raspberry_pi/toolchain_body.cmake +++ b/ccws/profiles/build/cross_raspberry_pi/toolchain_body.cmake @@ -18,6 +18,7 @@ set(CMAKE_SYSTEM_NAME Linux CACHE STRING "" FORCE) set(CMAKE_SYSTEM_VERSION 1 CACHE STRING "" FORCE) set(CMAKE_SYSTEM_PROCESSOR "$ENV{CCWS_TRIPLE_ARCH}" CACHE STRING "" FORCE) set(CMAKE_LIBRARY_ARCHITECTURE "$ENV{CCWS_TRIPLE}" CACHE STRING "" FORCE) +set(PYTHON_SOABI "$ENV{PYTHON_SOABI}" CACHE STRING "" FORCE) set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY CACHE STRING "" FORCE) set(CMAKE_TOOLCHAIN_FILE $ENV{CMAKE_TOOLCHAIN_FILE} CACHE STRING "" FORCE) diff --git a/ccws/tests/test_cross.mk b/ccws/tests/test_cross.mk index 08422bf..f80cfaf 100644 --- a/ccws/tests/test_cross.mk +++ b/ccws/tests/test_cross.mk @@ -13,6 +13,7 @@ test: ${MAKE} cross_purge ${MAKE} cross_unpack ${MAKE} cross_mount + ${MAKE} cross_python_soabi ${MAKE} staticoma ${MAKE} wsclean ${MAKE} bp_install_build BUILD_PROFILE=deb