diff --git a/arduino/resources/checksums.go b/arduino/resources/checksums.go index 58cba7a0ffc..5e816b93c28 100644 --- a/arduino/resources/checksums.go +++ b/arduino/resources/checksums.go @@ -94,7 +94,7 @@ func (r *DownloadResource) TestLocalArchiveSize(downloadDir *paths.Path) (bool, return false, fmt.Errorf(tr("getting archive info: %s"), err) } if info.Size() != r.Size { - return false, fmt.Errorf(tr("fetched archive size differs from size specified in index")) + return false, fmt.Errorf("%s: %d != %d", tr("fetched archive size differs from size specified in index"), info.Size(), r.Size) } return true, nil diff --git a/commands/instances.go b/commands/instances.go index 79700833e3f..1b52fafd040 100644 --- a/commands/instances.go +++ b/commands/instances.go @@ -238,6 +238,27 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) erro return pm.LoadToolsFromPackageDir(builtinPackage, pm.PackagesDir.Join("builtin", "tools")) } + // Load Platforms + if profile == nil { + for _, err := range pm.LoadHardware() { + s := &arduino.PlatformLoadingError{Cause: err} + responseError(s.ToRPCStatus()) + } + } else { + // Load platforms from profile + errs := pm.LoadHardwareForProfile( + profile, true, downloadCallback, taskCallback, + ) + for _, err := range errs { + s := &arduino.PlatformLoadingError{Cause: err} + responseError(s.ToRPCStatus()) + } + + // Load "builtin" tools + _ = loadBuiltinTools() + } + + // Load packages index urls := []string{globals.DefaultIndexURL} if profile == nil { urls = append(urls, configuration.Settings.GetStringSlice("board_manager.additional_urls")...) @@ -265,26 +286,6 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) erro } } - // Load Platforms - if profile == nil { - for _, err := range pm.LoadHardware() { - s := &arduino.PlatformLoadingError{Cause: err} - responseError(s.ToRPCStatus()) - } - } else { - // Load platforms from profile - errs := pm.LoadHardwareForProfile( - profile, true, downloadCallback, taskCallback, - ) - for _, err := range errs { - s := &arduino.PlatformLoadingError{Cause: err} - responseError(s.ToRPCStatus()) - } - - // Load "builtin" tools - _ = loadBuiltinTools() - } - // We load hardware before verifying builtin tools are installed // otherwise we wouldn't find them and reinstall them each time // and they would never get reloaded.