Invalidate core cache if external dependency was modified #2382
Labels
topic: build-process
Related to the sketch build process
topic: code
Related to content of the project itself
type: enhancement
Proposed improvement
Describe the request
Add an option to prevent caching or to clear the cache.
Describe the current behavior
Some libraries and board package use a
build_opt.h
file in the sketch to configure the board core or indeed a library.See for example here:
https://github.com/stm32duino/wiki/wiki/Customize-build-options-using-build_opt.h
The problem is that swapping between sketches that use slightly different build options will fail to use the new options.
The crude work-around is to select a different processor, compile (even if this generates errors) so the cache is deleted/changed, then swap back to the correct processor and compile again. Clearly this is a rather clumsy way of forcing a cache clear.
If there is a neater solution then please post it. Otherwise please update the IDE with an option to use/not use caching. Clearly this option can default to the current arrangement.
Demo
🙁 The cached core was used even though a dependency had changed.
The expected result is that the cache would be invalidated, which in this simplified demo would result in the compilation failing:
Arduino CLI version
Original report
0.27.1
Last verified with
b82a519
Operating system
Windows
Operating system version
10/11
Additional context
See:
https://github.com/stm32duino/wiki/wiki/Customize-build-options-using-build_opt.h
Note that the suggested approach of closing the IDE and opening again no longer works.
Related
Issue checklist
The text was updated successfully, but these errors were encountered: