Merge "Show load cycles when running mk2rbc"
This commit is contained in:
@@ -173,7 +173,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
ok := true
|
ok := true
|
||||||
for _, mkFile := range files {
|
for _, mkFile := range files {
|
||||||
ok = convertOne(mkFile) && ok
|
ok = convertOne(mkFile, []string{}) && ok
|
||||||
}
|
}
|
||||||
|
|
||||||
if *launcher != "" {
|
if *launcher != "" {
|
||||||
@@ -183,7 +183,7 @@ func main() {
|
|||||||
if *inputVariables == "" {
|
if *inputVariables == "" {
|
||||||
quit(fmt.Errorf("the product launcher requires an input variables file"))
|
quit(fmt.Errorf("the product launcher requires an input variables file"))
|
||||||
}
|
}
|
||||||
if !convertOne(*inputVariables) {
|
if !convertOne(*inputVariables, []string{}) {
|
||||||
quit(fmt.Errorf("the product launcher input variables file failed to convert"))
|
quit(fmt.Errorf("the product launcher input variables file failed to convert"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ func main() {
|
|||||||
if *inputVariables == "" {
|
if *inputVariables == "" {
|
||||||
quit(fmt.Errorf("the board launcher requires an input variables file"))
|
quit(fmt.Errorf("the board launcher requires an input variables file"))
|
||||||
}
|
}
|
||||||
if !convertOne(*inputVariables) {
|
if !convertOne(*inputVariables, []string{}) {
|
||||||
quit(fmt.Errorf("the board launcher input variables file failed to convert"))
|
quit(fmt.Errorf("the board launcher input variables file failed to convert"))
|
||||||
}
|
}
|
||||||
err := writeGenerated(*boardlauncher, mk2rbc.BoardLauncher(
|
err := writeGenerated(*boardlauncher, mk2rbc.BoardLauncher(
|
||||||
@@ -310,9 +310,13 @@ const copyright = `#
|
|||||||
// the output hierarchy, or to the stdout.
|
// the output hierarchy, or to the stdout.
|
||||||
// Optionally, recursively convert the files this one includes by
|
// Optionally, recursively convert the files this one includes by
|
||||||
// $(call inherit-product) or an include statement.
|
// $(call inherit-product) or an include statement.
|
||||||
func convertOne(mkFile string) (ok bool) {
|
func convertOne(mkFile string, loadStack []string) (ok bool) {
|
||||||
if v, ok := converted[mkFile]; ok {
|
if v, ok := converted[mkFile]; ok {
|
||||||
return v != nil
|
if v == nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "Cycle in load graph:\n%s\n%s\n\n", strings.Join(loadStack, "\n"), mkFile)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
converted[mkFile] = nil
|
converted[mkFile] = nil
|
||||||
defer func() {
|
defer func() {
|
||||||
@@ -356,6 +360,7 @@ func convertOne(mkFile string) (ok bool) {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
loadStack = append(loadStack, mkFile)
|
||||||
ok = true
|
ok = true
|
||||||
if *recurse {
|
if *recurse {
|
||||||
for _, sub := range ss.SubConfigFiles() {
|
for _, sub := range ss.SubConfigFiles() {
|
||||||
@@ -363,7 +368,7 @@ func convertOne(mkFile string) (ok bool) {
|
|||||||
if _, err := os.Stat(sub); os.IsNotExist(err) {
|
if _, err := os.Stat(sub); os.IsNotExist(err) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
ok = convertOne(sub) && ok
|
ok = convertOne(sub, loadStack) && ok
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
converted[mkFile] = ss
|
converted[mkFile] = ss
|
||||||
|
Reference in New Issue
Block a user