Skip to content

Commit ff7f0d1

Browse files
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 <[email protected]>
1 parent 387269b commit ff7f0d1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: legacy/builder/builder_utils/utils.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,13 @@ func findAllFilesInFolder(sourcePath string, recurse bool) ([]string, error) {
154154
}
155155

156156
for _, folder := range folders {
157-
otherSources, err := findAllFilesInFolder(filepath.Join(sourcePath, folder.Name()), recurse)
158-
if err != nil {
159-
return nil, i18n.WrapError(err)
157+
if !utils.IsSCCSOrHiddenFile(folder) {
158+
otherSources, err := findAllFilesInFolder(filepath.Join(sourcePath, folder.Name()), recurse)
159+
if err != nil {
160+
return nil, i18n.WrapError(err)
161+
}
162+
sources = append(sources, otherSources...)
160163
}
161-
sources = append(sources, otherSources...)
162164
}
163165
}
164166

0 commit comments

Comments
 (0)