Skip to content

new action: 'pmbootstrap repo_missing'

Oliver Smith requested to merge feature/build-order into master

Here comes a big one, split into two commits. On demand I could split up the second commit further, to put each refactoring into its own commit.

@MartijnBraam: would be great if you could test (and ideally also review) it, to make sure it works well with the build.postmarketos.org code that you have been working on.

Related: postmarketos.org#78 (closed), build.postmarketos.org#3 (closed)

example output

$ pmbootstrap repo_missing -h
usage: pmbootstrap repo_missing [-h] [--arch {armhf,aarch64,x86_64,x86}]
                                [--built] [--overview]
                                [package]

positional arguments:
  package               only look at a specific package and its dependencies

optional arguments:
  -h, --help            show this help message and exit
  --arch {armhf,aarch64,x86_64,x86}
  --built               include packages which exist in the binary repos
  --overview            only print the pkgnames without any details
$ pmbootstrap repo_missing --overview --arch=armhf device-samsung-i9100 --built
[10:06:23] Calculate packages that need to be built (device-samsung-i9100, armhf) - this may take some time
[
    "busybox-static-armhf",
    "charging-sdl",
    "device-samsung-i9100",
    "devicepkg-dev",
    "libsamsung-ipc",
    "linux-samsung-i9100",
    "osk-sdl",
    "postmarketos-base",
    "postmarketos-mkinitfs",
    "postmarketos-splash",
    "triggerhappy"
]
[10:06:26] Done
$ pmbootstrap pkgrel_bump hello-world
[10:08:11] Increase 'hello-world' pkgrel (4 -> 5)
[10:08:11] Done
$ pmbootstrap repo_missing           
[10:08:17] Calculate packages that need to be built (all packages, x86_64) - this may take some time
[
    {
        "pkgname": "hello-world",
        "repo": "main",
        "version": "1-r5",
        "depends": []
    }
]
[10:08:32] Done

commits

build.find_aport() -> helpers.pmaports.find()

Move find_aport() and find_aport_guess_main() from pmb/build/other.py to the new file pmb/helpers/pmaports.py.

Finding aports is not only needed when building packages, hence it makes sense to move it out of pmb.build. The pmb/helpers/pmaports.py file will have more pmaports related functions in the next commit:

new action: 'pmbootstrap repo_missing'

Add a new action that lists all aports, for which no binary packages exist. Only list packages that can be built for the relevant arch (specified with --arch). This works recursively: when a package can be built for a certain arch, but one of its dependencies (or their depends) can not be built for that arch, then don't list it.

This action will be used for the new sr.ht based build infrastructure, to figure out which packages need to be built ahead of time (so we can trigger each of them as single build job). Determining the order of the packages to be built is not determined with pmbootstrap, the serverside code of build.postmarketos.org takes care of that.

For testing purposes, a single package can also be specified and the action will list if it can be built for that arch with its dependencies, and what needs to be built exactly.

Add pmb/helpers/package.py to hold functions that work on both pmaports and (binary package) repos - in contrary to the existing pmb/helpers/pmaports.py (see previous commit) and pmb/helpers/repo.py, which only work with one of those.

Refactoring:

  • pmb/helpers/pmaports.py: add a get_list() function, which lists all aports and use it instead of writing the same glob loop over and over
  • add pmb.helpers.pmaports.get(), which finds an APKBUILD and parses it in one step.
  • rename pmb.build._package.check_arch to ...check_arch_abort to distinguish it from the other check_arch function

(please do not squash!)

Merge request reports