Don't generate relay list at build time

This commit is contained in:
Joakim Hulthe
2026-04-24 09:23:05 +02:00
parent 71776145db
commit 3867f9acdc
3 changed files with 14 additions and 18 deletions

View File

@@ -25,9 +25,7 @@ makedepends="
libnftnl-dev libnftnl-dev
" "
install=" install="
$pkgname.post-install
$pkgname.pre-upgrade $pkgname.pre-upgrade
$pkgname.post-upgrade
$pkgname.pre-deinstall $pkgname.pre-deinstall
$pkgname.post-deinstall $pkgname.post-deinstall
$pkgname-systemd.post-install $pkgname-systemd.post-install
@@ -51,12 +49,6 @@ prepare() {
default_prepare default_prepare
cargo fetch --target "$CHOST" --locked cargo fetch --target "$CHOST" --locked
# Generate vendored relay list
cargo run --frozen \
-p mullvad-api --bin relay_list \
--target "$CHOST" \
> "$builddir/relays.json"
} }
build() { build() {
@@ -90,10 +82,12 @@ package() {
install -m755 -D "$_cargo_release_dir/mullvad-setup" \ install -m755 -D "$_cargo_release_dir/mullvad-setup" \
"$pkgdir/usr/bin/mullvad-setup" "$pkgdir/usr/bin/mullvad-setup"
# Bundle the vendored relay list. # TODO: Bundle a relay list.
# It's copied to /var/cache/mullvad-vpn/ by the post-* scripts. # We can't generate one at build time since that would break build reproducibility.
install -m644 -D "$builddir/relays.json" \ # Once mullvad starts checking a relay list into their release branches, we can bundle that.
"$pkgdir/usr/share/mullvad-vpn/relays.json" #install -m644 -D "$builddir/<todo>/relays.json" \
# "$pkgdir/usr/share/mullvad-vpn/relays.json"
# TODO: Copy relay list into /var/cache/ in post-upgrade/post-install
} }
systemd() { systemd() {

View File

@@ -1,7 +1,8 @@
#!/bin/sh #!/bin/sh
set -eu set -eu
# TODO: see `package()` in APKBUILD
# Copy vendored relay list into place # Copy vendored relay list into place
mkdir -p /var/cache/mullvad-vpn \ # mkdir -p /var/cache/mullvad-vpn \
&& cp /usr/share/mullvad-vpn/relays.json /var/cache/mullvad-vpn/relays.json \ # && cp /usr/share/mullvad-vpn/relays.json /var/cache/mullvad-vpn/relays.json \
|| echo "failed to install /var/cache/mullvad-vpn/relays.json" # || echo "failed to install /var/cache/mullvad-vpn/relays.json"

View File

@@ -1,7 +1,8 @@
#!/bin/sh #!/bin/sh
set -eu set -eu
# TODO: see `package()` in APKBUILD
# Overwrite the cached relay list with the vendored one. # Overwrite the cached relay list with the vendored one.
mkdir -p /var/cache/mullvad-vpn \ # mkdir -p /var/cache/mullvad-vpn \
&& cp /usr/share/mullvad-vpn/relays.json /var/cache/mullvad-vpn/relays.json \ # && cp /usr/share/mullvad-vpn/relays.json /var/cache/mullvad-vpn/relays.json \
|| echo "failed to install /var/cache/mullvad-vpn/relays.json" # || echo "failed to install /var/cache/mullvad-vpn/relays.json"