Skip to content

Commit afd05be

Browse files
authored
perf(snap): speed up repeat snap builds (canonical#1323)
1 parent 7c3170d commit afd05be

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

requirements-focal.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.0.1ubuntu0.20.04.1/python-apt_2.0.1ubuntu0.20.04.1.tar.xz; sys_platform == 'linux'
1+
python-apt@https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.0.1ubuntu0.20.04.1/python-apt_2.0.1ubuntu0.20.04.1.tar.xz

requirements-jammy.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.4.0ubuntu2/python-apt_2.4.0ubuntu2.tar.xz; sys_platform == 'linux'
1+
python-apt@https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.4.0ubuntu2/python-apt_2.4.0ubuntu2.tar.xz

snap/snapcraft.yaml

+16-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ parts:
7575
# As of cryptography 39, it requires rust v1.48.0 or newer, which is available from focal-updates.
7676
# This part builds the wheel for cryptography.
7777
cryptography-deps:
78-
plugin: dump
78+
plugin: nil
7979
source: .
8080
build-packages:
8181
- cargo
@@ -115,8 +115,22 @@ parts:
115115
snapcraftctl build
116116
install -D -m 0755 $SNAPCRAFT_PROJECT_DIR/snap/local/sitecustomize.py $SNAPCRAFT_PART_INSTALL/usr/lib/python3.8/sitecustomize.py
117117
118+
python-apt:
119+
after: [python3]
120+
plugin: nil
121+
source: .
122+
build-packages:
123+
- libapt-pkg-dev
124+
- python3.8-dev
125+
- libpython3.8-dev
126+
build-environment:
127+
- LDFLAGS: -L/usr/lib/python3.8
128+
- CPPFLAGS: -I/usr/include/python3.8
129+
override-build: |
130+
pip wheel $(cat requirements-focal.txt)
131+
118132
charmcraft:
119-
after: [python3, cryptography-deps]
133+
after: [python3, cryptography-deps, python-apt]
120134
source: .
121135
plugin: python
122136
requirements:

0 commit comments

Comments
 (0)