diff options
author | Abderrahim Kitouni <akitouni@gnome.org> | 2020-03-18 11:54:47 +0100 |
---|---|---|
committer | Abderrahim Kitouni <akitouni@gnome.org> | 2020-04-05 09:13:55 +0100 |
commit | 9d837bb19b98e878c4e4ba4bcb3365969138d5a7 (patch) | |
tree | 3328a5b35b081812499c68d837d896937c84bf2f /src/buildstream | |
parent | 0c21df1ea72e9509d7ed035752f125ebb0228e56 (diff) | |
download | buildstream-9d837bb19b98e878c4e4ba4bcb3365969138d5a7.tar.gz |
_project.py: resolve options before running the final assertionsabderrahim/options
otherwise, having an optional list append in theh configuration wouldn't work
This also avoids special casing for element and source overrides
Diffstat (limited to 'src/buildstream')
-rw-r--r-- | src/buildstream/_project.py | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/buildstream/_project.py b/src/buildstream/_project.py index 0593abe6f..7b31f44b8 100644 --- a/src/buildstream/_project.py +++ b/src/buildstream/_project.py @@ -789,15 +789,6 @@ class Project: # def _load_pass(self, config, output, *, ignore_unknown=False): - # Element and Source type configurations will be composited later onto - # element/source types, so we delete it from here and run our final - # assertion after. - output.element_overrides = config.get_mapping("elements", default={}) - output.source_overrides = config.get_mapping("sources", default={}) - config.safe_del("elements") - config.safe_del("sources") - config._assert_fully_composited() - self._load_plugin_factories(config, output) # Load project options @@ -821,11 +812,16 @@ class Project: # Now resolve any conditionals in the remaining configuration, # any conditionals specified for project option declarations, # or conditionally specifying the project name; will be ignored. - # - # Don't forget to also resolve options in the element and source overrides. output.options.process_node(config) - output.options.process_node(output.element_overrides) - output.options.process_node(output.source_overrides) + + # Element and Source type configurations will be composited later onto + # element/source types, so we delete it from here and run our final + # assertion after. + output.element_overrides = config.get_mapping("elements", default={}) + output.source_overrides = config.get_mapping("sources", default={}) + config.safe_del("elements") + config.safe_del("sources") + config._assert_fully_composited() # Load base variables output.base_variables = config.get_mapping("variables") |