snapcraft overwrites log file names on error

Bug #2052798 reported by Alan Pope 🍺🐧🐱 🦄
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
New
Undecided
Unassigned

Bug Description

snapcraft 8.0.2 from the stable channel.

The newer versions of snapcraft print output on one line, updating rather than scrolling.
When a part (such as an override-build snippet) fails, the log file is displayed, but snapcraft then overwrites that line. So it's not possible to easily copy/paste the log file in order to display it:

alan@nuc:~/Source/popey/spectrum-analyser-snap$ snapcraft --use-lxd
'override-build' in part 'spectrum-analyser' failed with code 1.lyser/build/8BitAnalysers/Source/ZXSpectrum/build/CMakeFiles/CMakeOutput.log".
Review the scriptlet and make sure it's correct.
Failed to execute pack in instance.
Recommended resolution: Run the same command again with --debug to shell into the environment if you wish to introspect this failure.
Full execution log: '/home/alan/.local/state/snapcraft/log/snapcraft-20240209-115359.161950.log'

Note the CMakeOutput.log path is shown as:

'override-build' in part 'spectrum-analyser' failed with code 1.lyser/build/8BitAnalysers/Source/ZXSpectrum/build/CMakeFiles/CMakeOutput.log".

It likely should be:

'override-build' in part 'spectrum-analyser' failed with code 1
project/parts/spectrum-analyser/build/8BitAnalysers/Source/ZXSpectrum/build/CMakeFiles/CMakeOutput.log".

Steps to reproduce:

A simple part, which will fail due to a missing build-package.

  spectrum-analyser:
    plugin: nil
    override-build: |
      git clone --recursive https://github.com/TheGoodDoktor/8BitAnalysers
      cd 8BitAnalysers/Source/ZXSpectrum
      mkdir build
      cd build
      /usr/bin/cmake ..
      make
    build-packages:
      - build-essential
      - cmake
      - libgl-dev
      - libx11-dev
      - libxrandr-dev

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.