You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/08/03 17:24:50 UTC

[GitHub] ccollins476ad closed pull request #197: syscfg: error detection after API resolution

ccollins476ad closed pull request #197: syscfg: error detection after API resolution
URL: https://github.com/apache/mynewt-newt/pull/197
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/newt/resolve/resolve.go b/newt/resolve/resolve.go
index 1c1b195f..97294cfe 100644
--- a/newt/resolve/resolve.go
+++ b/newt/resolve/resolve.go
@@ -648,6 +648,7 @@ func ResolveFull(
 	if loaderSeeds == nil {
 		res.AppSet.Rpkgs = r.rpkgSlice()
 		res.LoaderSet = nil
+		res.Cfg.DetectErrors(flashMap)
 		return res, nil
 	}
 
@@ -692,6 +693,8 @@ func ResolveFull(
 		return nil, err
 	}
 
+	res.Cfg.DetectErrors(flashMap)
+
 	return res, nil
 }
 
diff --git a/newt/syscfg/syscfg.go b/newt/syscfg/syscfg.go
index 16ddb529..c2ff4885 100644
--- a/newt/syscfg/syscfg.go
+++ b/newt/syscfg/syscfg.go
@@ -1009,6 +1009,15 @@ func (cfg *Cfg) detectAmbiguities() {
 	}
 }
 
+// Detects and records errors in the build's syscfg.  This should only be
+// called after APIs are resolved to avoid false positives.
+func (cfg *Cfg) DetectErrors(flashMap flash.FlashMap) {
+	cfg.detectAmbiguities()
+	cfg.detectViolations()
+	cfg.detectPriorityViolations()
+	cfg.detectFlashConflicts(flashMap)
+}
+
 func Read(lpkgs []*pkg.LocalPackage, apis []string,
 	injectedSettings map[string]string, settings map[string]string,
 	flashMap flash.FlashMap) (Cfg, error) {
@@ -1069,11 +1078,6 @@ func Read(lpkgs []*pkg.LocalPackage, apis []string,
 		}
 	}
 
-	cfg.detectAmbiguities()
-	cfg.detectViolations()
-	cfg.detectPriorityViolations()
-	cfg.detectFlashConflicts(flashMap)
-
 	return cfg, nil
 }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services