Skip to content

Commit 07d9452

Browse files
committed
Ensure stable ordering when libraries are auto-included
This avoid cache invalidation if recompiled.
1 parent c70560a commit 07d9452

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/arduino/builder/internal/detector/detector.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ func (l *SketchLibrariesDetector) findIncludes(
275275
l.queueSourceFilesFromFolder(sourceFileQueue, srcSubfolderPath, true /* recurse */, sketchBuildPath, sketchBuildPath)
276276
}
277277

278-
for _, library := range l.librariesManager.FindAllInstalled() {
278+
allInstalledSorted := l.librariesManager.FindAllInstalled()
279+
allInstalledSorted.SortByName() // Sort libraries to ensure consistent ordering
280+
for _, library := range allInstalledSorted {
279281
if library.Location == libraries.Profile {
280282
l.logger.Info(i18n.Tr("The library %[1]s has been automatically added from sketch project.", library.Name))
281283
l.addAndBuildLibrary(sourceFileQueue, librariesBuildPath, library)

0 commit comments

Comments
 (0)