Error presentation sometimes omits the last lines
Metadata
Current evaluation
Merged in canonical/craft-parts#1012 (f47837ad), reformatting plugin build errors so trailing diagnostic lines are preserved.
Resolution: closed resolved
Reason: PR #1012 was merged as commit f47837ad and changed the shared build-error details formatter. Its trailing-line selection now retains final non-trace diagnostics reported missing in #1000.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
The error message contained in the PluginBuildError is sometimes (not always) missing the last error lines.
### To Reproduce
Using `edge` Rockcraft, but the project described below. No specific source files required. The error output:
```
❯ rockcraft pack
Failed to run the build script for part 'my-part'.
Detailed information:
:: + exit 1
Recommended resolution: Check the build output and verify the project can work with the 'python' plugin.
For more information, check out: https://documentation.ubuntu.com/rockcraft/en/latest/reference/plugins.html
Failed to execute rockcraft in instance.
Full execution log: '/home/tiago/.local/state/rockcraft/log/rockcraft-20250131-101559.798685.log'
```
... is missing [the last lines](https://github.com/canonical/craft-parts/blob/a04f57150a34afab0bc6c7750456407200842ae1/craft_parts/plugins/base.py#L187). Note that the log itself has those lines, and this doesn't happen everytime. The following spread tests in rockcraft are flaky because of this:
- tests/spread/rockcraft/plugin-python-error:bare
- tests/spread/rockcraft/plugin-python-error:base_2204
### part yaml
```shell
name: python-error
base: ubuntu@24.04
version: '0.1'
summary: Single-line elevator pitch for your amazing rock
description: |
This is python-error's description. You have a paragraph or two to tell the
most important story about it. Keep it under 100 words though,
we live in tweetspace and your description wants to look good in the
container registries out there.
platforms: # the platforms this rock should be built on and run on
amd64:
parts:
my-part:
plugin: python
source: "."
```
### Relevant log output
```shell
(...)
2025-01-31 10:16:41.536 :: 2025-01-31 10:16:41.205 :: Looking for a Python interpreter called "python3.12" in the payload...
2025-01-31 10:16:41.536 :: 2025-01-31 10:16:41.205 :: ++ find /root/parts/my-part/install/usr/bin /root/stage/usr/bin -type f -executable -name python3.12 -print -quit
2025-01-31 10:16:41.536 :: 2025-01-31 10:16:41.206 :: + payload_python=
2025-01-31 10:16:41.536 :: 2025-01-31 10:16:41.206 :: + '[' -n '' ']'
2025-01-31 10:16:41.536 :: 2025-01-31 10:16:41.206 :: + echo 'Python interpreter not found in payload.'
2025-01-31 10:16:41.536 :: 2025-01-31 10:16:41.206 :: + symlink_target=
2025-01-31 10:16:41.536 :: 2025-01-31 10:16:41.206 :: + '[' -z '' ']'
2025-01-31 10:16:41.536 :: 2025-01-31 10:16:41.206 :: + echo 'No suitable Python interpreter found, giving up.'
2025-01-31 10:16:41.536 :: 2025-01-31 10:16:41.206 :: + exit 1
2025-01-31 10:16:41.536 :: 2025-01-31 10:16:41.206 :: Python interpreter not found in payload.
2025-01-31 10:16:41.536 :: 2025-01-31 10:16:41.206 :: No suitable Python interpreter found, giving up.
2025-01-31 10:16:41.536 :: 2025-01-31 10:16:41.208 Failed to run the build script for part 'my-part'.
2025-01-31 10:16:41.536 :: 2025-01-31 10:16:41.208 Detailed information:
2025-01-31 10:16:41.536 :: :: + exit 1
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged in canonical/craft-parts#1012 (f47837ad), reformatting plugin build errors so trailing diagnostic lines are preserved. | |
| stealth/space-bunny-alpha | — | closed stale | Closed with no documented fix after a maintainer questioned whether the full Python error output should be shown; no replacement or closing rationale is provided. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed by updating the error presentation logic to include truncated build script output. Closed after a maintainer confirmed the corrected message format. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without a documented fix. A maintainer proposed a corrected error output format including the omitted build script lines. The issue appears deferred or addressed upstream in craft-parts. | |
| qwen/qwen3.6-35b-a3b | — | — | Resolved after internal tracking and confirmation of the corrected error output format. The bug caused intermittent omission of final error lines during plugin builds, which now displays all relevant build failure messages as expected. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed, likely abandoned or resolved internally via Jira ticket CRAFT-4070. A maintainer clarified the expected error output format, but no public fix or merge was documented. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/craft-parts#1012
(confidence 99%)
Merged commit f47837ad is titled "fix(errors): reformat plugin build error output" and updates the formatter responsible for PluginBuildError details.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #270 fix: correctly print multi-line errors | craft-cli | merged | Merged in canonical/craft-cli#270 (0ca6940), splitting error text into lines so prior progress output cannot corrupt multi-line errors; fixes #263. |