forked from Mirror/pmbootstrap
pmb.build.package: fix strict mode
In strict mode, pmbootstrap uninstalls packages between builds. This was broken since we switched from installing dependencies via abuild to pmbootstrap since our code doesn't use "--virtual .makedepends-…" when installing the makedepends: (088776) [15:32:34] (native) % cd /home/pmos/build; busybox su pmos -c SUDO_APK='abuild-apk --no-progress' HOME=/home/pmos abuild undeps ; ERROR: No such package: .makedepends-systemd-stage0 Instead of restoring the logic and worrying about uninstalling deps in the right chroots, just zap all chroots in strict mode. I've also considered implementing "--virtual .makedepends-…" again, but running zap on the chroots makes the logic much simpler, is easier to maintain and makes so little speed difference that it is worth the trade-off. We don't need to pass additional parameters fore the 2nd chroot to zap in cross-native2, no need to figure out the virtual package name in two places, etc. Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2587
This commit is contained in:
parent
fda8963ed7
commit
b982e45c8d
1 changed files with 11 additions and 13 deletions
|
@ -143,24 +143,22 @@ def finish(
|
||||||
# package we need to parse it again)
|
# package we need to parse it again)
|
||||||
pmb.parse.apkindex.clear_cache(out_dir / arch / "APKINDEX.tar.gz")
|
pmb.parse.apkindex.clear_cache(out_dir / arch / "APKINDEX.tar.gz")
|
||||||
|
|
||||||
# Uninstall build dependencies (strict mode)
|
# Zap chroots (strict mode)
|
||||||
if strict or "pmb:strict" in apkbuild["options"]:
|
zap_reason = None
|
||||||
logging.info(f"({chroot}) uninstall build dependencies")
|
if "pmb:strict" in apkbuild["options"]:
|
||||||
pmb.chroot.user(
|
zap_reason = "pmb:strict in APKBUILD"
|
||||||
["abuild", "undeps"],
|
elif strict:
|
||||||
chroot,
|
zap_reason = "running with --strict"
|
||||||
Path("/home/pmos/build"),
|
|
||||||
env={"SUDO_APK": "abuild-apk --no-progress"},
|
if zap_reason:
|
||||||
)
|
logging.info(f"({chroot}) zapping chroots ({zap_reason})")
|
||||||
# If the build depends contain postmarketos-keys or postmarketos-base,
|
pmb.chroot.zap(False)
|
||||||
# abuild will have removed the postmarketOS repository key (pma#1230)
|
|
||||||
pmb.chroot.init_keys()
|
|
||||||
|
|
||||||
logging.info(f"@YELLOW@=>@END@ @BLUE@{channel}/{apkbuild['pkgname']}@END@: Done!")
|
logging.info(f"@YELLOW@=>@END@ @BLUE@{channel}/{apkbuild['pkgname']}@END@: Done!")
|
||||||
|
|
||||||
# If we just built a package which is used to build other packages, then
|
# If we just built a package which is used to build other packages, then
|
||||||
# update the buildroot to use the newly built version.
|
# update the buildroot to use the newly built version.
|
||||||
if apkbuild["pkgname"] in pmb.config.build_packages:
|
if not zap_reason and apkbuild["pkgname"] in pmb.config.build_packages:
|
||||||
logging.info(
|
logging.info(
|
||||||
f"NOTE: Updating package {apkbuild['pkgname']} in buildroot since it's"
|
f"NOTE: Updating package {apkbuild['pkgname']} in buildroot since it's"
|
||||||
" used for building..."
|
" used for building..."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue