Skip to content

Commit 3be2287

Browse files
earlephilhowerRoberto Sora
authored and
Roberto Sora
committed
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 arduino/arduino-builder#327 Signed-off-by: Earle F. Philhower, III <[email protected]> * Add comment to force rebuild
1 parent c0d3fa2 commit 3be2287

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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

+7-4
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,14 @@ 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+
// Skip SCCS directories as they do not influence the build and can be very large
159+
otherSources, err := findAllFilesInFolder(filepath.Join(sourcePath, folder.Name()), recurse)
160+
if err != nil {
161+
return nil, i18n.WrapError(err)
162+
}
163+
sources = append(sources, otherSources...)
160164
}
161-
sources = append(sources, otherSources...)
162165
}
163166
}
164167

0 commit comments

Comments
 (0)