Skip to content

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

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 3 commits into from
Sep 5, 2019
Merged
Changes from 1 commit
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
Next Next commit
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 arduino/arduino-builder#327

Signed-off-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
  • Loading branch information
earlephilhower committed Aug 30, 2019
commit ff7f0d1e4c85fcb004c107c07b94c48dd66f6497
10 changes: 6 additions & 4 deletions legacy/builder/builder_utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,13 @@ 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) {
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...)
}
}

Expand Down