Snapcraft.yaml reference

Missing a hyperlink: https://www.freedesktop.org/software/systemd/man/systemd.service.html#RestartSec=

Now added - thanks for the suggestion/fix!

1 Like

I believe the first entry here, ā€œnameā€, also has a max length of 40 characters.

1 Like

I see no reference to ā€œbuild-baseā€, should that not be mentioned here?

1 Like

This claims that ā€œversion-scriptā€ is deprecated, but in the current snapcraft/projects.py schema file, it does not even appear. And as far back as 2019 in snapcraft code:

git show ab7c81969718e2ef10788f1d676a1e83245d3b44

  • Raise error if version-script is used, itā€™s being deprecated in favour of snapcraftctl set-version scriptlet.

Or maybe Iā€™m misreading that. Is it deprecated or truly dead?

Thanks for flagging those issues. Iā€™ve updated the page accordingly and I think Iā€™ll add a note to say version-script applies only to legacy versions of Snapcraft, as I think it probably still works with those eg. 4.x/stable (I checked but couldnā€™t get it building).

While the keywords ā€˜build-packagesā€™, ā€˜build-snapsā€™, ā€˜stage-packagesā€™ and ā€˜stage-snapsā€™ are defined here as being under the ā€œparts:ā€ hierarchy, are they not also available at the meta-data (root) level of a snapcraft.yaml file?

Wait, that probably should have said that just the ā€œbuild-ā€ keywords should be listed as global.

Should this list not include the ā€œepoch:ā€ keyword?

I see no mention of the top-level ā€˜package-repositoriesā€™ keyword. Additionally, Iā€™m cross-checking the list here, https://github.com/rpjday/craft-parts/blob/main/craft_parts/parts.py#L33-L64, and a number of those variables donā€™t seem to be mentioned on this page: disable-parallel, and the three overlay-* variables. Also, the filesets keyword is gone for now, not clear if it is returning. Oh, and thereā€™s that ā€œpermissionsā€ keyword, I am unfamiliar with that one.

Thanks for flagging these. Iā€™ve added epochs and package-repositories and will look into the others (disable-parallel seems old, but I can see what it does).

And sorry if Iā€™m missing something obvious, but whatā€™s the advantage of listing the build-* keywords as global keywords? How might they be used in this way? Thanks!

They can be listed globally to just install all those packages/snaps in the build environment, regardless of which part is being built.

Thanks - Iā€™ll add them!

I have a few more snapcraft keywords that donā€™t appear to be listed here:

  • aliases (might be deprecated/obsolete)
  • completer
  • bus-name
  • activates-on
  • daemon-scope

You can cross-check against https://github.com/snapcore/snapcraft/blob/main/snapcraft/projects.py#L236

Brilliant, thank you - Iā€™ll make sure theyā€™re added/investigated and Iā€™ll update this comment when theyā€™re done.

yes, this is obsolete, I wouldnā€™t bother documenting at this point

this is part of an experimental feature (user services)

1 Like

I think that might be the entirety of my proofreading.

For items like parts.<part-name>.organize, can we add to the description in which environment the file path in the key exists? For example with stage, I think it would be ā€œIn the key/value pair, the key represents the path of a file inside the part install directory and the value represents how the file is going to be stagedā€? This took some trial and error to figure out when doing an override-build first so I knew where to put my build artifacts to be reached by organize

Is there an error in the docs here: https://snapcraft.io/docs/snapcraft-yaml-reference ?

parts.<part-name>.parse-info Type: string but snapcraft refuses it as string, it wants list.

Thank for flagging this. I think youā€™re correct - Iā€™ve updated the doc.

1 Like

Seems like for parts.<part-name>.source-type, a few of the allowed enum values get cut off and replaced by an ellipsis ... when viewing the documentation through snapcraft.io:

I figured tar would be an acceptable source type, but I could only verify this by clicking to view the discourse page instead. Could we potentially change the page setting so that longer code blocks are not truncated and replaced with an ellipsis and instead wrap to the next line?