Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop 999a82622 -> 17b334f82


newt - Ensure split app gets all loader pkgs.

Previously, newt calculated the set of application packages by following
the dependency graph.  This isn't quite right.  Even if an app package
doesn't explicitly depend on a loader package, the app still needs to
know about the package so that it will get initialized during the second
stage sysinit (sysinit_app()).

Now, the application "seed" packages includes all loader packages save
for the loader app package itself.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/17b334f8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/17b334f8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/17b334f8

Branch: refs/heads/develop
Commit: 17b334f821638973ab034fbd7c9fe6c4622d1bae
Parents: 999a826
Author: Christopher Collins <[email protected]>
Authored: Mon Jan 16 11:51:28 2017 -0800
Committer: Christopher Collins <[email protected]>
Committed: Mon Jan 16 11:51:28 2017 -0800

----------------------------------------------------------------------
 newt/resolve/resolve.go | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/17b334f8/newt/resolve/resolve.go
----------------------------------------------------------------------
diff --git a/newt/resolve/resolve.go b/newt/resolve/resolve.go
index 55b615b..916f38c 100644
--- a/newt/resolve/resolve.go
+++ b/newt/resolve/resolve.go
@@ -479,7 +479,7 @@ func ResolveFull(
 
        // Otherwise, we need to resolve dependencies separately for:
        // 1. The set of loader pacakges, and
-       // 2. The set of app pacakges.
+       // 2. The set of app packages.
        //
        // These need to be resolved separately so that it is possible later to
        // determine which packages need to be shared between loader and app.
@@ -502,7 +502,14 @@ func ResolveFull(
                return nil, err
        }
 
-       // Resolve app dependencies.
+       // Resolve app dependencies.  The app automtically gets all the packages
+       // from the loader except for the loader-app-package.
+       for _, lpkg := range res.LoaderPkgs {
+               if lpkg.Type() != pkg.PACKAGE_TYPE_APP {
+                       appSeeds = append(appSeeds, lpkg)
+               }
+       }
+
        r = newResolver(appSeeds, injectedSettings, flashMap)
        r.cfg = res.Cfg
 

Reply via email to