only build graph via wolfictl when needed #3454
Merged
+11
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We were generating the graph with each call to
make, and we were calling make recursively with eachpackage/<something>target. Somake allwould generate the graph every single time, costing 1.5-2s. That is fine for 3 or 4 packages, but for nearly 1000, it times out.We have to use recursive make, because we need to pass the original target to the dependency. This below won't work:
the "# do stuff" section needs to know the original package name, so it can
mkdir -p ${sourcedir}, and call buildmelange build ${yamlfile}, both of which depend on the original package name, not the full version.Make provides no way to do this. I also looked at target-specific variables, but they are evaluated in the context of the target to be run, e.g. in this case
packages/aarch64/openssl-1.2.3-r1.apk, and not the original callpackage/openssl, leaving us no way to get the original package name ofopenssl, and hence the source dir and yaml file.The only way to do that is to call recursive make and pass the information, which determines all vars again.
Therefore, we change it so that it only generates the graph when explicitly needed, i.e. for
.buildpackages,listandlist-yaml. This makes it very quick.