Skip to content

Commit

Permalink
cross_raspberry_pi: +PYTHON_SOABI; +cross_python_soabi target
Browse files Browse the repository at this point in the history
  • Loading branch information
asherikov committed Sep 4, 2024
1 parent 46faca6 commit a764e3a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,16 @@ Related software
Raspberry Pi done in a different way.
- <https://github.com/ros-tooling/action-ros-ci> -- `github` action that covers
some of `CCWS` functionality.
- <https://github.com/ros-infrastructure/ros_buildfarm>,
<http://wiki.ros.org/buildfarm> -- 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 <https://reproducible-builds.org/>.
- Replace `ccache` with <https://github.com/mbitsnbites/buildcache>.
- Integrate <https://github.com/oclint/oclint>
Expand Down
3 changes: 3 additions & 0 deletions ccws/make/cross.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 6 additions & 0 deletions ccws/profiles/build/cross_raspberry_pi/setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions ccws/tests/test_cross.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a764e3a

Please sign in to comment.