Skip to content

Build cache files are completely cleared with one file change #2780

Open
@zatkhahi

Description

@zatkhahi

Describe the problem

Building with arduino-cli compile makes build cache in build-path directory. e.g.:
core
libraries
sketch
includes.cache
libraries.cache
...

but if any new file (header or cpp or event not compile-able file like .json files) adds to sketch folder it cleans all cache directory, even core and libraries. This will compile all core and libraries again and it takes too long.

To reproduce

1- compile a working project (specially with lots of dependencies)
e.g. run command
arduino-cli compile --fqbn esp32:esp32:esp32 demo --output-dir ./build/output --build-path ./build

2- add a new file to the sketch folder like test.h

3- see build directory while building started, all caches are removed

Expected behavior

whole build cache should not be removed by sketch only changes, at lease "core" and "libraries" which are too heavy to compile

Arduino CLI version

1.1.1

Operating system

Windows

Operating system version

Windows 11

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions