Snapcraft.yaml reference

Thanks so much for pointing this out. Something must have changed in the way we render the table. I’ll chase this up and get this fixed asap. Thanks!

The possible values for the snap’s type are different between these docs:

The latter does not include ‘core’ as a possible snap type. Also, there seems to be no separate page devoted to the explanation of the snaps with the type core.

The “core” type is historical and only used for the “core” snap. No other snap should sport the “core” type. I’m not even sure snapcraft can build a “core” snap, I know the core snap itself is not built using snapcraft. This is for context, not saying that our docs shouldn’t be clearer on this.

1 Like

Thanks for the added context (and the original query). I’ve now added notes to both of those documents to say that the core type has been deprecated.

cc @dmitry.lyfar

1 Like

I noticed that it is possible to set global environment variables for a snap via environment key in snapcraft.yaml, but it isn’t documented. This is very useful, because these environment variables propagate to all hooks and apps with fewer repetition.

The meta/snap.yaml file for a core22 based snap has the following:

environment:
  LD_LIBRARY_PATH: ${SNAP_LIBRARY_PATH}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
  PATH: $SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH

The current drawback when making changes to the above two variables via snapcraft.yaml is that the snap loses the additions made by snapcraft.

1 Like

Hello! Thanks so much for mentioning this, and you’re absolutely right. I have added this now, but I’ve also created a todo task to cover global environment variables in more detail.

1 Like