[FFe] colcon-core argument parsing is broken by recent changes to Python 3.11+

Bug #2060717 reported by Scott K Logan
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ros2-colcon-core (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Patch version to solve a critical problem with colcon argument parsing mechanism.

 * Merge request: https://code.launchpad.net/~j-rivero/ubuntu/+source/ros2-colcon-core/+git/ros2-colcon-core/+merge/464037
 * PPA related: https://code.launchpad.net/~j-rivero/+archive/ubuntu/noble-pkgs

[Justification]

Recent changes to Python which have been backported to Python 3.11 and 3.12 break colcon argument parsing due to a dependency on private API in argparse. A fix has been released in colcon-core 0.16.1 which should be backported to any platforms which will receive the updated Python releases. The python3-colcon-core package currently in Ubuntu Noble is suffering from this issue now.

The current version in 0.15.2-1 fails to build due to problem in the test suite that detect this problem: https://code.launchpad.net/~j-rivero/+archive/ubuntu/noble-pkgs/+build/28042968

A quick test on Noble reports the problem:
--------------------- 8< ----------------------------------------
$ mkdir /tmp/colcon-repro && cd /tmp/colcon-repro
$ colcon build --cmake-args --no-warn-unused-cli

Expected:

Summary: 0 packages finished

Actual:

usage: colcon [-h] [--log-base LOG_BASE] [--log-level LOG_LEVEL] {build,extension-points,extensions,graph,info,list,metadata,test,test-result,version-check} ...
colcon: error: unrecognized arguments: --no-warn-unused-cli
--------------------- 8< ----------------------------------------

[testing done]

After using the changes proposed:

--------------------- 8< ----------------------------------------
jrivero@22d248d84027:~/code/ubuntu$ sudo dpkg -i python3-colcon-core_0.15.2-1ubuntu1_all.deb
(Reading database ... 58627 files and directories currently installed.)
Preparing to unpack python3-colcon-core_0.15.2-1ubuntu1_all.deb ...
Unpacking python3-colcon-core (0.15.2-1ubuntu1) over (0.15.2-1) ...
Setting up python3-colcon-core (0.15.2-1ubuntu1) ...
jrivero@22d248d84027:/tmp/colcon-repro$ colcon build --cmake-args --no-warn-unused-cli

Summary: 0 packages finished [0.28s]
--------------------- 8< ----------------------------------------

Playing with other colcon workspaces does not show any problem to
my eyes when passing different cmake-args like modifying the CMAKE_BUILD_TYPE.

[Original Scott email]
--- 8< ---------------------------

Recent changes to Python which have been backported to Python 3.11 and 3.12 break colcon argument parsing due to a dependency on private API in argparse.

A fix has been released in colcon-core 0.16.1 which should be backported to any platforms which will receive the updated Python releases.

The python3-colcon-core package currently in Ubuntu Noble is suffering from this issue now.

https://github.com/colcon/colcon-core/pull/635

Tags: noble patch

Related branches

Revision history for this message
Scott K Logan (cottsay) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ros2-colcon-core (Ubuntu):
status: New → Confirmed
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "0001-Fix-argument-parsing-in-newer-Python.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Jose Luis Rivero (j-rivero) wrote :

In coordination with Scott, we have raised this to be a FFe since the package is severity damaged as it is now and probably unusable for any use case that is not completely trivial.

I've created and linked the merge-request with the bumped version against ubuntu/devel and testing the package.

description: updated
summary: - colcon-core argument parsing is broken by recent changes to Python 3.11+
+ [FFe] colcon-core argument parsing is broken by recent changes to Python
+ 3.11+
tags: added: noble
Revision history for this message
Benjamin Drung (bdrung) wrote :

Sponsored since this is just a bug fix and not a new feature.

Changed in ros2-colcon-core (Ubuntu):
status: Confirmed → Fix Committed
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ros2-colcon-core - 0.15.2-1ubuntu1

---------------
ros2-colcon-core (0.15.2-1ubuntu1) noble; urgency=medium

  * Add patch to fix argument parsing with Python 3.12
    (LP: #2060717)

 -- Jose Luis Rivero <email address hidden> Tue, 09 Apr 2024 20:51:44 +0200

Changed in ros2-colcon-core (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.