Skip to content

colcon build uses wrong version of python if a python version is built from source #1519

@geoeo

Description

@geoeo

Bug report

Required Info:

  • Operating System:
    • Ubuntu 22
  • Installation type:
    • binaries (apt)
  • Version or commit hash:
    • Hubmle
  • DDS implementation:
    • default eProsima’s Fast DDS.

Steps to reproduce issue

  • Install python 3.6 from source
  • Install python 3.10 from apt
  • install ros2 humble
  • build some c++ ros2 package

Expected behavior

colcon selects python 3.10

Actual behavior

colcon select python3.6

Additional information

Similar to #1421 but no vens are involved

python and pip both point to 3.10.

build output


Starting >>> px4_msgs
[Processing: px4_msgs]                             
[Processing: px4_msgs]                                     
[Processing: px4_msgs]                                       
[Processing: px4_msgs]                                       
--- stderr: px4_msgs                                        
/usr/bin/ld: /usr/local/lib/libpython3.6m.a(_sre.o): warning: relocation against `PyExc_RecursionError' in read-only section `.text'
/usr/bin/ld: /usr/local/lib/libpython3.6m.a(bytearrayobject.o): relocation R_X86_64_PC32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/px4_msgs__rosidl_generator_py.dir/build.make:3386: rosidl_generator_py/px4_msgs/libpx4_msgs__rosidl_generator_py.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:475: CMakeFile

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions