Skip to content

Commit fb32ee6

Browse files
committed
fix: build installation dependencies before building consumers
Change the way we determine whether a package is ready to be built in build-parallel so that we build its installation dependencies before we build it. Logically it should not be possible for package A installation dependencies to depend in any way on A, so this ordering should be safe. The change ensures that when we mark A as built, it is actually ready to be consumed in build environments for other packages. Addresses #755 Signed-off-by: Doug Hellmann <dhellmann@redhat.com>
1 parent ecdc251 commit fb32ee6

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

src/fromager/commands/build.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -643,13 +643,17 @@ def update_progressbar_cb(future: concurrent.futures.Future) -> None:
643643
with req_ctxvar_context(
644644
Requirement(node.canonicalized_name), node.version
645645
):
646-
# Get all build dependencies (build-system, build-backend, build-sdist)
646+
# Get all dependencies. If package A needs package B to be
647+
# installed, package B should not have a build dependency on
648+
# package A. So, building the installation dependencies of a
649+
# package before we build that package should be possible,
650+
# and doing so ensures that when we mark a package as ready
651+
# to be used for building other packages, all of the
652+
# installation dependencies are also ready.
647653
build_deps: DependencyNodeList = [
648-
edge.destination_node
649-
for edge in node.children
650-
if edge.req_type.is_build_requirement
654+
edge.destination_node for edge in node.children
651655
]
652-
# A node can be built when all of its build dependencies are built
656+
# A node can be built when all of its dependencies are built
653657
unbuilt_deps: set[str] = set(
654658
dep.key for dep in build_deps if dep.key not in built_node_keys
655659
)

0 commit comments

Comments
 (0)