profile changes

This commit is contained in:
2026-05-30 23:09:34 +02:00
parent afb13bb8ad
commit d3c949b8a2
15 changed files with 209 additions and 118 deletions
+10 -9
View File
@@ -7,6 +7,7 @@ from src import apk, fetch, log
from src.container import Container, Mount
from src.context import RecipeContext
from src.layout import Layout
from src.profile import Profile
from src.plan import (
PHASE_STAMPS,
Plan,
@@ -65,7 +66,7 @@ def _build_path_env(host_deps_order: list[str], layout: Layout) -> str:
def _container_for(
rs: RecipeSet, layout: Layout, profile: dict, r: Recipe
rs: RecipeSet, layout: Layout, profile: Profile, r: Recipe
) -> tuple[Container, list[str]]:
host_order = transitive_host_deps(rs, r)
name = _container_name("orchid", layout.build.name, r.kind, r.name)
@@ -96,13 +97,13 @@ def _container_for(
env = {
"PATH": _build_path_env(host_order, layout),
"ORCHID_ARCH": profile["arch"],
"ORCHID_TRIPLE": profile["triple"],
"ORCHID_ARCH": profile.arch,
"ORCHID_TRIPLE": profile.triple,
"ORCHID_JOBS": str(os.cpu_count() or 1),
}
c = Container(
name=name,
image=profile["container_image"],
image=profile.container_image,
mounts=mounts,
tmpfs=tmpfs,
network=False,
@@ -212,7 +213,7 @@ def _sysroot_sync(c: Container, r: Recipe) -> None:
def build_one(
rs: RecipeSet, layout: Layout, profile: dict, r: Recipe, *, forced: bool = False
rs: RecipeSet, layout: Layout, profile: Profile, r: Recipe, *, forced: bool = False
) -> None:
log.info_field("recipe", _recipe_ref(r))
if forced:
@@ -237,7 +238,7 @@ def build_one(
if r.kind == "target":
log.info_field("package", _recipe_ref(r))
_split_subpackages(c, r)
_package_target(c, r, profile["arch"])
_package_target(c, r, profile.arch)
else:
log.info_field("finalize", _recipe_ref(r))
_finalize_host(c, layout, r)
@@ -246,7 +247,7 @@ def build_one(
log.ok_field("done", _recipe_ref(r))
def execute(plan: Plan, rs: RecipeSet, layout: Layout, profile: dict) -> None:
def execute(plan: Plan, rs: RecipeSet, layout: Layout, profile: Profile) -> None:
if not plan.order:
log.info_field("plan", "nothing to do")
return
@@ -257,7 +258,7 @@ def execute(plan: Plan, rs: RecipeSet, layout: Layout, profile: dict) -> None:
def install_to(
layout: Layout,
profile: dict,
profile: Profile,
dest: Path,
pkgs: list[str],
*,
@@ -268,7 +269,7 @@ def install_to(
return
c = Container(
name=_container_name("orchid", layout.build.name, "install"),
image=profile["container_image"],
image=profile.container_image,
mounts=[
Mount(layout.pkgs_dir, "/pkgs", readonly=True),
Mount(dest, "/sysroot", readonly=False),