~snappy-dev/snapcraft/core

« back to all changes in this revision

Viewing changes to docs/proposed-yaml.md

  • Committer: Michael Terry
  • Date: 2015-07-01 19:22:26 UTC
  • Revision ID: michael.terry@canonical.com-20150701192226-ubykr1oyk2rg65b4
Add yaml descriptions

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Proposed Yaml
 
2
 
 
3
This is NOT blessed yaml, but rather changes to the blessed yaml that are proposed by the snapcraft team.
 
4
 
 
5
## Plugin yaml
 
6
 
 
7
### No name
 
8
 
 
9
We don't need the name field, it is redundant with the filename.
 
10
 
 
11
### Allow config of required parts
 
12
 
 
13
"requires" should be a yaml subsection instead of a list of strings, so that configuration could be done.
 
14
 
 
15
**But what if that configuration conflicts with configuration of that same part in snapcraft.yaml?**
 
16
 
 
17
### Do we need resources?
 
18
 
 
19
Do we need this in the yaml?  Or just as part of the plugin code?  It isn't configuration.
 
20
 
 
21
### Add packages field
 
22
 
 
23
Add a "packages" field that installs Ubuntu packages into the host.
 
24
 
 
25
## snapcraft.yaml
 
26
 
 
27
### packages
 
28
 
 
29
This should be a list of packages to install into the host, rather than to include in the deb.  (and maybe renamed systemPackages)
 
30
 
 
31
Installing a package into the deb should be a part, just like every other piece of code that goes in there.  Something like:
 
32
 
 
33
parts:
 
34
  ubuntu:
 
35
    packages:
 
36
     - fswebcam
 
37
 
 
38
## General
 
39
 
 
40
### Auto parts
 
41
 
 
42
There are whole classes of parts that are nearly identical and would be a pain to upload one by one to the store.  Consider the case of an "ubuntu package" part -- all we ever need is the package name.  We don't want to upload 1000 parts.
 
43
 
 
44
I'd like to be able to have yaml like:
 
45
 
 
46
parts:
 
47
  ubuntu-wget
 
48
  part2:
 
49
    key: value
 
50
 
 
51
I propose that if we can't find a bare part's name in the store, we see if it has a hyphen and break the name in two.  If the first piece of the part name is a plugin we know about, we treat it like a part with a single "plugin: xxx" line.  For example:
 
52
 
 
53
parts:
 
54
 ubuntu-wget
 
55
 part2
 
56
 
 
57
Here, we'd internally expand ubuntu-wget to:
 
58
 
 
59
parts:
 
60
 ubuntu-wget:
 
61
  plugin: ubuntu
 
62
 part2
 
63
 
 
64
This way, we have a world of parts with little effort (where it makes sense).
 
65
 
 
66
Specifically, I think this would make sense for "ubuntu", "ros", and MAYBE "pypi3" if we can guarantee that we can automatically solve grabbing C libraries for pypi modules.  -- basically any plugin that can automatically guess what the "source" line should be.
 
67
 
 
68
The plugin would parse the name if the expected key was missing.  (In ubuntu's case, the plugin would see that the "packages" key was missing and see if the name of the part provided it.)