Skip to content
Snippets Groups Projects
Verified Commit 96f887b1 authored by Clayton Craft's avatar Clayton Craft :speech_balloon:
Browse files

ci: build_changed_aports: fix building changed aports in extra-repos/systemd

With this change, the build test will only build changed aports when
they are in an enabled repo. It will also detect when a changed aport is
in extra-repos/systemd, and build it later with systemd support enabled.
parent 606d69fc
No related branches found
No related tags found
No related merge requests found
Pipeline #204081 canceled
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Copyright 2021 Oliver Smith # Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
import sys import sys
import os
import pathlib import pathlib
# Same dir # Same dir
...@@ -9,6 +10,7 @@ import common ...@@ -9,6 +10,7 @@ import common
# pmbootstrap # pmbootstrap
import add_pmbootstrap_to_import_path import add_pmbootstrap_to_import_path
import pmb.core
import pmb.parse import pmb.parse
import pmb.parse._apkbuild import pmb.parse._apkbuild
import pmb.helpers.pmaports import pmb.helpers.pmaports
...@@ -66,9 +68,29 @@ if __name__ == "__main__": ...@@ -66,9 +68,29 @@ if __name__ == "__main__":
args = pmb.parse.arguments() args = pmb.parse.arguments()
context = get_context() context = get_context()
# Filter out packages that can't be built for given arch # Get set of all buildable packages for the enabled repos, for skipping unbuildable
# aports later. We might be given a changed aport from e.g. extra-repos/systemd when
# that repo is not enabled
buildable_pkgs = set()
for path in pmb.core.pkgrepo.pkgrepo_iter_package_dirs():
buildable_pkgs.add(os.path.basename(path))
# To store a list of packages from extra-repos/systemd for special handling later:
systemd_pkgs = list()
# Filter out packages that either:
# 1. can't be built for given arch
# 2. are not found in enabled repos
# (Iterate over copy of packages, because we modify it in this loop) # (Iterate over copy of packages, because we modify it in this loop)
for package in packages.copy(): for package in packages.copy():
if package not in buildable_pkgs:
print(f"{package}: not in any available repos, skipping")
packages.remove(package)
# FIXME: this should probably be more generic, if other repos are added later?
# This just tosses the package into the list of packages to try building later w/ systemd enabled, and assumes it'll be found there.
systemd_pkgs.append(package)
continue
apkbuild_path = pmb.helpers.pmaports.find(package) apkbuild_path = pmb.helpers.pmaports.find(package)
apkbuild = pmb.parse._apkbuild.apkbuild(pathlib.Path(apkbuild_path, "APKBUILD")) apkbuild = pmb.parse._apkbuild.apkbuild(pathlib.Path(apkbuild_path, "APKBUILD"))
...@@ -84,3 +106,10 @@ if __name__ == "__main__": ...@@ -84,3 +106,10 @@ if __name__ == "__main__":
# Build packages # Build packages
print(f"building in strict mode for {arch}: {', '.join(packages)}") print(f"building in strict mode for {arch}: {', '.join(packages)}")
build_strict(packages, arch) build_strict(packages, arch)
# Build packages in extra-repos/systemd
# FIXME: this should probably be more generic, if other repos are added later?
if systemd_pkgs:
print(f"building in strict mode for {arch}, from extra-repos/systemd: {', '.join(packages)}")
common.run_pmbootstrap(["config", "systemd", "always"])
build_strict(systemd_pkgs, arch)
...@@ -145,31 +145,61 @@ build-x86_64: ...@@ -145,31 +145,61 @@ build-x86_64:
script: script:
- .ci/build-x86_64.sh - .ci/build-x86_64.sh
build-x86_64-systemd:
extends: build-x86_64
variables:
PMBOOTSTRAP_SYSTEMD: "1"
build-x86: build-x86:
extends: .build extends: .build
script: script:
- .ci/build-x86.sh - .ci/build-x86.sh
build-x86-systemd:
extends: build-x86
variables:
PMBOOTSTRAP_SYSTEMD: "1"
build-aarch64: build-aarch64:
extends: .build extends: .build
script: script:
- .ci/build-aarch64.sh - .ci/build-aarch64.sh
build-aarch64-systemd:
extends: build-aarch64
variables:
PMBOOTSTRAP_SYSTEMD: "1"
build-armv7: build-armv7:
extends: .build extends: .build
script: script:
- .ci/build-armv7.sh - .ci/build-armv7.sh
build-armv7-systemd:
extends: build-armv7
variables:
PMBOOTSTRAP_SYSTEMD: "1"
build-armhf: build-armhf:
extends: .build extends: .build
script: script:
- .ci/build-armhf.sh - .ci/build-armhf.sh
build-armhf-systemd:
extends: build-armhf
variables:
PMBOOTSTRAP_SYSTEMD: "1"
build-riscv64: build-riscv64:
extends: .build extends: .build
script: script:
- .ci/build-riscv64.sh - .ci/build-riscv64.sh
build-riscv64-systemd:
extends: build-riscv64
variables:
PMBOOTSTRAP_SYSTEMD: "1"
auto-update: auto-update:
stage: autoupdate stage: autoupdate
rules: rules:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment