blob: 1a455565814f7789733d05579081a7f800bf4b98 [file] [log] [blame]
Nathan Skrzypczaka2c95092021-10-08 14:05:58 +02001.. _snap_doc:
2
3VPP Snap Build
4==============
5
6The external dependency package will not build in the snapcraft vm. The
7path of least resistance is to copy it to the root of the (original)
8workspace before running the prep script.
9
10Snapcraft has mount issues except under /home. Run the prep script and
11copy the entire directory (including the .tgz file) under
12/home/yourself.
13
14Run the prep script
15-------------------
16
17::
18
19 $ cd <vpp-workspace>/extras/snap
20 $ ./prep
21
22Copy data to /home (if necessary)
23
24::
25
26 $ mkdir /home/xxx
27 $ cd <vpp-workspace>/extras/snap
28 $ cp * /home/xxx
29
30 Set snapcraft environment variables
31 -----------------------------------
32
33 Minimum requirements:
34
35SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY=16G
36SNAPCRAFT_BUILD_ENVIRONMENT_DISK=32G
37
38::
39
40
41 Optional:
42
43SNAPCRAFT_BUILD_ENVIRONMENT_CPU=8 SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=yes
44
45::
46
47
48 Run snapcraft
49 -------------
50
51 With luck, simply running snapcraft will produce the snap
52
53$ snapcraft [–debug]
54
55::
56
57
58 Rerunning snapcraft phases
59 --------------------------
60
61 Here's how to (re)run individual phases, to avoid starting from
62 scratch N times in case of errors:
63
64snapcraft pull [] snapcraft build [] snapcraft stage [] snapcraft prime
65[] snapcraft snap or snapcraft
66
67::
68
69
70 Restart without rebuilding VM
71 -----------------------------
72
73 To restart from scratch without rebuilding the VM:
74
75snapcraft clean vpp
76
77::
78
79
80 Delete (all) snapcraft VMs
81 --------------------------
82
83for vm in $(multipass list \| awk ‘{print $1}’ \| grep ^snapcraft-); do
84multipass delete $vm –purge done \``\`