Commit 3be22875 authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by Roberto Sora

Don't scan hidden directories in arduino-builder (.git, etc.) (#366)

* Don't scan hidden directories in arduino-builder

Arduino-builder scans the core to determine if core config files have
changed between invocations.  Unfortunately, it goes into SCCS dirs
such as .git (which can have 100,000+ files).  This is wasted effort
and can cause massive amounts of runtime and memory use when core
developers are building in their git clones.

Use a new function already added by the builder/utils.go to determine
if a file or folder is SCCS, and if so skip it in the rebuild-required
check.

Fixes https://github.com/arduino/arduino-builder/issues/327Signed-off-by: default avatarEarle F. Philhower, III <earlephilhower@yahoo.com>

* Add comment to force rebuild
parent c0d3fa21
......@@ -154,11 +154,14 @@ func findAllFilesInFolder(sourcePath string, recurse bool) ([]string, error) {
}
for _, folder := range folders {
otherSources, err := findAllFilesInFolder(filepath.Join(sourcePath, folder.Name()), recurse)
if err != nil {
return nil, i18n.WrapError(err)
if !utils.IsSCCSOrHiddenFile(folder) {
// Skip SCCS directories as they do not influence the build and can be very large
otherSources, err := findAllFilesInFolder(filepath.Join(sourcePath, folder.Name()), recurse)
if err != nil {
return nil, i18n.WrapError(err)
}
sources = append(sources, otherSources...)
}
sources = append(sources, otherSources...)
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment