diff --git a/src/fromager/commands/build.py b/src/fromager/commands/build.py index 2f365176..477e72e6 100644 --- a/src/fromager/commands/build.py +++ b/src/fromager/commands/build.py @@ -643,13 +643,17 @@ def update_progressbar_cb(future: concurrent.futures.Future) -> None: with req_ctxvar_context( Requirement(node.canonicalized_name), node.version ): - # Get all build dependencies (build-system, build-backend, build-sdist) + # Get all dependencies. If package A needs package B to be + # installed, package B should not have a build dependency on + # package A. So, building the installation dependencies of a + # package before we build that package should be possible, + # and doing so ensures that when we mark a package as ready + # to be used for building other packages, all of the + # installation dependencies are also ready. build_deps: DependencyNodeList = [ - edge.destination_node - for edge in node.children - if edge.req_type.is_build_requirement + edge.destination_node for edge in node.children ] - # A node can be built when all of its build dependencies are built + # A node can be built when all of its dependencies are built unbuilt_deps: set[str] = set( dep.key for dep in build_deps if dep.key not in built_node_keys )