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/03/10 02:54:18 UTC

[1/3] incubator-mynewt-newt git commit: Add API status message.

Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop 559a3f69b -> fb0d66f93


Add API status message.


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/59d92925
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/59d92925
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/59d92925

Branch: refs/heads/develop
Commit: 59d929256533716eaefadab6713ca70e653f9c34
Parents: 559a3f6
Author: Christopher Collins <cc...@gmail.com>
Authored: Wed Mar 9 17:07:53 2016 -0800
Committer: Christopher Collins <cc...@gmail.com>
Committed: Wed Mar 9 17:07:53 2016 -0800

----------------------------------------------------------------------
 newt/builder/buildpackage.go | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/59d92925/newt/builder/buildpackage.go
----------------------------------------------------------------------
diff --git a/newt/builder/buildpackage.go b/newt/builder/buildpackage.go
index bcf88f5..3cbe560 100644
--- a/newt/builder/buildpackage.go
+++ b/newt/builder/buildpackage.go
@@ -183,8 +183,13 @@ func (bpkg *BuildPackage) satisfyReqApi(b *Builder, reqApi string) bool {
 	}
 	bpkg.AddDep(dep)
 	bpkg.reqApiMap[reqApi] = REQ_API_STATUS_SATISFIED
+
+	// This package now has a new unresolved dependency.
 	bpkg.depsResolved = false
 
+	util.StatusMessage(util.VERBOSITY_VERBOSE, "API requirement satisfied; "+
+		"pkg=%s API=(%s, %s)\n", bpkg.Name(), reqApi, dep.String())
+
 	return true
 }
 


[3/3] incubator-mynewt-newt git commit: Reprocess all packages when a new supported feature is discovered.

Posted by cc...@apache.org.
Reprocess all packages when a new supported feature is discovered.


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/fb0d66f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/fb0d66f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/fb0d66f9

Branch: refs/heads/develop
Commit: fb0d66f93cec3cdcd466fe648e602d139ace7481
Parents: de548fd
Author: Christopher Collins <cc...@gmail.com>
Authored: Wed Mar 9 17:53:40 2016 -0800
Committer: Christopher Collins <cc...@gmail.com>
Committed: Wed Mar 9 17:53:40 2016 -0800

----------------------------------------------------------------------
 newt/builder/build.go        | 15 +++++++++++++--
 newt/builder/buildpackage.go | 14 +++++++++-----
 2 files changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/fb0d66f9/newt/builder/build.go
----------------------------------------------------------------------
diff --git a/newt/builder/build.go b/newt/builder/build.go
index 5a9a822..ba0d274 100644
--- a/newt/builder/build.go
+++ b/newt/builder/build.go
@@ -106,12 +106,23 @@ func (b *Builder) loadDeps() error {
 	for {
 		reprocess := false
 		for _, bpkg := range b.Packages {
-			resolved, err := bpkg.Resolve(b)
+			newFeatures, err := bpkg.Resolve(b)
 			if err != nil {
 				return err
 			}
 
-			if !resolved {
+			if newFeatures {
+				// A new supported feature was discovered.  It is impossible to
+				// determine what new dependency and API requirements are
+				// generated as a result.  All packages need to be reprocessed.
+				for _, bpkg := range b.Packages {
+					bpkg.depsResolved = false
+					bpkg.apisSatisfied = false
+				}
+				reprocess = true
+				break
+			}
+			if !bpkg.depsResolved || !bpkg.apisSatisfied {
 				reprocess = true
 			}
 		}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/fb0d66f9/newt/builder/buildpackage.go
----------------------------------------------------------------------
diff --git a/newt/builder/buildpackage.go b/newt/builder/buildpackage.go
index f12b9a4..cfebdce 100644
--- a/newt/builder/buildpackage.go
+++ b/newt/builder/buildpackage.go
@@ -294,13 +294,17 @@ func (bpkg *BuildPackage) privateIncludeDirs(b *Builder) []string {
 
 // Attempts to resolve all of a build package's dependencies, identities, APIs,
 // and required APIs.  This function should be called repeatedly until the
-// package is fully resolved.
+// package is fully resolved.  If a new supported feature is discovered by this
+// function, all pacakges need to be reprocessed from scratch.
 //
-// @return bool                 true if the package is fully resolved;
-//                              false if another call is required.
+// @return bool                 true if one or more new features was discovered
+//                              false if no new features were discovered
 func (bpkg *BuildPackage) Resolve(b *Builder) (bool, error) {
+	newFeatures := false
 	if !bpkg.depsResolved {
-		features, newFeatures := bpkg.loadFeatures(b)
+		var features map[string]bool
+
+		features, newFeatures = bpkg.loadFeatures(b)
 		newDeps, err := bpkg.loadDeps(b, features)
 		if err != nil {
 			return false, err
@@ -313,7 +317,7 @@ func (bpkg *BuildPackage) Resolve(b *Builder) (bool, error) {
 		bpkg.satisfyApis(b)
 	}
 
-	return bpkg.depsResolved && bpkg.apisSatisfied, nil
+	return newFeatures, nil
 }
 
 func (bp *BuildPackage) Init(pkg *pkg.LocalPackage) {


[2/3] incubator-mynewt-newt git commit: Don't crash on unresolvable dependency.

Posted by cc...@apache.org.
Don't crash on unresolvable dependency.


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/de548fdc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/de548fdc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/de548fdc

Branch: refs/heads/develop
Commit: de548fdc39a5d56443f8fa3ba9fbf8dfd7fa8c09
Parents: 59d9292
Author: Christopher Collins <cc...@gmail.com>
Authored: Wed Mar 9 17:43:30 2016 -0800
Committer: Christopher Collins <cc...@gmail.com>
Committed: Wed Mar 9 17:43:30 2016 -0800

----------------------------------------------------------------------
 newt/builder/buildpackage.go | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/de548fdc/newt/builder/buildpackage.go
----------------------------------------------------------------------
diff --git a/newt/builder/buildpackage.go b/newt/builder/buildpackage.go
index 3cbe560..f12b9a4 100644
--- a/newt/builder/buildpackage.go
+++ b/newt/builder/buildpackage.go
@@ -211,13 +211,8 @@ func (bpkg *BuildPackage) loadDeps(b *Builder,
 			return false, err
 		}
 
-		pkg := proj.ResolveDependency(newDep).(*pkg.LocalPackage)
-		if pkg == nil {
-			return false, util.NewNewtError("Cannot resolve dependency: " +
-				newDep.String())
-		}
-
-		if pkg == nil {
+		pkg, ok := proj.ResolveDependency(newDep).(*pkg.LocalPackage)
+		if !ok {
 			return false,
 				util.NewNewtError("Could not resolve package dependency " +
 					newDep.String())