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
  • postmarketOS/pmbootstrap
  • fossdd/pmbootstrap
  • Adrian/pmbootstrap
  • JustSoup321/pmbootstrap
  • longnoserob/pmbootstrap
  • sixthkrum/pmbootstrap
  • ollieparanoid/pmbootstrap
  • magdesign/pmbootstrap
  • anjandev/pmbootstrap
  • HenriDellal/pmbootstrap
  • Minecrell/pmbootstrap
  • chipiguay/pmbootstrap
  • ijiki16/pmbootstrap
  • whynothugo/pmbootstrap
  • amessier/pmbootstrap
  • Eisenbahnfan/pmbootstrap
  • user0-07161/pmbootstrap
  • SzczurekYT/pmbootstrap
  • neuschaefer/pmbootstrap
  • knuxify/pmbootstrap
  • Frieder.Hannenheim/pmbootstrap
21 results
Show changes
Commits on Source (4)
  • Clayton Craft's avatar
    pmb.build: make sure cross compiler config is appropriate for each given package (MR 2433) · e56eadd6
    Clayton Craft authored
    Here's the problem: Imagine a queue with 2 packages in it, the 1st
    package uses crossdirect and the second uses cross-native. When building
    the 1st package, pmb will configure the native chroot for crossdirect
    as expected. When it gets to the 2nd package, the chroot env/config
    might not be appropriate for actually doing a native cross compile.
    
    This re-inits the cross compiler stuff if the cross compile method
    changes while processing the queue.
    
    Another approach that might solve this problem is to not re-use chroots
    when building packages... I didn't think this was a good way to go
    because it would greatly increase runtime (having to recreate chroots
    multiple times)
    e56eadd6
  • Oliver Smith's avatar
    lint: run apkbuild-lint as user, not root (MR 2412) · 8b48a95c
    Oliver Smith authored
    It is not needed to run the linter as root, so don't do it. This is
    probably a leftover from early days pmbootstrap, where pmaports.git
    wasn't chowned by the user running pmbootstrap.
    8b48a95c
  • Oliver Smith's avatar
    lint: make output of apkbuild-lint easy to spot (MR 2412) · 67a52b94
    Oliver Smith authored
    The output of apkbuild-lint is hard to spot among other log messages
    from pmbootstrap, because it is not colorized.
    
    Add "*** apkbuild-lint output ***"" before and after the output of
    apkbuild-lint, so we get a standing out message in green around the
    apkbuild-lint output.
    67a52b94
  • Oliver Smith's avatar
    lint: generate options from kconfigcheck.toml (MR 2412) · bf9f7586
    Oliver Smith authored
    Now that we have moved the kconfigcheck configuration into pmaports
    branches via kconfigcheck.toml, it is time to get rid of the hardcoded
    list of valid "pmb:kconfigcheck-…" options for APKBUILDs. Generate it
    from the kconfigcheck.toml of the current branch, too.
    
    These options are passed from "pmbootstrap lint" to "apkbuild-lint",
    which we run in pmaports CI.
    bf9f7586
......@@ -579,6 +579,7 @@ def packages(
)
cross = None
prev_cross = None
total_pkgs = len(build_queue)
count = 0
......@@ -606,11 +607,11 @@ def packages(
if src:
pkg_depends.append("rsync")
# We only need to init cross compiler stuff once
if not cross:
cross = pmb.build.autodetect.crosscompile(pkg["apkbuild"], pkg_arch)
if cross:
pmb.build.init_compiler(context, pkg_depends, cross, pkg_arch)
# (re)-initialize the cross compiler stuff when cross method changes
prev_cross = cross
cross = pmb.build.autodetect.crosscompile(pkg["apkbuild"], pkg_arch)
if cross != prev_cross:
pmb.build.init_compiler(context, pkg_depends, cross, pkg_arch)
if cross == "crossdirect":
pmb.chroot.mount_native_into_foreign(chroot)
......
......@@ -283,17 +283,12 @@ apkbuild_attributes = {
}
# Reference: https://postmarketos.org/apkbuild-options
# In addition to these, pmbootstrap adds "pmb:kconfigcheck-community" etc.
# dynamically based on kconfigcheck.toml in the currently checked out pmaports
# branch
apkbuild_custom_valid_options = [
"!pmb:crossdirect",
"!pmb:kconfigcheck",
"pmb:kconfigcheck-community",
"pmb:kconfigcheck-containers",
"pmb:kconfigcheck-iwd",
"pmb:kconfigcheck-netboot",
"pmb:kconfigcheck-nftables",
"pmb:kconfigcheck-uefi",
"pmb:kconfigcheck-waydroid",
"pmb:kconfigcheck-zram",
"pmb:cross-native",
"pmb:gpu-accel",
"pmb:strict",
......
......@@ -5,6 +5,7 @@ from pmb.core.chroot import Chroot
from pmb.core.pkgrepo import pkgrepo_iter_package_dirs, pkgrepo_names, pkgrepo_relative_path
from pmb.helpers import logging
from pmb.helpers.exceptions import NonBugError
from pmb.helpers.toml import load_toml_file
import os
import pmb.chroot
......@@ -14,6 +15,33 @@ import pmb.helpers.run
import pmb.helpers.pmaports
def get_custom_valid_options() -> list[str]:
"""Build a list of custom valid APKBUILD options that apkbuild-lint should
not complain about. The list consists of hardcoded options from
pmb.config.apkbuild_custom_valid_options like pmb:gpu-accel, as well as
dynamically generated options from kconfigcheck.toml
(pmb:kconfigcheck-libcamera etc.)."""
ret = list(pmb.config.apkbuild_custom_valid_options)
# Load kconfigcheck.toml from current branch
kconfigcheck_toml = load_toml_file(pmb.parse.kconfigcheck.get_path())
pmb.parse.kconfigcheck.sanity_check(kconfigcheck_toml)
# Add options like "pmb:kconfigcheck-libcamera"
for section in kconfigcheck_toml.keys():
if not section.startswith("category:"):
continue
# section looks like: "category:input.>=0.0.0.all"
category = section.split(".")[0].replace("category:", "", 1)
ret += [f"pmb:kconfigcheck-{category}"]
# Add aliases like "pmb:kconfigcheck-community"
for alias in kconfigcheck_toml["aliases"].keys():
ret += [f"pmb:kconfigcheck-{alias}"]
return ret
# FIXME: dest_paths[repo], repo expected to be a Literal.
# We should really make Config.mirrors not a TypedDict.
# mypy: disable-error-code="index"
......@@ -55,19 +83,23 @@ def check(pkgnames: Sequence[str]):
# each violation.
pkgstr = ", ".join(pkgnames)
logging.info(f"(native) linting {pkgstr} with apkbuild-lint")
options = pmb.config.apkbuild_custom_valid_options
# apkbuild-lint output is not colorized, make it easier to spot
logging.info("*** apkbuild-lint output ***")
# For each pkgrepo run the linter on the relevant packages
has_failed = False
for pkgrepo, apkbuild_paths in apkbuilds.items():
if pmb.chroot.root(
if pmb.chroot.user(
["apkbuild-lint"] + apkbuild_paths,
check=False,
output="stdout",
working_dir=dest_paths[repo.name],
env={"CUSTOM_VALID_OPTIONS": " ".join(options)},
env={"CUSTOM_VALID_OPTIONS": " ".join(get_custom_valid_options())},
):
has_failed = True
logging.info("*** apkbuild-lint output ***")
if has_failed:
raise NonBugError("Linter failed!")