Skip to content

Commit

Permalink
Merge pull request canonical#286 from simondeziel/faster-snap-builds
Browse files Browse the repository at this point in the history
Faster snap builds
tomponline authored Jan 26, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents d512119 + ce50982 commit 1a0d53e
Showing 1 changed file with 93 additions and 98 deletions.
191 changes: 93 additions & 98 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -224,9 +224,9 @@ parts:

criu:
source: https://github.com/checkpoint-restore/criu
source-depth: 1
source-tag: v3.19
source-type: git
source-depth: 1
plugin: nil
build-packages:
- asciidoc
@@ -242,21 +242,13 @@ parts:
- libnet1
- libprotobuf-c1
override-pull: |-
[ "$(uname -m)" != "x86_64" ] && \
[ "$(uname -m)" != "armv7l" ] && \
[ "$(uname -m)" != "aarch64" ] && \
[ "$(uname -m)" != "s390x" ] && \
[ "$(uname -m)" != "ppc64le" ] && exit 0
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && [ "$(uname -m)" != "armv7l" ] && exit 0
craftctl default
override-build: |-
[ "$(uname -m)" != "x86_64" ] && \
[ "$(uname -m)" != "armv7l" ] && \
[ "$(uname -m)" != "aarch64" ] && \
[ "$(uname -m)" != "s390x" ] && \
[ "$(uname -m)" != "ppc64le" ] && exit 0
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && [ "$(uname -m)" != "armv7l" ] && exit 0
set -ex
make USERCFLAGS=-Wno-error=format-truncation
make USERCFLAGS=-Wno-error=format-truncation criu
mkdir -p "${CRAFT_PART_INSTALL}/criu/"
cp criu/criu "${CRAFT_PART_INSTALL}/criu/"
organize:
@@ -271,8 +263,8 @@ parts:
- raft
- sqlite
source: https://github.com/canonical/dqlite
source-type: git
source-depth: 1
source-type: git
plugin: autotools
autotools-configure-parameters:
- --prefix=
@@ -290,18 +282,14 @@ parts:
after:
- nasm
source: https://github.com/tianocore/edk2
source-type: git
source-tag: IRRELEVANT
source-depth: 1
source-tag: IRRELEVANT
source-type: git
plugin: nil
build-packages:
- g++
- on amd64:
- acpica-tools
- uuid-dev
- on arm64:
- acpica-tools
- uuid-dev
- acpica-tools
- uuid-dev
override-pull: |-
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && exit 0
set -ex
@@ -407,8 +395,10 @@ parts:

libmnl:
source: https://git.netfilter.org/libmnl
source-type: git
# XXX: git.netfilter.org does not support depth/shallow clones
#source-depth: 1
source-tag: libmnl-1.0.5
source-type: git
plugin: autotools
autotools-configure-parameters:
- --prefix=
@@ -421,8 +411,10 @@ parts:
after:
- libmnl
source: https://git.netfilter.org/libnftnl
source-type: git
# XXX: git.netfilter.org does not support depth/shallow clones
#source-depth: 1
source-tag: libnftnl-1.2.6
source-type: git
plugin: autotools
autotools-configure-parameters:
- --prefix=
@@ -437,9 +429,9 @@ parts:
libseccomp:
source: https://github.com/seccomp/libseccomp
source-type: git
source-tag: v2.5.5
source-depth: 1
source-tag: v2.5.5
source-type: git
plugin: autotools
autotools-configure-parameters:
- --prefix=
@@ -452,9 +444,9 @@ parts:

libtpms:
source: https://github.com/stefanberger/libtpms
source-type: git
source-tag: v0.9.6
source-depth: 1
source-tag: v0.9.6
source-type: git
plugin: autotools
autotools-configure-parameters:
- --prefix=
@@ -467,9 +459,9 @@ parts:

liburing:
source: https://github.com/axboe/liburing
source-type: git
source-tag: liburing-2.5
source-depth: 1
source-tag: liburing-2.5
source-type: git
plugin: autotools
autotools-configure-parameters:
- --prefix=
@@ -486,9 +478,9 @@ parts:

libusb:
source: https://github.com/libusb/libusb
source-type: git
source-tag: v1.0.26
source-depth: 1
source-tag: v1.0.26
source-type: git
plugin: autotools
autotools-configure-parameters:
- --prefix=
@@ -543,9 +535,9 @@ parts:

minio:
source: https://github.com/minio/minio
source-type: git
source-tag: RELEASE.2023-11-20T22-40-07Z
source-depth: 1
source-tag: RELEASE.2023-11-20T22-40-07Z
source-type: git
plugin: nil
build-snaps:
- go
@@ -582,17 +574,21 @@ parts:

nasm:
source: https://github.com/netwide-assembler/nasm
source-type: git
source-tag: nasm-2.16.01
source-depth: 1
source-tag: nasm-2.16.01
source-type: git
plugin: autotools
autotools-configure-parameters:
- --prefix=
organize:
usr/bin/: bin/
prime:
- bin/nasm
override-pull: |-
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && exit 0
craftctl default
override-build: |
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && exit 0
patch -p1 < "${CRAFT_PROJECT_DIR}/patches/nasm-0000-disable-manpages.patch"
craftctl default
@@ -601,8 +597,10 @@ parts:
- libmnl
- libnftnl
source: https://git.netfilter.org/nftables
source-type: git
# XXX: git.netfilter.org does not support depth/shallow clones
#source-depth: 1
source-tag: v1.0.9
source-type: git
plugin: autotools
autotools-configure-parameters:
- --prefix=
@@ -634,9 +632,9 @@ parts:
after:
- libseccomp
source: https://github.com/NVIDIA/libnvidia-container
source-type: git
source-tag: v1.14.3
source-depth: 1
source-tag: v1.14.3
source-type: git
plugin: make
build-packages:
- bmake
@@ -680,9 +678,9 @@ parts:

openvswitch:
source: https://github.com/openvswitch/ovs
source-type: git
source-tag: v3.2.1
source-depth: 1
source-tag: v3.2.1
source-type: git
plugin: autotools
autotools-configure-parameters:
- --enable-ssl
@@ -704,9 +702,9 @@ parts:
after:
- openvswitch
source: https://github.com/ovn-org/ovn
source-type: git
source-tag: v23.09.1
source-depth: 1
source-tag: v23.09.1
source-type: git
plugin: autotools
autotools-configure-parameters:
- --enable-ssl
@@ -718,22 +716,29 @@ parts:

spice-protocol:
source: https://gitlab.freedesktop.org/spice/spice-protocol
source-type: git
source-tag: v0.14.4
source-depth: 1
source-tag: v0.14.4
source-type: git
plugin: meson
prime: []
build-packages:
- meson
- ninja-build
override-pull: |-
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && exit 0
craftctl default
override-build: |-
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && exit 0
craftctl default
spice-server:
after:
- spice-protocol
source: https://gitlab.freedesktop.org/spice/spice
source-type: git
source-tag: v0.15.2
source-depth: 1
source-tag: v0.15.2
source-type: git
plugin: meson
meson-parameters:
- --prefix=/
@@ -753,6 +758,13 @@ parts:
stage-packages:
- libjpeg-turbo8
- libpixman-1-0
override-pull: |-
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && exit 0
craftctl default
override-build: |-
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && exit 0
craftctl default
organize:
sbin/: bin/
usr/lib: lib/
@@ -767,9 +779,9 @@ parts:
- libseccomp
- libtpms
source: https://github.com/stefanberger/swtpm
source-type: git
source-tag: v0.8.1
source-depth: 1
source-tag: v0.8.1
source-type: git
plugin: autotools
autotools-configure-parameters:
- --prefix=
@@ -803,9 +815,9 @@ parts:
- spice-protocol
- spice-server
source: https://gitlab.com/qemu-project/qemu
source-type: git
source-tag: v8.1.3
source-depth: 1
source-tag: v8.1.3
source-type: git
plugin: autotools
autotools-configure-parameters:
- --disable-bochs
@@ -953,8 +965,8 @@ parts:

raft:
source: https://github.com/canonical/raft
source-type: git
source-depth: 1
source-type: git
plugin: autotools
autotools-configure-parameters:
- --prefix=
@@ -972,9 +984,9 @@ parts:

sqlite:
source: https://github.com/sqlite/sqlite
source-type: git
source-depth: 1
source-tag: version-3.44.2
source-type: git
plugin: autotools
autotools-configure-parameters:
- --prefix=
@@ -986,9 +998,9 @@ parts:

squashfs-tools-ng:
source: https://github.com/AgentD/squashfs-tools-ng
source-type: git
source-tag: v1.2.0
source-depth: 1
source-tag: v1.2.0
source-type: git
plugin: autotools
autotools-configure-parameters:
- --prefix=
@@ -1001,9 +1013,9 @@ parts:

virtiofsd:
source: https://gitlab.com/virtio-fs/virtiofsd
source-type: git
source-tag: v1.8.0
source-depth: 1
source-tag: v1.8.0
source-type: git
plugin: rust
build-packages:
- cargo
@@ -1072,9 +1084,9 @@ parts:
zfs-0-8:
source: https://github.com/openzfs/zfs
source-type: git
source-tag: zfs-0.8.6
source-depth: 1
source-tag: zfs-0.8.6
source-type: git
plugin: autotools
autotools-configure-parameters:
- --prefix=/
@@ -1085,16 +1097,10 @@ parts:
- uuid-dev
- zlib1g-dev
override-pull: |-
[ "$(uname -m)" != "x86_64" ] && \
[ "$(uname -m)" != "aarch64" ] && \
[ "$(uname -m)" != "s390x" ] && \
[ "$(uname -m)" != "ppc64le" ] && exit 0
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && exit 0
craftctl default
override-build: |-
[ "$(uname -m)" != "x86_64" ] && \
[ "$(uname -m)" != "aarch64" ] && \
[ "$(uname -m)" != "s390x" ] && \
[ "$(uname -m)" != "ppc64le" ] && exit 0
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && exit 0
craftctl default
set -ex
@@ -1110,9 +1116,9 @@ parts:
zfs-2-0:
source: https://github.com/openzfs/zfs
source-type: git
source-tag: zfs-2.0.7
source-depth: 1
source-tag: zfs-2.0.7
source-type: git
plugin: autotools
autotools-configure-parameters:
- --prefix=/
@@ -1123,16 +1129,10 @@ parts:
- uuid-dev
- zlib1g-dev
override-pull: |-
[ "$(uname -m)" != "x86_64" ] && \
[ "$(uname -m)" != "aarch64" ] && \
[ "$(uname -m)" != "s390x" ] && \
[ "$(uname -m)" != "ppc64le" ] && exit 0
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && exit 0
craftctl default
override-build: |-
[ "$(uname -m)" != "x86_64" ] && \
[ "$(uname -m)" != "aarch64" ] && \
[ "$(uname -m)" != "s390x" ] && \
[ "$(uname -m)" != "ppc64le" ] && exit 0
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && exit 0
craftctl default
set -ex
@@ -1148,9 +1148,9 @@ parts:
zfs-2-1:
source: https://github.com/openzfs/zfs
source-type: git
source-tag: zfs-2.1.14
source-depth: 1
source-tag: zfs-2.1.14
source-type: git
plugin: autotools
autotools-configure-parameters:
- --prefix=/
@@ -1161,16 +1161,10 @@ parts:
- uuid-dev
- zlib1g-dev
override-pull: |-
[ "$(uname -m)" != "x86_64" ] && \
[ "$(uname -m)" != "aarch64" ] && \
[ "$(uname -m)" != "s390x" ] && \
[ "$(uname -m)" != "ppc64le" ] && exit 0
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && exit 0
craftctl default
override-build: |-
[ "$(uname -m)" != "x86_64" ] && \
[ "$(uname -m)" != "aarch64" ] && \
[ "$(uname -m)" != "s390x" ] && \
[ "$(uname -m)" != "ppc64le" ] && exit 0
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && exit 0
craftctl default
set -ex
@@ -1186,9 +1180,9 @@ parts:
zfs-2-2:
source: https://github.com/openzfs/zfs
source-type: git
source-tag: zfs-2.2.2
source-depth: 1
source-tag: zfs-2.2.2
source-type: git
plugin: autotools
autotools-configure-parameters:
- --prefix=/
@@ -1199,16 +1193,10 @@ parts:
- uuid-dev
- zlib1g-dev
override-pull: |-
[ "$(uname -m)" != "x86_64" ] && \
[ "$(uname -m)" != "aarch64" ] && \
[ "$(uname -m)" != "s390x" ] && \
[ "$(uname -m)" != "ppc64le" ] && exit 0
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && exit 0
craftctl default
override-build: |-
[ "$(uname -m)" != "x86_64" ] && \
[ "$(uname -m)" != "aarch64" ] && \
[ "$(uname -m)" != "s390x" ] && \
[ "$(uname -m)" != "ppc64le" ] && exit 0
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && exit 0
craftctl default
set -ex
@@ -1238,6 +1226,7 @@ parts:
after:
- libseccomp
source: https://github.com/lxc/lxc
source-depth: 1
source-type: git
build-packages:
- dpkg-dev
@@ -1292,6 +1281,7 @@ parts:
lxcfs:
source: https://github.com/lxc/lxcfs
source-depth: 1
source-type: git
build-packages:
- libfuse3-dev
@@ -1343,6 +1333,7 @@ parts:
lxd:
source: https://github.com/canonical/lxd
source-depth: 1
source-type: git
after:
- lxc
@@ -1491,6 +1482,7 @@ parts:

lxd-ui:
source: https://github.com/canonical/lxd-ui
source-depth: 1
source-type: git
plugin: nil
override-pull: |
@@ -1592,8 +1584,11 @@ parts:
-exec strip -s {} +
# Strip binaries not under bin/ due to being dynamically
# added to the path with `snap set lxd`
strip -s "${CRAFT_PRIME}/criu/criu" # snap set lxd criu.enable=true
# added to the path with `snap set lxd`, like `criu.enable=true`
for binary in "${CRAFT_PRIME}/criu/criu"; do
[ -e "${binary}" ] || continue
strip -s "${binary}"
done
# Strip all versions of zfs utils
for v in "${CRAFT_PRIME}"/zfs-*; do

0 comments on commit 1a0d53e

Please sign in to comment.