Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • alistair23/pmaports
  • exkc/pmaports
  • fossdd/pmaports
  • JustSoup321/pmaports
  • Eisenbahnfan/pmaports
  • raihan2000/pmaports
  • sleirsgoevy/pmaports
  • Adrian/pmaports
  • adamthiede/pmaports
  • jianhua/pmaports
  • knuxify/pmaports
  • Arnavion/pmaports
  • barni2000/pmaports
  • longnoserob/pmaports
  • smankusors/pmaports
  • Aren/pmaports
  • langfingaz/pmaports
  • sicelo/pmaports
  • kouta-kun/pmaports
  • craftyguy/pmaports
  • rdacayan/pmaports
  • rmader/pmaports
  • Haui111/pmaports
  • jakko/pmaports
  • dujem/pmaports
  • methanal/pmaports
  • WeirdTreeThing/pmaports
  • MightyM17/pmaports
  • sertonix/pmaports
  • amessier/pmaports
  • akemnade/pmaports
  • setotau/pmaports
  • kevinwidjaja21/pmaports
  • NekoCWD/pmaports
  • ollieparanoid/pmaports
  • manoedinata/pmaports
  • Drakulix/pmaports
  • grimler/pmaports
  • benpicco/pmaports
  • Frieder.Hannenheim/pmaports
  • andrisas/pmaports
  • EspiDev/pmaports
  • maze42/pmaports
  • anjandev/pmaports
  • danct12/pmaports
  • ijiki16/pmaports
  • jja2000/pmaports
  • fancsali/pmaports
  • bolilingmeng89006/pmaports
  • Minecrell/pmaports
  • chipiguay/pmaports
  • cherrypicker/pmaports
  • fortuna-mainline/pmaports
  • pevik/pmaports
  • Patriot-06/pmaports
  • JoseskVolpe/pmaports
  • verdre/pmaports
  • proycon/pmaports
  • AutumnSpark1226/pmaports
  • PsychoGame/pmaports
  • fraolt/pmaports
  • VaporGame/pmaports
  • pugzarecute/pmaports
  • CalcProgrammer1/pmaports
  • hexaheximal/pmaports
  • dabao1955/pmaports
  • HenriDellal/pmaports
  • semfault/pmaports
  • strobo5/pmaports
  • andrewgigena/pmaports
  • Athozus/pmaports
  • 1peter10/pmaports
  • vixalien/pmaports
  • Tooniis/pmaports
  • adomerle/pmaports
  • bjorn3/pmaports
  • StacyHarper/pmaports
  • Jack_Kekzoz/pmaports
  • Ceddicedced/pmaports
  • Justin_Zobel/pmaports
  • airtower-luna/pmaports
  • f-izzo/pmaports
  • cosmo/pmaports
  • 9lore/pmaports
  • postmarketOS/pmaports
  • Johnnynator/pmaports
  • iAboothahir/pmaports
  • N1kroks/pmaports
  • neuschaefer/pmaports
  • DylanVanAssche/pmaports
  • yehiashamaa987/pmaports
  • Operachi/pmaports
  • faveoled/pmaports
  • ilpianista/pmaports
  • johkra/pmaports
  • HDDTHR/pmaports
  • zsoltiv/pmaports
  • Justin/pmaports
  • Kaloyan501/pmaports_huawei_p8_lite_2015_fix
  • joelselvaraj/pmaports
  • rontti/pmaports
  • dsankouski/pmaports
  • StandaSK/pmaports
  • paricbat/pmaports
  • asdfugil/pmaports
  • komaru-yml/pmaports
  • MasterPlexus/pmaports
  • Felix/pmaports
  • ayakael/pmaports
  • feisuzhu/pmaports
  • AJ-RR/pmaports
  • SzczurekYT/pmaports
  • mediaberry/pmaports
  • justsomeguy/pmaports
  • Augis154/pmaports
  • hrdl/pmaports
  • sib0ndt/pmaports
  • 19atlas/pmaports
  • vipaoL/pmaports
  • wannjanjic/pmaports
  • dh/pmaports
  • LogicalErzor/pmaports
  • halamix2/pmaports
  • Shamilkv34/pmaports
  • Cogitri/pmaports
  • fallenritemonk/pmaports
  • user0-07161/pmaports
  • rock3tsprocket/pmaports
  • ellyq/pmaports
  • rodent/pmaports
  • mkorpershoek/pmaports
  • candrew/pmaports
  • fallaciousreasoning/pmaports
  • chalkin/pmaports
  • ungeskriptet/pmaports
  • r00t/pmaports
  • panpanpanpan/pmaports
  • celiffe/pmaports
  • davidfurey/pmaports
  • kidd/pmaports
  • tpikonen/pmaports
  • camelCaseNick/pmaports
  • ermine/pmaports
  • lgh/pmaports
  • sajattack/pmaports
  • StephanieBread/pmaports
  • M0Rf30/pmaports
  • notfound405/pmaports
  • samueldr/pmaports
  • r10nw7fd3/pmaports
  • treid998/pmaports-merge
  • denysvitali/pmaports
  • rodriguezst/pmaports
  • puppiestdoggo1/pmaports
  • donihalim/pmaports
  • EDKPiepaint/pmaports-apple-tonga-test
156 results
Show changes
Commits on Source (231)
Showing
with 211 additions and 136 deletions
......@@ -6,7 +6,6 @@
if [ "$(id -u)" = 0 ]; then
set -x
export PMBOOTSTRAP_TAG=master
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
......
......@@ -2,6 +2,7 @@
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import sys
import pathlib
# Same dir
import common
......@@ -11,6 +12,7 @@ import add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
import pmb.helpers.pmaports
from pmb.core.context import get_context
def build_strict(packages, arch):
......@@ -59,15 +61,16 @@ if __name__ == "__main__":
verify_checksums(packages, arch)
sys.exit(0)
# Prepare "args" to use pmbootstrap code
sys.argv = ["pmbootstrap", "chroot"]
# Load context
sys.argv = ["pmbootstrap.py", "chroot"]
args = pmb.parse.arguments()
context = get_context()
# Filter out packages that can't be built for given arch
# (Iterate over copy of packages, because we modify it in this loop)
for package in packages.copy():
apkbuild_path = pmb.helpers.pmaports.find(args, package)
apkbuild = pmb.parse._apkbuild.apkbuild(f"{apkbuild_path}/APKBUILD")
apkbuild_path = pmb.helpers.pmaports.find(package)
apkbuild = pmb.parse._apkbuild.apkbuild(pathlib.Path(apkbuild_path, "APKBUILD"))
if not pmb.helpers.pmaports.check_arches(apkbuild["arch"], arch):
print(f"{package}: not enabled for {arch}, skipping")
......
......@@ -3,6 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import pathlib
import tempfile
import sys
import subprocess
......@@ -15,8 +16,9 @@ import add_pmbootstrap_to_import_path # noqa
import pmb.parse
import pmb.parse.version
import pmb.helpers.logging
from pmb.core.context import get_context
def get_package_contents(args, package, revision, check=True):
def get_package_contents(package, revision, check=True):
# Redirect stderr to /dev/null, so git doesn't complain about files not
# existing in upstream branch for new packages
stderr = None
......@@ -37,15 +39,16 @@ def get_package_contents(args, package, revision, check=True):
with tempfile.TemporaryDirectory() as tempdir:
with open(tempdir + "/APKBUILD", "w", encoding="utf-8") as handle:
handle.write(apkbuild_content)
parsed = pmb.parse.apkbuild(tempdir + "/APKBUILD", False, False)
parsed = pmb.parse.apkbuild(pathlib.Path(tempdir, "APKBUILD"),
False, False)
return parsed
def get_package_version(args, package, revision, check=True):
def get_package_version(package, revision, check=True):
""" returns version in the format "{pkgver}-r{pkgrel}", or None if no
matching package is found """
parsed = get_package_contents(args, package, revision, check)
parsed = get_package_contents(package, revision, check)
if parsed is None:
return None
return parsed["pkgver"] + "-r" + parsed["pkgrel"]
......@@ -91,7 +94,7 @@ def exit_with_error_message():
exit(1)
def check_versions(args, packages):
def check_versions(packages):
error = False
# Get relevant commits: compare HEAD against upstream branch or HEAD~1
......@@ -110,8 +113,8 @@ def check_versions(args, packages):
for package in packages:
# Get versions, skip new packages
head = get_package_version(args, package, "HEAD")
upstream = get_package_version(args, package, commit, False)
head = get_package_version(package, "HEAD")
upstream = get_package_version(package, commit, False)
if not upstream:
if head.rpartition('r')[2] != "0":
print(f"- {package}: {head} (HEAD) (new package) [ERROR]")
......@@ -129,8 +132,8 @@ def check_versions(args, packages):
# Additional checks for device packages
if package.startswith('device-'):
head_parsed = get_package_contents(args, package, "HEAD", False)
upstream_parsed = get_package_contents(args, package, commit, False)
head_parsed = get_package_contents(package, "HEAD", False)
upstream_parsed = get_package_contents(package, commit, False)
# checksums did not change
if head_parsed["sha512sums"] == upstream_parsed["sha512sums"]:
......@@ -191,8 +194,12 @@ if __name__ == "__main__":
# Initialize args (so we can use pmbootstrap's APKBUILD parsing)
sys.argv = ["pmbootstrap.py", "chroot"]
args = pmb.parse.arguments()
pmb.helpers.logging.init(args)
context = get_context()
# pmb.helpers.logging.init(args)
pmb.helpers.logging.init(context.log, args.verbose, context.details_to_stdout)
# Verify package versions
print("checking changed package versions...")
check_versions(args, packages)
check_versions(packages)
......@@ -19,16 +19,11 @@ if [ -z "$(command -v pytest)" ]; then
exit 1
fi
# Wrap pmbootstrap to use this repository for --aports
pmaports="$(cd "$(dirname "$0")"/..; pwd -P)"
_pmbootstrap="$(command -v pmbootstrap)"
pmbootstrap() {
"$_pmbootstrap" --aports="$pmaports" "$@"
}
# Make sure that the work folder format is up to date, and that there are no
# mounts from aborted test cases (pmbootstrap#1595)
pmbootstrap work_migrate
pmbootstrap config aports "$pmaports"
pmbootstrap -q shutdown
# Make sure we have a valid device (pmbootstrap#1128)
......
......@@ -2,24 +2,33 @@
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
from pathlib import Path
import add_pmbootstrap_to_import_path
import pmb.parse
from pmb.helpers.args import init as init_args
from pmb.types import PmbArgs
import pmb.config
from pmb.core.pkgrepo import pkgrepo_default_path
import pytest
import sys
import os
@pytest.fixture
@pytest.fixture(scope="session", autouse=True)
def args(request):
# Initialize args
pmaports = os.path.realpath(f"{os.path.dirname(__file__)}/../..")
sys.argv = ["pmbootstrap",
"--aports", pmaports,
"--log", "$WORK/log_testsuite_pmaports.txt"
"chroot"]
args = pmb.parse.arguments()
pmaports = Path(os.path.realpath(f"{os.path.dirname(__file__)}/../.."))
args = PmbArgs()
args.aports = [pmaports]
args.config = pmb.config.defaults["config"]
args.timeout = 900
args.details_to_stdout = False
args.quiet = False
args.verbose = True
args.offline = False
args.action = "init"
args.cross = False
args.log = None
# Initialize logging
pmb.helpers.logging.init(args)
init_args(args)
request.addfinalizer(pmb.helpers.logging.logfd.close)
return args
......@@ -11,6 +11,8 @@ import sys
import add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
from pmb.core.pkgrepo import pkgrepo_default_path, pkgrepo_iglob, pkgrepo_relative_path
from pmb.core.arch import Arch
# Cache for codeowners_parse
codeowners_parsed = {}
......@@ -32,11 +34,11 @@ def device_dependency_check(apkbuild, path):
" depends anymore (see pmaports!3478)")
def test_aports_device(args):
def test_aports_device():
"""
Various tests performed on the /device/*/device-* aports.
"""
for path in glob.iglob(args.aports + "/device/*/device-*/APKBUILD"):
for path in pkgrepo_iglob("device/*/device-*/APKBUILD"):
apkbuild = pmb.parse.apkbuild(path)
# Depends: Require "postmarketos-base"
......@@ -54,27 +56,27 @@ def test_aports_device(args):
# Architecture
device = apkbuild["pkgname"][len("device-"):]
deviceinfo = pmb.parse.deviceinfo(args, device)
if "".join(apkbuild["arch"]) != deviceinfo["arch"]:
raise RuntimeError("wrong architecture, please change to arch=\"" +
deviceinfo["arch"] + "\": " + path)
deviceinfo = pmb.parse.deviceinfo(device)
if Arch.from_str("".join(apkbuild["arch"])) != deviceinfo.arch:
raise RuntimeError("wrong architecture, please change to arch=\""
f"{deviceinfo.arch}\": {path}")
if "!archcheck" not in apkbuild["options"]:
raise RuntimeError("!archcheck missing in options= line: " + path)
def test_aports_device_kernel(args):
def test_aports_device_kernel():
"""
Verify the kernels specified in the device packages:
* Kernel must not be in depends when kernels are in subpackages
* Check if only one kernel is defined in depends
"""
aports = pkgrepo_default_path()
# Iterate over device aports
for path in glob.glob(args.aports + "/device/*/device-*/APKBUILD"):
for path in aports.glob("device/*/device-*/APKBUILD"):
# Parse apkbuild and kernels from subpackages
apkbuild = pmb.parse.apkbuild(path)
device = apkbuild["pkgname"][len("device-"):]
kernels_subpackages = pmb.parse._apkbuild.kernels(args, device)
kernels_subpackages = pmb.parse._apkbuild.kernels(device)
# Parse kernels from depends
kernels_depends = []
......@@ -85,29 +87,29 @@ def test_aports_device_kernel(args):
# Kernel in subpackages *and* depends
if kernels_subpackages:
raise RuntimeError("Kernel package '" + depend + "' needs to"
raise RuntimeError(f"Kernel package '{depend}' needs to"
" be removed when using kernel" +
" subpackages: " + path)
f" subpackages: {path}")
# No kernel
if not kernels_depends and not kernels_subpackages:
raise RuntimeError("Device doesn't have a kernel in depends or"
" subpackages: " + path)
f" subpackages: {path}")
# Multiple kernels in depends
if len(kernels_depends) > 1:
raise RuntimeError("Please use kernel subpackages instead of"
" multiple kernels in depends (see"
" <https://postmarketos.org/devicepkg>): " +
path)
f" <https://postmarketos.org/devicepkg>): {path}")
def codeowners_parse(args):
def codeowners_parse():
global codeowners_parsed
pattern_prev = None
aports = pkgrepo_default_path()
with open(f"{args.aports}/CODEOWNERS") as h:
with open(aports / "CODEOWNERS") as h:
for line in h:
line = line.rstrip()
if not line or line.startswith("#"):
......@@ -131,12 +133,13 @@ def codeowners_parse(args):
pattern_prev = pattern
def require_enough_codeowners_entries(args, path, maintainers):
def require_enough_codeowners_entries(path, maintainers):
"""
:param path: full path to an APKBUILD (e.g. /home/user/…/APKBUILD)
:param maintainers: list of one or more maintainers
"""
path = os.path.relpath(path, args.aports)
_, path = pkgrepo_relative_path(path)
nicks = set()
for pattern, pattern_nicks in codeowners_parsed.items():
......@@ -158,36 +161,38 @@ def require_enough_codeowners_entries(args, path, maintainers):
f"{path}: make sure that each maintainer is listed in CODEOWNERS!"
def test_aports_maintained(args):
# @pytest.mark.xfail # Not all aports have been updated yet
def test_aports_maintained():
"""
Ensure that aports in /device/{main,community} have "Maintainer:" and
"Co-Maintainer:" (only required for main) listed in their APKBUILDs. Also
check that at least as many are listed in CODEOWNERS.
"""
codeowners_parse(args)
codeowners_parse()
for path in glob.iglob(f"{args.aports}/device/main/*/APKBUILD"):
if '/firmware-' in path:
for path in pkgrepo_iglob("device/main/*/APKBUILD"):
if 'firmware-' in path.parent.name:
continue
maintainers = pmb.parse._apkbuild.maintainers(path)
assert maintainers and len(maintainers) >= 2, \
f"{path} in main needs at least 1 Maintainer and 1 Co-Maintainer"
require_enough_codeowners_entries(args, path, maintainers)
require_enough_codeowners_entries(path, maintainers)
for path in glob.iglob(f"{args.aports}/device/community/*/APKBUILD"):
if '/firmware-' in path:
for path in pkgrepo_iglob("device/community/*/APKBUILD"):
if 'firmware-' in path.parent.name:
continue
maintainers = pmb.parse._apkbuild.maintainers(path)
assert maintainers, f"{path} in community needs at least 1 Maintainer"
require_enough_codeowners_entries(args, path, maintainers)
require_enough_codeowners_entries(path, maintainers)
def test_aports_unmaintained(args):
def test_aports_unmaintained():
"""
Ensure that aports in /device/unmaintained have an "Unmaintained:" comment
that describes why the aport is unmaintained.
"""
for path in glob.iglob(f"{args.aports}/device/unmaintained/*/APKBUILD"):
for path in pkgrepo_iglob("device/unmaintained/*/APKBUILD"):
unmaintained = pmb.parse._apkbuild.unmaintained(path)
assert unmaintained, f"{path} should have an Unmaintained: " +\
"comment that describes why the package is unmaintained"
......@@ -10,6 +10,7 @@ import sys
import add_pmbootstrap_to_import_path
import pmb.parse
from pmb.core.pkgrepo import pkgrepo_iglob
def deviceinfo_obsolete(info):
......@@ -22,13 +23,13 @@ def deviceinfo_obsolete(info):
"weston_pixman_type",
]
for option in obsolete_options:
if option in info and info[option]:
if getattr(info, option, None):
raise RuntimeError(f"option {option} is obsolete, please rename"
" or remove it (see reasons for removal of at"
" https://postmarketos.org/deviceinfo)")
def test_deviceinfo(args):
def test_deviceinfo():
"""
Parse all deviceinfo files successfully and run checks on the parsed data.
"""
......@@ -37,10 +38,10 @@ def test_deviceinfo(args):
count = 0
pattern = re.compile("^deviceinfo_[a-zA-Z0-9_]*=\".*\"$")
for folder in glob.glob(args.aports + "/device/*/device-*"):
device = folder[len(args.aports):].split("-", 1)[1]
for folder in pkgrepo_iglob("device/*/device-*"):
device = folder.name.split("-", 1)[1]
f = open(folder[len(args.aports):][1:] + "/deviceinfo")
f = open(folder / "deviceinfo")
lines = f.read().split("\n")
f.close()
......@@ -66,12 +67,12 @@ def test_deviceinfo(args):
f" to line instead of above? {line}")
# Successful deviceinfo parsing / obsolete options
info = pmb.parse.deviceinfo(args, device)
info = pmb.parse.deviceinfo(device)
deviceinfo_obsolete(info)
# deviceinfo_name must start with manufacturer
name = info["name"]
manufacturer = info["manufacturer"]
name = info.name
manufacturer = info.manufacturer
if not name.startswith(manufacturer) and \
not name.startswith("Google"):
raise RuntimeError("Please add the manufacturer in front of"
......
......@@ -7,9 +7,10 @@ import os
import add_pmbootstrap_to_import_path
import pmb.parse
from pmb.core.pkgrepo import pkgrepo_default_path, pkgrepo_iglob
def test_aports_firmware(args):
def test_aports_firmware():
"""
Various tests performed on the /**/firmware-* aports.
"""
......@@ -26,9 +27,9 @@ def test_aports_firmware(args):
"firmware-xiaomi-willow", # Doesn't build, source link is dead (pma#1212)
]
for path in glob.iglob(f"{args.aports}/**/firmware-*/APKBUILD", recursive=True):
for path in pkgrepo_iglob("**/firmware-*/APKBUILD", recursive=True):
apkbuild = pmb.parse.apkbuild(path)
aport_name = os.path.basename(os.path.dirname(path))
aport_name = os.path.basename(path.parent)
if aport_name not in excluded:
if "pmb:cross-native" not in apkbuild["options"]:
......
......@@ -15,9 +15,10 @@ import sys
import add_pmbootstrap_to_import_path
import pmb.config
import pmb.parse
from pmb.core.pkgrepo import pkgrepo_iter_package_dirs
def get_categorized_packages(args):
def get_categorized_packages():
"""
Parse all aports and categorize them.
......@@ -28,7 +29,7 @@ def get_categorized_packages(args):
"""
ret = {}
for path in glob.glob(args.aports + "/*/*/APKBUILD"):
for path in pkgrepo_iter_package_dirs():
# Parse APKBUILD
apkbuild = pmb.parse.apkbuild(path)
url = apkbuild["url"]
......@@ -109,10 +110,10 @@ def check_categories(categories):
return ret
def test_framework_versions(args):
def test_framework_versions():
"""
Make sure that packages of the same framework have the same version.
"""
categories = get_categorized_packages(args)
categories = get_categorized_packages()
if not check_categories(categories):
raise RuntimeError("Framework version check failed!")
......@@ -11,14 +11,15 @@ from pathlib import Path
import add_pmbootstrap_to_import_path
import pmb.parse
from pmb.core.pkgrepo import pkgrepo_iglob, pkgrepo_relative_path
def test_aports_kernel(args):
def test_aports_kernel():
"""
Various tests performed on the /**/linux-* aports.
"""
for path in glob.iglob(f"{args.aports}/**/linux-*/APKBUILD", recursive=True):
for path in pkgrepo_iglob("**/linux-*/APKBUILD", recursive=True):
apkbuild = pmb.parse.apkbuild(path)
aport_name = os.path.basename(os.path.dirname(path))
......@@ -37,14 +38,15 @@ def test_aports_kernel(args):
" automatically.")
# check some options only for main and community devices
for dir in ["main", "device/main", "device/community"]:
if path.startswith(f"{args.aports}/{dir}"):
_, relpath = pkgrepo_relative_path(path)
for part in ["main", "community"]:
if part in relpath.parts:
if "pmb:kconfigcheck-community" not in apkbuild["options"]:
raise RuntimeError(f"{aport_name}: \"pmb:kconfigcheck-community\" missing in"
" options= line, required for all community/main devices.")
# check for postmarketos-installkernel in makedepends when installing kernel with make
if bool(re.search("make z?install", Path(path).read_text(encoding="utf-8"))):
if bool(re.search("make z?install", path.read_text(encoding="utf-8"))):
if "postmarketos-installkernel" not in apkbuild["makedepends"]:
raise RuntimeError(f"{aport_name}: \"postmarketos-installkernel\" missing in"
" makedepends, required when using make install/zinstall.")
......@@ -10,6 +10,7 @@ import sys
import add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
from pmb.core.pkgrepo import pkgrepo_iter_package_dirs, pkgrepo_relative_path
def apkbuild_check_provides(path, apkbuild, version, pkgname, subpkgname=None):
......@@ -65,13 +66,14 @@ def apkbuild_check_provides(path, apkbuild, version, pkgname, subpkgname=None):
return ret
def test_provides(args):
def test_provides():
errors = []
for path in glob.iglob(f"{args.aports}/**/APKBUILD", recursive=True):
for path in pkgrepo_iter_package_dirs():
path = path / "APKBUILD"
apkbuild = pmb.parse.apkbuild(path)
pkgname = apkbuild["pkgname"]
version = f"{apkbuild['pkgver']}-r{apkbuild['pkgrel']}"
path_rel = os.path.relpath(path, args.aports)
_, path_rel = pkgrepo_relative_path(path)
errors += apkbuild_check_provides(path_rel, apkbuild, version, pkgname)
for subpkg, subpkg_data in apkbuild["subpackages"].items():
......
......@@ -14,9 +14,10 @@ import pmb.parse
import pmb.parse._apkbuild
import pmb.parse.apkindex
import pmb.helpers.repo
from pmb.core.pkgrepo import pkgrepo_iter_package_dirs, pkgrepo_relative_path
def parse_source_from_checksums(args, apkbuild_path):
def parse_source_from_checksums(apkbuild_path):
"""
Read the APKBUILD file and parse source files from the checksums at the
bottom. This has always the same format, even if $source is built with hard
......@@ -64,17 +65,20 @@ def parse_source_from_checksums(args, apkbuild_path):
return ret
def test_aports_unreferenced_files(args):
def test_aports_unreferenced_files():
"""
Raise an error if an unreferenced file is found
"""
for apkbuild_path in glob.iglob(args.aports + "/**/APKBUILD", recursive=True):
for apkbuild_path in pkgrepo_iter_package_dirs():
# pmbootstrap parser has some issues with complicated APKBUILDs, skip those.
if apkbuild_path.startswith(args.aports + "/cross/"):
_, relpath = pkgrepo_relative_path(apkbuild_path)
if relpath.parts[0] == "cross":
continue
apkbuild_path = apkbuild_path / "APKBUILD"
apkbuild = pmb.parse.apkbuild(apkbuild_path)
sources_chk = parse_source_from_checksums(args, apkbuild_path)
sources_chk = parse_source_from_checksums(apkbuild_path)
# Collect files from subpackages
subpackage_installs = []
......@@ -105,7 +109,7 @@ def test_aports_unreferenced_files(args):
raise RuntimeError(f"{apkbuild_path}: found unreferenced file: {rel_file_path}")
def test_distfiles_conflict(args):
def test_distfiles_conflict():
"""
Make sure that each filename mentioned in any source= of any APKBUILD
always has the same checksum. This is important because apk caches
......@@ -115,10 +119,11 @@ def test_distfiles_conflict(args):
with a checksum error.
"""
source_all = {}
for apkbuild_path in glob.iglob(f"{args.aports}/**/APKBUILD", recursive=True):
source = parse_source_from_checksums(args, apkbuild_path)
for apkbuild_path in pkgrepo_iter_package_dirs():
apkbuild_path = apkbuild_path / "APKBUILD"
source = parse_source_from_checksums(apkbuild_path)
dir_path = os.path.dirname(apkbuild_path)
apkbuild_rel = os.path.relpath(apkbuild_path, args.aports)
_, apkbuild_rel = pkgrepo_relative_path(apkbuild_path)
for filename, checksum in source.items():
# Files bundled with the APKBUILD don't get copied to the distfiles
# cache, so not relevant for this check. Use glob.glob here and not
......
......@@ -9,25 +9,26 @@ import os
import add_pmbootstrap_to_import_path
import pmb.parse
from pmb.core.pkgrepo import pkgrepo_iglob
def test_aports_ui(args):
def test_aports_ui():
"""
Raise an error if package in _pmb_recommends is not found
"""
pmaports_cfg = pmb.config.pmaports.read_config(args)
pmaports_cfg = pmb.config.pmaports.read_config()
for arch in pmaports_cfg["supported_arches"].split(","):
for path in glob.iglob(args.aports + "/main/postmarketos-ui-*/APKBUILD"):
for path in pkgrepo_iglob("main/postmarketos-ui-*/APKBUILD"):
apkbuild = pmb.parse.apkbuild(path)
# Skip if arch isn't enabled
if not pmb.helpers.package.check_arch(args, apkbuild["pkgname"], arch, False):
if not pmb.helpers.package.check_arch(apkbuild["pkgname"], arch, False):
continue
for package in apkbuild["_pmb_recommends"]:
depend = pmb.helpers.package.get(args, package,
depend = pmb.helpers.package.get(package,
arch, must_exist=False)
if depend is None or not pmb.helpers.package.check_arch(args, package, arch):
if depend is None or not pmb.helpers.package.check_arch(package, arch):
raise RuntimeError(f"{path}: package '{package}' from"
f" _pmb_recommends not found for arch '{arch}'")
......@@ -35,8 +36,8 @@ def test_aports_ui(args):
if f"{apkbuild['pkgname']}-extras" in apkbuild["subpackages"]:
apkbuild = apkbuild["subpackages"][f"{apkbuild['pkgname']}-extras"]
for package in apkbuild["_pmb_recommends"]:
depend = pmb.helpers.package.get(args, package,
depend = pmb.helpers.package.get(package,
arch, must_exist=False)
if depend is None or not pmb.helpers.package.check_arch(args, package, arch):
if depend is None or not pmb.helpers.package.check_arch(package, arch):
raise RuntimeError(f"{path}: package '{package}' from _pmb_recommends "
f"of -extras subpackage is not found for arch '{arch}'")
......@@ -125,8 +125,6 @@ mr-settings:
# build changed aports
.build:
stage: build
tags:
- saas-linux-large-amd64
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "false"
before_script:
......@@ -152,8 +150,6 @@ build-x86:
build-aarch64:
extends: .build
tags:
- saas-linux-large-arm64
script:
- .ci/build-aarch64.sh
......@@ -174,9 +170,6 @@ build-riscv64:
auto-update:
stage: autoupdate
# We build packages before merging too
tags:
- saas-linux-large-amd64
rules:
# This variable is set in the scheduled pipeline configuration. It should be a space separated list of
# package names to update.
......
<!-- Use this template to kick off the discussion for changing one or more
related kernel config options.
-->
### Read the fine manual, please :)
- [ ] I have read https://postmarketos.org/kconfig-adjust-multiple
### What benefit does the change have?
### Which option(s) would you like to change?
<!-- Make sure to specify if you would like to enable/disable/set a value. -->
### Did you already test that this works as expected?
<!-- Not required, but recommended. If you did test it, please list which
device you have tested it with. -->
### For which kernel configs would you do the change?
<!-- If it makes sense, we encourage to adjust all kernels used by devices in
the main and community categories, so devices behave consistently. -->
- [ ] all in main and community
- [ ] certain SoC(s):
- [ ] other (please specify):
<!-- leave this, so it applies the correct label in gitlab -->
/label ~"change-kernel-config"
......@@ -31,6 +31,7 @@ device/*/*-pine64-pinephonepro/ @PsychoGame
device/*/*-pine64-rockpro64/ @PureTryOut
device/*/*-purism-librem5/ @craftyguy @alistair23 @Newbyte
device/*/*-qcom-msm8916/ @Minecrell @TravMurav
device/*/*-qcom-sdm670/ @flamingradian
device/*/*-qcom-sdm845/ @sdm845-mainline
device/*/*-qcom-sm6350/ @z3ntu
device/*/*-samsung-a3/ @Mis012 @TravMurav @Minecrell
......@@ -57,12 +58,14 @@ device/*/*-xiaomi-vince/ @M0Rf30
device/*/*-xiaomi-wt88047/ @Minecrell
device/*/*-xiaomi-ysl/ @barni2000
device/*/alsa-ucm-conf-cros/ @WeirdTreeThing
device/*/alsa-ucm-conf-qcom-sdm670/ @flamingradian
device/*/device-fairphone-*/ @z3ntu
device/*/device-generic-x86_64/ @craftyguy @ollieparanoid
device/*/device-google-nyan-big/ @jenneron
device/*/device-google-nyan-blaze/ @jenneron
device/*/device-google-peach-pi/ @jenneron
device/*/device-google-peach-pit/ @jenneron
device/*/device-google-sargo/ @flamingradian
device/*/device-google-snow/ @jenneron
device/*/device-huawei-plank/ @gtrxAC
device/*/device-lg-judyln/ @Newbyte
......@@ -78,6 +81,7 @@ device/*/device-qemu-aarch64/ @Minecrell @ollieparanoid
device/*/device-qemu-amd64/ @Minecrell @ollieparanoid
device/*/device-qemu-riscv64/ @Minecrell @z3ntu
device/*/device-qualcomm-sdm845/ @calebccff
device/*/device-raspberry-pi3/ @fossdd
device/*/device-samsung-chagallwifi/ @Grimler
device/*/device-samsung-coreprimevelte/ @legolivesmatter @balejk
device/*/device-samsung-j5y17lte/ @andrisas
......@@ -86,6 +90,7 @@ device/*/device-samsung-lt01/ @knuxify
device/*/device-samsung-m0/ @Newbyte
device/*/device-samsung-manta/ @jenneron @alexmrqt
device/*/device-shift-axolotl/ @amartinz @calebccff @dylanvanassche
device/*/firmware-google-sargo/ @flamingradian
device/*/firmware-google-veyron-brcm/ @jenneron
device/*/firmware-odroid-xu4/ @Grimler
device/*/firmware-oneplus-sdm845/ @calebccff
......
......@@ -8,7 +8,7 @@ fi
pkgname=busybox-static-aarch64
pkgver=1.36.1
pkgrel=31
pkgrel=32
_arch="aarch64"
_mirror="http://dl-4.alpinelinux.org/alpine/"
......@@ -32,5 +32,5 @@ package() {
}
sha512sums="
c34906bb0a5d7e268ab43ca1e3e2f9c75c06f3f5de8d41671396bcd7d585a79a66e25ad43e80a3e107a1de0ecaf83ac7198163d3e775edbd6d626ef014307ec5 busybox-static-1.36.1-r31-aarch64-edge.apk
88f07677919711bb577f60e1861f4fa555168a8703a0a3b904550e24d4045135bb0296e00464899fc6231df07db09bb11f1bc81cdf593a71a8f74dfc3333c29e busybox-static-1.36.1-r32-aarch64-edge.apk
"
......@@ -8,7 +8,7 @@ fi
pkgname=busybox-static-armhf
pkgver=1.36.1
pkgrel=31
pkgrel=32
_arch="armhf"
_mirror="http://dl-4.alpinelinux.org/alpine/"
......@@ -32,5 +32,5 @@ package() {
}
sha512sums="
7e6a961a0adcbc2912f5b261ce84a62b9189dce49c5dd3d2bcbdae407645dec72c27af8804c1d5446d50e78ea938a4d812c477db199ed83cac7c647c4b41f3fe busybox-static-1.36.1-r31-armhf-edge.apk
b0985e2f62df8f1d4e1b7a1206dc3e462df1e6b2a8aae662e57cc497ca3f474f37cc952de0d3bbaad6532d569bf540f17ad4eccc9cabfdc3c9f95f8feaf08049 busybox-static-1.36.1-r32-armhf-edge.apk
"
......@@ -8,7 +8,7 @@ fi
pkgname=busybox-static-armv7
pkgver=1.36.1
pkgrel=31
pkgrel=32
_arch="armv7"
_mirror="http://dl-4.alpinelinux.org/alpine/"
......@@ -32,5 +32,5 @@ package() {
}
sha512sums="
b9736dc7df4230196bf05de3bd76b61fc689c56861bc7c5194cd310e23f513cec649c1b3e3f338266b8d58540468d97e8525948a3efc2d1af53e288cd525e836 busybox-static-1.36.1-r31-armv7-edge.apk
f383286e58183232b41a0d299528734cb29b11e51112eab1fe513322a269a2cdf90a1341d7e329ed7cd58e2d158e3a80bc3a5290ef93de2b28aaf7a25b78bfd7 busybox-static-1.36.1-r32-armv7-edge.apk
"
......@@ -4,17 +4,17 @@ Date: Fri, 21 Aug 2020 07:07:48 +0000
Subject: [PATCH 26/35] ada: musl support fixes
---
gcc/ada/Makefile.rtl | 10 +++++-----
gcc/ada/Makefile.rtl | 16 ++++++++--------
gcc/ada/adaint.c | 34 +++++++++++++++++++---------------
gcc/ada/adaint.h | 10 ++++------
gcc/ada/terminals.c | 8 ++++----
4 files changed, 32 insertions(+), 30 deletions(-)
4 files changed, 35 insertions(+), 33 deletions(-)
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index 96306f8cc9a..090b6770ae5 100644
index 32cbdb692..463028fbe 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -1549,7 +1549,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
@@ -1558,7 +1558,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
s-intman.adb<libgnarl/s-intman__posix.adb \
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
$(TRASYM_DWARF_UNIX_PAIRS) \
......@@ -23,7 +23,16 @@ index 96306f8cc9a..090b6770ae5 100644
a-exetim.adb<libgnarl/a-exetim__posix.adb \
a-exetim.ads<libgnarl/a-exetim__default.ads \
s-linux.ads<libgnarl/s-linux.ads \
@@ -2174,7 +2174,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
@@ -2144,7 +2144,7 @@ ifeq ($(strip $(filter-out loongarch% linux%,$(target_cpu) $(target_os))),)
g-sercom.adb<libgnat/g-sercom__linux.adb \
$(TRASYM_DWARF_UNIX_PAIRS) \
$(GNATRTL_128BIT_PAIRS) \
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
+ s-tsmona.adb<libgnat/s-tsmona.adb \
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
system.ads<libgnat/system-linux-loongarch.ads
@@ -2232,7 +2232,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
s-tasinf.adb<libgnarl/s-tasinf__linux.adb \
s-taspri.ads<libgnarl/s-taspri__posix.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
......@@ -32,7 +41,7 @@ index 96306f8cc9a..090b6770ae5 100644
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
system.ads<libgnat/system-linux-ppc.ads
@@ -2205,7 +2205,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
@@ -2267,7 +2267,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
endif
# ARM linux, GNU eabi
......@@ -50,7 +59,7 @@ index 96306f8cc9a..090b6770ae5 100644
s-mudido.adb<libgnarl/s-mudido__affinity.adb \
s-osinte.ads<libgnarl/s-osinte__linux.ads \
s-osinte.adb<libgnarl/s-osinte__posix.adb \
@@ -2420,7 +2420,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
@@ -2488,7 +2488,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
s-taspri.ads<libgnarl/s-taspri__posix-noaltstack.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
......@@ -59,7 +68,16 @@ index 96306f8cc9a..090b6770ae5 100644
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
$(GNATRTL_128BIT_PAIRS) \
@@ -2524,7 +2524,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
@@ -2592,7 +2592,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
s-taspri.ads<libgnarl/s-taspri__posix.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
+ s-tsmona.adb<libgnat/s-tsmona.adb \
$(ATOMICS_TARGET_PAIRS) \
$(X86_64_TARGET_PAIRS) \
$(SIMD_PATH_TARGET_PAIRS) \
@@ -2637,7 +2637,7 @@ ifeq ($(strip $(filter-out %x32 linux%,$(target_cpu) $(target_os))),)
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
s-taspri.ads<libgnarl/s-taspri__posix.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
......@@ -69,10 +87,10 @@ index 96306f8cc9a..090b6770ae5 100644
$(X86_64_TARGET_PAIRS) \
$(SIMD_PATH_TARGET_PAIRS) \
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 8522094164e..92b230a462b 100644
index 74aa3c412..ef6118f37 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -91,6 +91,11 @@
@@ -94,6 +94,11 @@
#include <sys/param.h>
#include <sys/pstat.h>
#endif
......@@ -84,7 +102,7 @@ index 8522094164e..92b230a462b 100644
#ifdef __PikeOS__
#define __BSD_VISIBLE 1
@@ -3438,7 +3443,6 @@ __gnat_lwp_self (void)
@@ -3465,7 +3470,6 @@ __gnat_lwp_self (void)
#endif
#if defined (__linux__)
......@@ -92,7 +110,7 @@ index 8522094164e..92b230a462b 100644
/* glibc versions earlier than 2.7 do not define the routines to handle
dynamically allocated CPU sets. For these targets, we use the static
@@ -3448,7 +3452,7 @@ __gnat_lwp_self (void)
@@ -3475,7 +3479,7 @@ __gnat_lwp_self (void)
/* Dynamic cpu sets */
......@@ -101,7 +119,7 @@ index 8522094164e..92b230a462b 100644
__gnat_cpu_alloc (size_t count)
{
return CPU_ALLOC (count);
@@ -3461,33 +3465,33 @@ __gnat_cpu_alloc_size (size_t count)
@@ -3488,33 +3492,33 @@ __gnat_cpu_alloc_size (size_t count)
}
void
......@@ -143,7 +161,7 @@ index 8522094164e..92b230a462b 100644
}
size_t
@@ -3497,23 +3501,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
@@ -3524,23 +3528,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
}
void
......@@ -173,7 +191,7 @@ index 8522094164e..92b230a462b 100644
#endif /* !CPU_ALLOC */
#endif /* __linux__ */
diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
index 987432c9307..4d782f07de9 100644
index 0cbfd0e15..f97ed905b 100644
--- a/gcc/ada/adaint.h
+++ b/gcc/ada/adaint.h
@@ -319,13 +319,11 @@ extern void *__gnat_lwp_self (void);
......@@ -195,10 +213,10 @@ index 987432c9307..4d782f07de9 100644
#if defined (_WIN32)
diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
index c0ee4a16bb1..ed796a48c1b 100644
index 05af82c27..626ac35bc 100644
--- a/gcc/ada/terminals.c
+++ b/gcc/ada/terminals.c
@@ -1127,7 +1127,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
@@ -1134,7 +1134,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
/* POSIX does not specify how to open the master side of a terminal.Several
methods are available (system specific):
1- using a cloning device (USE_CLONE_DEVICE)
......@@ -207,7 +225,7 @@ index c0ee4a16bb1..ed796a48c1b 100644
3- openpty (USE_OPENPTY)
When using the cloning device method, the macro USE_CLONE_DEVICE should
@@ -1141,7 +1141,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
@@ -1148,7 +1148,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
#if defined (__APPLE__) || defined (BSD)
#define USE_OPENPTY
#elif defined (__linux__)
......@@ -216,7 +234,7 @@ index c0ee4a16bb1..ed796a48c1b 100644
#elif defined (__sun__)
#define USE_CLONE_DEVICE "/dev/ptmx"
#elif defined (_AIX)
@@ -1190,8 +1190,8 @@ allocate_pty_desc (pty_desc **desc) {
@@ -1197,8 +1197,8 @@ allocate_pty_desc (pty_desc **desc) {
int master_fd = -1;
char *slave_name = NULL;
......@@ -227,6 +245,3 @@ index c0ee4a16bb1..ed796a48c1b 100644
#elif defined (USE_OPENPTY)
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
#elif defined (USE_CLONE_DEVICE)
--
2.41.0