Surface `rockcraft pack` errors to accelerate development
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
### What needs to get done
The logs provided by the `rockcraft` CLI are really detailed and very useful. However, I believe the default behaviour could be enhanced by surfacing additional information.
I'd like to propose a minor enhancement to `rockcraft pack` that could save developers a lot of time. The idea is to expose the _functional_ error/exception to the developer by default on pack errors.
## Example
When building my rock, `rockcraft` provided this generic message, which includes no context as it relates to my solution:
```
$ rockcraft pack
'override-build' in part 'build-context' failed with code 1.
Recommended resolution: Review the scriptlet and make sure it's correct.
Failed to execute rockcraft in instance.
Full execution log: '/home/bruno/.local/state/rockcraft/log/rockcraft-20240703-153218.973163.log'
```
However, this one line buried in the log contains the most relevant information:
`error: invalid slice reference "libgomp1" in slices/httping.yaml`
With that info, it takes the developer a couple of seconds to _fix_ the issue. Without it, it could take them a couple of minutes _just to find it_.
### Why it needs to get done
When `rockcraft pack` fails, It could surface the upmost _functional_ error/exception by default.
With this proposal, `rockcraft pack` would be augmented (see line 5 below) to show the error by default, eliminating the need to check logs in most situations.
```
$ rockcraft pack
'override-build' in part 'build-context' failed with code 1.
Recommended resolution: Review the scriptlet and make sure it's correct.
Failed to execute rockcraft in instance.
error: invalid slice reference "libgomp1" in slices/httping.yaml
Full execution log: '/home/bruno/.local/state/rockcraft/log/rockcraft-20240703-153218.973163.log'
```
Thanks and great work Team!
Evaluation history
No evaluation history available.