when there's a syntax error in a scriptlet, it shows the name of the temp file

Bug #1650968 reported by Leo Arias
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
High
Sergio Schvezov

Bug Description

When there's a syntax error in a scriptlet, it shows the name of the temp file which is not useful at all to find the error.

To reproduce:

Put a part with this in a snapcraft.yaml

    plugin: nil
    prepare: |
      echo "hola" &&

There is a syntax error at the end of prepare because it's missing the second statement.
Run snapcraft:

$ snapcraft
Preparing to pull my-part
Pulling my-part
Preparing to build my-part
Building my-part
/tmp/tmpnpz33nrs: 2: /tmp/tmpnpz33nrs: Syntax error: end of file unexpected
Command '['/bin/sh', '/tmp/tmpgasuc_zd', '/tmp/tmpnpz33nrs']' returned non-zero exit status 2

Instead of showing the name of the tmp file, the error should point to the prepare scriptlet in the yaml.

Tags: ui scripts
Changed in snapcraft:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Sergio Schvezov (sergiusens)
Changed in snapcraft:
milestone: none → 2.35
Revision history for this message
Leo Arias (elopio) wrote :

ahh, I was searching on the wrong tag :)

tags: added: scripts
removed: scriptlets
Changed in snapcraft:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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