You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/12/30 02:35:34 UTC
[1/2] incubator-mynewt-newt git commit: newt - Allow API
inter-resolution in split image
Repository: incubator-mynewt-newt
Updated Branches:
refs/heads/develop 660e916ac -> 4b6affe1a
newt - Allow API inter-resolution in split image
It is OK if the app requires an API that is supplied by the loader.
Ensure each set of packages has access to the API-providers.
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/4b6affe1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/4b6affe1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/4b6affe1
Branch: refs/heads/develop
Commit: 4b6affe1a8d973dadd278aa0e96df772f10f62ee
Parents: ab267a1
Author: Christopher Collins <cc...@apache.org>
Authored: Thu Dec 29 18:34:24 2016 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Thu Dec 29 18:35:27 2016 -0800
----------------------------------------------------------------------
newt/resolve/resolve.go | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4b6affe1/newt/resolve/resolve.go
----------------------------------------------------------------------
diff --git a/newt/resolve/resolve.go b/newt/resolve/resolve.go
index 8e1255f..55b615b 100644
--- a/newt/resolve/resolve.go
+++ b/newt/resolve/resolve.go
@@ -388,20 +388,21 @@ func (r *Resolver) resolveDepsAndCfg() error {
// Transforms each package's required APIs to hard dependencies. That is, this
// function determines which package supplies each required API, and adds the
-// corresponding dependecy to each pacakge whic requires the API.
+// corresponding dependecy to each package which requires the API.
func (r *Resolver) resolveApiDeps() error {
for _, rpkg := range r.pkgMap {
for api, _ := range rpkg.reqApiMap {
apiPkg := r.apis[api]
if apiPkg == nil {
- return util.FmtNewtError(
- "Unsatisfied API at unexpected time: %s", api)
- }
+ //return util.FmtNewtError(
+ //"Unsatisfied API at unexpected time: %s", api)
+ } else {
- rpkg.AddDep(&pkg.Dependency{
- Name: apiPkg.Name(),
- Repo: apiPkg.Repo().Name(),
- })
+ rpkg.AddDep(&pkg.Dependency{
+ Name: apiPkg.Name(),
+ Repo: apiPkg.Repo().Name(),
+ })
+ }
}
}
@@ -463,6 +464,11 @@ func ResolveFull(
return nil, err
}
+ // Determine which package satisfies each API and which APIs are
+ // unsatisfied.
+ apiMap := map[string]*pkg.LocalPackage{}
+ apiMap, res.UnsatisfiedApis = r.apiResolution()
+
// If there is no loader, then the set of all packages is just the app
// packages. We already resolved the necessary dependency information when
// syscfg was calculated above.
@@ -478,6 +484,13 @@ func ResolveFull(
// These need to be resolved separately so that it is possible later to
// determine which packages need to be shared between loader and app.
+ // It is OK if the app requires an API that is supplied by the loader.
+ // Ensure each set of packages has access to the API-providers.
+ for _, lpkg := range apiMap {
+ loaderSeeds = append(loaderSeeds, lpkg)
+ appSeeds = append(appSeeds, lpkg)
+ }
+
// Resolve loader dependencies.
r = newResolver(loaderSeeds, injectedSettings, flashMap)
r.cfg = res.Cfg
[2/2] incubator-mynewt-newt git commit: newt - Fix split-image
(rev)depgraph
Posted by cc...@apache.org.
newt - Fix split-image (rev)depgraph
In split images, some dependencies were not displayed in the dependency
graph (and reverse dependency graph).
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/ab267a17
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/ab267a17
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/ab267a17
Branch: refs/heads/develop
Commit: ab267a17a27fd89ee4c879c07a5e448e72d7cc59
Parents: 660e916
Author: Christopher Collins <cc...@apache.org>
Authored: Thu Dec 29 18:28:51 2016 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Thu Dec 29 18:35:27 2016 -0800
----------------------------------------------------------------------
newt/builder/depgraph.go | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/ab267a17/newt/builder/depgraph.go
----------------------------------------------------------------------
diff --git a/newt/builder/depgraph.go b/newt/builder/depgraph.go
index 76a1bfa..647028e 100644
--- a/newt/builder/depgraph.go
+++ b/newt/builder/depgraph.go
@@ -100,7 +100,9 @@ func mergeDepGraphs(graphs ...DepGraph) DepGraph {
for _, graph := range graphs {
for parent, children := range graph {
- gm[parent] = map[*pkg.LocalPackage]struct{}{}
+ if gm[parent] == nil {
+ gm[parent] = map[*pkg.LocalPackage]struct{}{}
+ }
for _, child := range children {
graphMapAdd(gm, parent, child)
@@ -109,6 +111,7 @@ func mergeDepGraphs(graphs ...DepGraph) DepGraph {
}
dg := graphMapToDepGraph(gm)
+
return dg
}