Skip to content

When finding Python3, use python3 executable as a hint#650

Merged
cottsay merged 2 commits intohumblefrom
cottsay/find_python3
Feb 16, 2024
Merged

When finding Python3, use python3 executable as a hint#650
cottsay merged 2 commits intohumblefrom
cottsay/find_python3

Conversation

@cottsay
Copy link
Copy Markdown
Member

@cottsay cottsay commented Feb 15, 2024

The existing find_package(Python3) call will locate the Python interpreter with the latest version number. However, this may not be the system's default Python interpreter for which our dependencies have been installed.

If Python3_EXECUTABLE is not explicitly specified, use find_program to locate the Python interpreter behind the "python3" command, which is likely the system's default and the one that we want.

If no executable can be found by the name "python3", the find_program call will silently fail and the existing behavior will manifest.

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status
  • Windows-debug Build Status <- did I trigger this wrong? Is it even expected to work?

The existing find_package(Python3) call will locate the Python
interpreter with the latest version number. However, this may not be the
system's default Python interpreter for which our dependencies have been
installed.

If Python3_EXECUTABLE is not explicitly specified, use find_program to
locate the Python interpreter behind the "python3" command, which is
likely the system's default and the one that we want.

If no executable can be found by the name "python3", the find_program
call will silently fail and the existing behavior will manifest.

Signed-off-by: Scott K Logan <logans@cottsay.net>
@cottsay cottsay added the bug Something isn't working label Feb 15, 2024
@cottsay cottsay self-assigned this Feb 15, 2024
Copy link
Copy Markdown
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

LGTM with green CI

@clalancette
Copy link
Copy Markdown
Contributor

  • Windows-debug Build Status <- did I trigger this wrong? Is it even expected to work?

So at the very least, the "packaging" variant of Windows Debug needs to work so we can release the tarball. That job failed because of building a test, which the "packaging" variant may skip.

Regardless, we can probably fix that particular problem by splitting that test into smaller chunks, or add the /bigobj flag when building rosbag2_transport on Windows Debug.

@clalancette
Copy link
Copy Markdown
Contributor

By the way, I'm 100% behind doing this, after we fix the above problem.

One thing I will say that we are in a somewhat strange procedural place. That is, usually we target fixes at rolling, and then backport from there. In this particular case, I don't think we should do that because I have a more comprehensive fix for this exact problem in the works for rolling. I think that is the better long-term fix, but it will not be possible to backport to humble because it raises the minimum CMake version to 3.20. I haven't yet opened the PRs for this (it will take a number of them), but I am planning on doing that in the next few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants