Skip to content

Commit 48454f7

Browse files
committed
Merged release 1.4.1 into cli-inception
2 parents f9276b5 + f9d69df commit 48454f7

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

arduino-builder/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import (
5454
"github.com/go-errors/errors"
5555
)
5656

57-
const VERSION = "1.4.0"
57+
const VERSION = "1.4.1"
5858

5959
const FLAG_ACTION_COMPILE = "compile"
6060
const FLAG_ACTION_PREPROCESS = "preprocess"

builder_utils/utils.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,5 +524,10 @@ func GetCachedCoreArchiveFileName(fqbn string, coreFolder *paths.Path) string {
524524
coreFolder = absCoreFolder
525525
} // silently continue if absolute path can't be detected
526526
hash := utils.MD5Sum([]byte(coreFolder.String()))
527-
return "core_" + fqbnToUnderscore + "_" + hash + ".a"
527+
realName := "core_" + fqbnToUnderscore + "_" + hash + ".a"
528+
if len(realName) > 100 {
529+
// avoid really long names, simply hash the final part
530+
realName = "core_" + utils.MD5Sum([]byte(fqbnToUnderscore+"_"+hash)) + ".a"
531+
}
532+
return realName
528533
}

constants/constants.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,14 @@ const LOG_LEVEL_INFO = "info"
101101
const LOG_LEVEL_WARN = "warn"
102102
const MSG_ARCH_FOLDER_NOT_SUPPORTED = "'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information"
103103
const MSG_ARCHIVING_CORE_CACHE = "Archiving built core (caching) in: {0}"
104+
const MSG_ERROR_ARCHIVING_CORE_CACHE = "Error archiving built core (caching) in {0}: {1}"
105+
const MSG_CORE_CACHE_UNAVAILABLE = "Unable to cache built core, please tell {0} maintainers to follow http://goo.gl/QdCUjo"
104106
const MSG_BOARD_UNKNOWN = "Board {0} (platform {1}, package {2}) is unknown"
105107
const MSG_BOOTLOADER_FILE_MISSING = "Bootloader file specified but missing: {0}"
106108
const MSG_BUILD_OPTIONS_CHANGED = "Build options changed, rebuilding all"
107109
const MSG_CANT_FIND_SKETCH_IN_PATH = "Unable to find {0} in {1}"
108110
const MSG_FQBN_INVALID = "{0} is not a valid fully qualified board name. Required format is targetPackageName:targetPlatformName:targetBoardName."
111+
const MSG_FIND_INCLUDES_FAILED = "Error while detecting libraries included by {0}"
109112
const MSG_INVALID_QUOTING = "Invalid quoting: no closing [{0}] char found."
110113
const MSG_LIB_LEGACY = "(legacy)"
111114
const MSG_LIBRARIES_MULTIPLE_LIBS_FOUND_FOR = "Multiple libraries were found for \"{0}\""

container_find_includes.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,8 @@ func findIncludesUntilDone(ctx *types.Context, cache *includeCache, sourceFile t
343343
return i18n.WrapError(preproc_err)
344344
} else {
345345
include = IncludesFinderWithRegExp(ctx, string(preproc_stderr))
346-
if include == "" {
347-
// No include found? Bail out.
348-
os.Stderr.Write(preproc_stderr)
349-
return i18n.WrapError(preproc_err)
346+
if include == "" && ctx.Verbose {
347+
ctx.GetLogger().Println(constants.LOG_LEVEL_DEBUG, constants.MSG_FIND_INCLUDES_FAILED, sourcePath)
350348
}
351349
}
352350
}

phases/core_builder.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
package phases
3131

3232
import (
33+
"os"
34+
3335
"github.com/arduino/arduino-builder/builder_utils"
3436
"github.com/arduino/arduino-builder/constants"
3537
"github.com/arduino/arduino-builder/i18n"
@@ -121,11 +123,15 @@ func compileCore(ctx *types.Context, buildPath *paths.Path, buildCachePath *path
121123

122124
// archive core.a
123125
if targetArchivedCore != nil {
126+
err := archiveFile.CopyTo(targetArchivedCore)
124127
if ctx.Verbose {
125-
logger.Println(constants.LOG_LEVEL_INFO, constants.MSG_ARCHIVING_CORE_CACHE, targetArchivedCore)
126-
}
127-
if err := archiveFile.CopyTo(targetArchivedCore); err != nil {
128-
return nil, nil, i18n.WrapError(err)
128+
if err == nil {
129+
logger.Println(constants.LOG_LEVEL_INFO, constants.MSG_ARCHIVING_CORE_CACHE, targetArchivedCore)
130+
} else if os.IsNotExist(err) {
131+
logger.Println(constants.LOG_LEVEL_INFO, constants.MSG_CORE_CACHE_UNAVAILABLE, ctx.ActualPlatform)
132+
} else {
133+
logger.Println(constants.LOG_LEVEL_INFO, constants.MSG_ERROR_ARCHIVING_CORE_CACHE, targetArchivedCore, err)
134+
}
129135
}
130136
}
131137

0 commit comments

Comments
 (0)