build_deps
This commit is contained in:
+2
-2
@@ -12,7 +12,7 @@ deps = [profile["libc"]]
|
||||
|
||||
build_if = profile["arch"] in ("x86_64", "aarch64", "riscv64", "loongarch64")
|
||||
|
||||
_arch_args = {
|
||||
arch_args = {
|
||||
"x86_64": [
|
||||
"--enable-uefi-x86-64",
|
||||
"--enable-uefi-ia32",
|
||||
@@ -25,7 +25,7 @@ _arch_args = {
|
||||
}
|
||||
|
||||
configure, build, install = autotools(
|
||||
configure_args=["--enable-uefi-cd", *_arch_args.get(profile["arch"], [])],
|
||||
configure_args=["--enable-uefi-cd", *arch_args[profile["arch"]]],
|
||||
configure_env={"TOOLCHAIN_FOR_TARGET": profile["triple"] + "-"},
|
||||
)
|
||||
|
||||
|
||||
+1
-2
@@ -40,7 +40,6 @@ def _info_args(
|
||||
|
||||
def mkpkg_base(container: Container, recipe: Recipe, arch: str) -> None:
|
||||
name = recipe.name
|
||||
deps = list(recipe.deps) + list(recipe.run_deps)
|
||||
args = [
|
||||
"apk",
|
||||
"mkpkg",
|
||||
@@ -58,7 +57,7 @@ def mkpkg_base(container: Container, recipe: Recipe, arch: str) -> None:
|
||||
recipe.license,
|
||||
recipe.url,
|
||||
recipe.maintainer,
|
||||
deps,
|
||||
list(recipe.deps),
|
||||
),
|
||||
]
|
||||
container.exec(args)
|
||||
|
||||
+1
-1
@@ -204,7 +204,7 @@ def _finalize_host(c: Container, layout: Layout, r: Recipe) -> None:
|
||||
|
||||
|
||||
def _sysroot_sync(c: Container, r: Recipe) -> None:
|
||||
direct_deps = list(r.deps)
|
||||
direct_deps = list(dict.fromkeys((*r.deps, *r.build_deps)))
|
||||
if not direct_deps:
|
||||
return
|
||||
initdb = not apk.sysroot_initialized(c)
|
||||
|
||||
+20
-13
@@ -111,6 +111,21 @@ def build_plan(
|
||||
seen: dict[str, Recipe] = {}
|
||||
ts: graphlib.TopologicalSorter[str] = graphlib.TopologicalSorter()
|
||||
forced: set[str] = set()
|
||||
target_outputs: dict[str, Recipe] = {}
|
||||
|
||||
for tr in rs.target.values():
|
||||
for out in tr.outputs:
|
||||
if out in target_outputs:
|
||||
raise ValueError(f"duplicate target output: {out}")
|
||||
target_outputs[out] = tr
|
||||
|
||||
def target_dep(owner: str, name: str) -> Recipe:
|
||||
tr = target_outputs.get(name)
|
||||
if tr is None:
|
||||
raise KeyError(f"{owner}: unknown target dep {name!r}")
|
||||
if not tr.enabled:
|
||||
raise ValueError(f"{owner}: dep {name!r} disabled by build_if")
|
||||
return tr
|
||||
|
||||
def add(r: Recipe) -> None:
|
||||
k = _key(r)
|
||||
@@ -127,22 +142,14 @@ def build_plan(
|
||||
add(hr)
|
||||
deps.append(_key(hr))
|
||||
if r.kind == "target":
|
||||
for d in (*r.deps, *r.run_deps):
|
||||
tr = rs.target.get(d)
|
||||
if tr is None:
|
||||
raise KeyError(f"{r.name}: unknown dep {d!r}")
|
||||
if not tr.enabled:
|
||||
raise ValueError(f"{r.name}: dep {d!r} disabled by build_if")
|
||||
for d in (*r.deps, *r.build_deps):
|
||||
tr = target_dep(r.name, d)
|
||||
add(tr)
|
||||
deps.append(_key(tr))
|
||||
else:
|
||||
# host recipes may declare target `deps` that need to land in /sysroot
|
||||
for d in r.deps:
|
||||
tr = rs.target.get(d)
|
||||
if tr is None:
|
||||
raise KeyError(f"host:{r.name}: unknown target dep {d!r}")
|
||||
if not tr.enabled:
|
||||
raise ValueError(f"host:{r.name}: dep {d!r} disabled by build_if")
|
||||
# host recipes may declare target deps that need to land in /sysroot
|
||||
for d in (*r.deps, *r.build_deps):
|
||||
tr = target_dep(f"host:{r.name}", d)
|
||||
add(tr)
|
||||
deps.append(_key(tr))
|
||||
ts.add(k, *deps)
|
||||
|
||||
+3
-3
@@ -28,8 +28,8 @@ class Recipe:
|
||||
maintainer: str
|
||||
sources: dict[str | None, Tarball | src_mod.Git] # key=None for single source
|
||||
host_deps: tuple[str, ...]
|
||||
build_deps: tuple[str, ...]
|
||||
deps: tuple[str, ...]
|
||||
run_deps: tuple[str, ...]
|
||||
subpackages: tuple[Subpackage, ...]
|
||||
phases: dict[str, Callable[[Any], None]]
|
||||
enabled: bool
|
||||
@@ -163,8 +163,8 @@ def _load_one(
|
||||
)
|
||||
|
||||
host_deps = tuple(getattr(mod, "host_deps", ()) or ())
|
||||
build_deps = tuple(getattr(mod, "build_deps", ()) or ())
|
||||
deps = tuple(getattr(mod, "deps", ()) or ())
|
||||
run_deps = tuple(getattr(mod, "run_deps", ()) or ())
|
||||
subs = tuple(getattr(mod, "subpackages", ()) or ())
|
||||
for s in subs:
|
||||
if not isinstance(s, Subpackage):
|
||||
@@ -200,8 +200,8 @@ def _load_one(
|
||||
maintainer=maintainer,
|
||||
sources=sources,
|
||||
host_deps=host_deps,
|
||||
build_deps=build_deps,
|
||||
deps=deps,
|
||||
run_deps=run_deps,
|
||||
subpackages=subs,
|
||||
phases=phases,
|
||||
enabled=enabled,
|
||||
|
||||
Reference in New Issue
Block a user