Skip to content

Commit c9d47b4

Browse files
committed
Fixed wrong tool selection if many packagers provides it
Fix #73
1 parent 22e49ad commit c9d47b4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: arduino/cores/packagemanager/package_manager.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,9 @@ func (pm *PackageManager) GetAllInstalledToolsReleases() []*cores.ToolRelease {
355355
}
356356

357357
func (pm *PackageManager) FindToolsRequiredForBoard(board *cores.Board) ([]*cores.ToolRelease, error) {
358-
// core := board.Properties["build.core"]
358+
pm.Log.Infof("Searching tools required for board %s", board)
359359

360+
// core := board.Properties["build.core"]
360361
platform := board.PlatformRelease
361362

362363
// maps "PACKAGER:TOOL" => ToolRelease
@@ -368,18 +369,19 @@ func (pm *PackageManager) FindToolsRequiredForBoard(board *cores.Board) ([]*core
368369
for _, tool := range targetPackage.Tools {
369370
rel := tool.GetLatestInstalled()
370371
if rel != nil {
371-
foundTools[rel.Tool.String()] = rel
372+
foundTools[rel.Tool.Name] = rel
372373
}
373374
}
374375
}
375376

376377
// replace the default tools above with the specific required by the current platform
377378
for _, toolDep := range platform.Dependencies {
379+
pm.Log.WithField("tool", toolDep).Infof("Required tool")
378380
tool := pm.FindToolDependency(toolDep)
379381
if tool == nil {
380382
return nil, fmt.Errorf("tool release not found: %s", toolDep)
381383
}
382-
foundTools[tool.Tool.String()] = tool
384+
foundTools[tool.Tool.Name] = tool
383385
}
384386

385387
requiredTools := []*cores.ToolRelease{}

0 commit comments

Comments
 (0)