environment sections are reordered

Bug #1868460 reported by Zygmunt Krynicki
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
Low
Chris Patterson
snapd
Triaged
Medium
Unassigned

Bug Description

Snapcraft cannot reorder environment sections. This applies both to snap-wide and app-specific environment sections. This matters because those entries can refer to earlier definitions and snapd implements this semantics precisely.

In particular:

name: ...
version: ...
environment:
  B: correct
  A: $B

Expands, via snapd, to B=correct, A=correct

When re-ordered alphabetically this property is lost.

Chris Patterson (cjp256)
Changed in snapcraft:
assignee: nobody → Chris Patterson (cjp256)
status: New → Confirmed
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

Well, this is exactly what YAML is https://yaml.org/spec/1.2/spec.html#id2765608

If you wanted order, then you should allow a sequence as input.

Changed in snapcraft:
status: Confirmed → Opinion
Changed in snapcraft:
status: Opinion → Fix Committed
importance: Undecided → Low
Revision history for this message
Samuele Pedroni (pedronis) wrote :

we might decide to change the syntax to at least deprecate the current syntax in snap.yaml (though basically we'll have to keep supporting it) and prefer

- VAR1: VALUE1
- VAR2: VALUE2

but I don't see this happen quickly.

snapcraft.yaml could be slightly more aggressive in switching over

Changed in snapd:
importance: Undecided → Medium
status: New → Triaged
Changed in snapcraft:
status: Fix Committed → Fix Released
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.