Skip to content

Commit 2242b5c

Browse files
committed
Improve error reporting on core archive creation
1 parent ab41198 commit 2242b5c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

constants/constants.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ const LOG_LEVEL_INFO = "info"
154154
const LOG_LEVEL_WARN = "warn"
155155
const MSG_ARCH_FOLDER_NOT_SUPPORTED = "'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information"
156156
const MSG_ARCHIVING_CORE_CACHE = "Archiving built core (caching) in: {0}"
157+
const MSG_CORE_CACHE_UNAVAILABLE = "Unable to cache built core, please tell {0} maintainers to follow http://goo.gl/QdCUjo"
157158
const MSG_BOARD_UNKNOWN = "Board {0} (platform {1}, package {2}) is unknown"
158159
const MSG_BOOTLOADER_FILE_MISSING = "Bootloader file specified but missing: {0}"
159160
const MSG_BUILD_OPTIONS_CHANGED = "Build options changed, rebuilding all"

phases/core_builder.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,14 @@ func compileCore(ctx *types.Context, buildPath string, buildCachePath string, bu
124124

125125
// archive core.a
126126
if targetArchivedCore != "" {
127+
err := builder_utils.CopyFile(archiveFile, targetArchivedCore)
127128
if ctx.Verbose {
128-
logger.Println(constants.LOG_LEVEL_INFO, constants.MSG_ARCHIVING_CORE_CACHE, targetArchivedCore)
129+
if err == nil {
130+
logger.Println(constants.LOG_LEVEL_INFO, constants.MSG_ARCHIVING_CORE_CACHE, targetArchivedCore)
131+
} else {
132+
logger.Println(constants.LOG_LEVEL_INFO, constants.MSG_CORE_CACHE_UNAVAILABLE, ctx.ActualPlatform.PlatformId)
133+
}
129134
}
130-
builder_utils.CopyFile(archiveFile, targetArchivedCore)
131135
}
132136

133137
return archiveFile, variantObjectFiles, nil

0 commit comments

Comments
 (0)