summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-02-19 17:31:54 +0100
committerCarl Hetherington <cth@carlh.net>2022-02-19 17:32:01 +0100
commit1b9fcb5ab32d501a24f603d8a2e4fe8aff282e95 (patch)
treef1762fb5fb23c017009b1fd8633f8ca08108af1f
parenta862b364888ff7b0cd30f6267309bab6ac56cdce (diff)
Don't build a tree that is being packaged; the package() method must do it (if required).
This is to make Linux builds more efficient; previously cdist would build() everything (including the whole of DoM) and then most linux package() methods would end up building it again (making the build in build() redundant). Now the cscript in DoM can call build() if necessary. I'm a little bit worried that the environment is no longer preserved during the final build(), but I'm unsure if this is necessary anyway.
-rwxr-xr-xcdist5
1 files changed, 4 insertions, 1 deletions
diff --git a/cdist b/cdist
index cdc6acf..9b164e7 100755
--- a/cdist
+++ b/cdist
@@ -447,7 +447,10 @@ class Target(object):
copyfile(p, os.path.join(output_dir, os.path.basename(devel_to_git(tree.commit, p))))
def package(self, project, checkout, output_dir, options, notarize):
- tree = self.build(project, checkout, options)
+ # Build the dependencies; the cscript must call its own build() method if it needs to
+ tree = globals.trees.get(project, checkout, self)
+ if self.build_dependencies:
+ tree.build_dependencies(options)
tree.add_defaults(options)
p = self._cscript_package(tree, options)
self._copy_packages(tree, p, output_dir)