Never prune seed packages from build #295
Merged
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.
NOTE: This PR includes #293 (another split image fix). That one should be merged before this.
This is a fix for split images.
During dependency resolution, newt executes a phase called "imposter pruning." A package is an imposter if it is in the dependency graph by virtue of its own syscfg defines and overrides. For example, say we have a package
foo
:Then we have a BSP package:
If this is the only dependency on
foo
, thenfoo
is an imposter. It should be removed from the graph, and its syscfg defines and overrides should be deleted.This commit changes this procedure slightly. Now, only non-seed-packages are subject to imposter pruning. This change is necessary due to the way newt builds split images. A split image consits of two parts: 1) loader, and 2) application. The loader is self-contained, whereas the application is allowed to depend on packages in the loader. When newt builds the application, it considers all the packages in the loader to be seed packages for the application. Since all these packages are guaranteed to be present (they are already built in to the loader), they must not be pruned.
The fix is to never prune seed packages. While this fix specifically addresses split images, conceptually it makes sense to never prune seed packages for non-split builds as well. If the
project.yml
file points to a package, that package should be included, even if newt thinks it is not needed.