1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-23 20:45:08 +03:00

WIP: build: rewrite package builder (MR 2252)

The package builder has long been a pain point since it recurses the
entire dependency tree.

Convert it to run in two stages, first it walks through the package
dependencies, descending into each one and processing them in a queue.
If a package is determined to need building then it gets pushed onto the
build_queue.

Then, it pops each package off the build queue (which is actually a
stack..) and builds it.

This avoids recursion entirely and should open the door to optimisations
in the future.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-06-09 12:52:15 +02:00 committed by Oliver Smith
parent 338e0890ba
commit 3ad4ba2818
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
3 changed files with 140 additions and 175 deletions

View file

@ -37,11 +37,11 @@ def init_abuild_minimal(chroot: Chroot=Chroot.native()):
pathlib.Path(marker).touch()
def init(chroot: Chroot=Chroot.native()):
def init(chroot: Chroot=Chroot.native()) -> bool:
"""Initialize a chroot for building packages with abuild."""
marker = chroot / "tmp/pmb_chroot_build_init_done"
if marker.exists():
return
return False
# Initialize chroot, install packages
pmb.chroot.init(Chroot.native())
@ -109,6 +109,7 @@ def init(chroot: Chroot=Chroot.native()):
"/etc/abuild.conf"], chroot)
pathlib.Path(marker).touch()
return True
def init_compiler(context: Context, depends, cross, arch: Arch):