This is an automated email from the ASF dual-hosted git repository.

juergbi pushed a commit to branch juerg/nested-junctions
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit c7b29f3662647721326507ab2c35aaed75e16e99
Author: Jürg Billeter <[email protected]>
AuthorDate: Fri Nov 15 18:12:43 2024 +0100

    _project.py: Ensure that the parent project is fully loaded first
    
    Fixes #1891.
---
 src/buildstream/_project.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/buildstream/_project.py b/src/buildstream/_project.py
index f89444197..b55f257fa 100644
--- a/src/buildstream/_project.py
+++ b/src/buildstream/_project.py
@@ -545,6 +545,15 @@ class Project:
             return
         assert self._partially_loaded
 
+        # Ensure that the parent project is fully loaded first
+        if self.junction:
+            self.junction._get_project().ensure_fully_loaded()
+
+            if self._fully_loaded:
+                # The parent project triggered the loading of this project,
+                # don't load this subproject twice.
+                return
+
         # Here we mark the project as fully loaded right away,
         # before doing the work.
         #
@@ -560,9 +569,6 @@ class Project:
         #
         self._fully_loaded = True
 
-        if self.junction:
-            self.junction._get_project().ensure_fully_loaded()
-
         self._load_second_pass()
 
     # get_default_target()

Reply via email to