Skip to content

Only use builtin_tools_versions.txt if its folder is builtin #247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/arduino.cc/builder/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ const MSG_BUILD_OPTIONS_CHANGED = "Build options changed, rebuilding all"
const MSG_CANT_FIND_SKETCH_IN_PATH = "Unable to find {0} in {1}"
const MSG_FQBN_INVALID = "{0} is not a valid fully qualified board name. Required format is targetPackageName:targetPlatformName:targetBoardName."
const MSG_INVALID_QUOTING = "Invalid quoting: no closing [{0}] char found."
const MSG_IGNORED_BUILTIN_TOOLS_TXT = "Skipping {0}; please consider removing that file since it may hurt older Arduino installations"
const MSG_LIB_LEGACY = "(legacy)"
const MSG_LIBRARIES_MULTIPLE_LIBS_FOUND_FOR = "Multiple libraries were found for \"{0}\""
const MSG_LIBRARIES_NOT_USED = " Not used: {0}"
Expand Down
10 changes: 10 additions & 0 deletions src/arduino.cc/builder/tools_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ func (s *ToolsLoader) Run(ctx *types.Context) error {
if err != nil {
return i18n.WrapError(err)
}
builtinHardwareFolder := ""
if len(ctx.BuiltInLibrariesFolders) > 0 {
builtinHardwareFolder, err = filepath.Abs(filepath.Join(ctx.BuiltInLibrariesFolders[0], ".."))
}

if builtinToolsVersionsFile != constants.EMPTY_STRING && !strings.Contains(builtinToolsVersionsFile, builtinHardwareFolder) {
ctx.GetLogger().Println(constants.LOG_LEVEL_WARN, constants.MSG_IGNORED_BUILTIN_TOOLS_TXT, builtinToolsVersionsFile)
builtinToolsVersionsFile = constants.EMPTY_STRING
}

if builtinToolsVersionsFile != constants.EMPTY_STRING {
err = loadToolsFrom(&tools, builtinToolsVersionsFile)
if err != nil {
Expand Down