← Back to issue list

Colcon plugin: use release build by default

View original Github issue

Metadata

Project
snapcraft
Number
#4502
Type
pull request
State
merged
Author
MirkoFerrati
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #4502 as commit b6c5a60b9, making Colcon use CMake Release builds by default while preserving explicit user overrides.

Resolution: closed resolved

Reason: PR #4502 was merged as commit b6c5a60b9. The change reduces executable size and debug symbols by defaulting Colcon builds to Release unless users override the CMake configuration.

Evaluated by: mr-cal-bot

No scores available.

Issue body

- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [X] Have you successfully run `make lint`? But I got a strange error even if everything seems ok or 10/10 - [X] Have you successfully run `pytest tests/unit`? But I failed one test with the same issue as reported here https://github.com/snapcore/snapcraft/pull/3810 ----- Normally Colcon does not set any build flags and leaves the choice to the user, meaning the default value is empty and uses the default cmake configuration for debug symbols and optimization. Inside snaps the executables are not supposed to be debugged and should be as optimized as possible so we want the default to be "Release" explicitly, unless the user overrides it intentionally in their snapcraft.yaml This PR has been tested by creating snaps of the simple ros2-talker-listener snap with different debug levels, either default or user-customized. The results for the talker executable show a clear reduction in size and in the number of symbols.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #4502 as commit b6c5a60b9, making Colcon use CMake Release builds by default while preserving explicit user overrides.
stealth/space-bunny-alpha — closed resolved Merged PR #4502 as b6c5a60b9, making Colcon default to Release builds for smaller, less-symbol-heavy executables while preserving user overrides.
stealth/space-bunny-alpha — closed resolved Merged in PR #4502 as commit b6c5a60b9, defaulting the Colcon plugin to Release builds to reduce executable size and debug symbols; no 7.x backport was needed.
qwen/qwen3.6-35b-a3b — — Merged changes to default the Colcon plugin to Release builds, reducing snap executable size and debug symbols. Approved by reviewers, passed CI, and declined backporting to 7.x.
qwen3.6-35b-a3b-mtp-q6 — — Merged. Updates the Colcon plugin to default to Release builds for snaps, reducing binary size and debug symbols. Maintainers approved the change after passing code coverage checks and decided against backporting to version 7.x.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#3638 colcon v2: forward cmake args snapcraft merged Merged PR #3638 (commit 66e385a17), forwarding colcon-cmake-args to Colcon v2's build command for plain CMake packages.
74%
#2486 colcon plugin: support build-time chaining snapcraft merged Merged #2486 as 60c3c9b18, restoring colcon build-time workspace chaining through setup files; fixes LP #1816565.
71%
#1434 feat: colcon plugin craft-parts merged Merged PR #1434 added a reusable colcon build plugin, enabling shared colcon integration for tools such as Rockcraft and Snapcraft.
71%