Skip to content

Improve byte-compile in ament_cmake_python#605

Open
cottsay wants to merge 2 commits intorollingfrom
cottsay/byte-compile
Open

Improve byte-compile in ament_cmake_python#605
cottsay wants to merge 2 commits intorollingfrom
cottsay/byte-compile

Conversation

@cottsay
Copy link
Copy Markdown
Contributor

@cottsay cottsay commented Oct 10, 2025

  • Align CMake documentation
  • Suppress verbose output from compileall
  • Add a CMake-like installation message
  • Fix support for DESTDIR-based installations

This change should enable Python byte-compilation for RPM packages produced by the buildfarm, where the current code fails to target the correct installation directory.

- Align CMake documentation
- Suppress verbose output from compileall
- Add a CMake-like installation message
- Fix support for DESTDIR-based installations

Signed-off-by: Scott K Logan <logans@cottsay.net>
@cottsay cottsay requested a review from sloretz October 10, 2025 16:23
@cottsay cottsay self-assigned this Oct 10, 2025
@cottsay cottsay added bug Something isn't working enhancement New feature or request labels Oct 10, 2025
Comment thread ament_cmake_python/cmake/ament_python_install_module.cmake Outdated

if(NOT ARG_SKIP_COMPILE)
get_executable_path(python_interpreter_config Python3::Interpreter CONFIGURE)
set(_bytecompile_target "\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${ARG_DESTINATION}/${package_name}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about generating the code at build time and then using install()

Co-authored-by: Shane Loretz <shane.loretz@gmail.com>
Signed-off-by: Scott K Logan <logans@cottsay.net>
@cottsay cottsay requested a review from sloretz November 20, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants