summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan van Berkom <tristan.vanberkom@codethink.co.uk>2020-07-13 23:44:21 +0900
committerTristan van Berkom <tristan.vanberkom@codethink.co.uk>2020-07-15 12:53:55 +0900
commit95e83d98fd15a41cafe516f48fe6667835cd4bb0 (patch)
tree98e4063327924ef57229c0e754ce853102ac0996
parenta13693ea54fdc16db4d51c7162a71f008df7132d (diff)
downloadbuildstream-95e83d98fd15a41cafe516f48fe6667835cd4bb0.tar.gz
_project.py: Documenting why ensure_fully_loaded() is reentrant.
-rw-r--r--src/buildstream/_project.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/buildstream/_project.py b/src/buildstream/_project.py
index 21dc2b9d2..b45c6c695 100644
--- a/src/buildstream/_project.py
+++ b/src/buildstream/_project.py
@@ -499,6 +499,20 @@ class Project:
if self._fully_loaded:
return
assert self._partially_loaded
+
+ # Here we mark the project as fully loaded right away,
+ # before doing the work.
+ #
+ # This function will otherwise reenter itself infinitely:
+ #
+ # * Ensuring the invariant that a parent project is fully
+ # loaded before completing the load of this project, will
+ # trigger this function when completing the load of subprojects.
+ #
+ # * Completing the load of this project may include processing
+ # some `(@)` include directives, which can directly trigger
+ # the loading of subprojects.
+ #
self._fully_loaded = True
if self.junction: