Skip GCC pre-process task if sketch and dependencies do not change.#3112
Skip GCC pre-process task if sketch and dependencies do not change.#3112giulio93 wants to merge 10 commits intoarduino:masterfrom
Conversation
9e0a18c to
0a0a741
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3112 +/- ##
==========================================
+ Coverage 69.57% 69.62% +0.04%
==========================================
Files 253 253
Lines 19280 19293 +13
==========================================
+ Hits 13414 13432 +18
+ Misses 4628 4625 -3
+ Partials 1238 1236 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dca1c06 to
32b1aac
Compare
5d53241 to
f2230ee
Compare
This changes does some cleanup in the generation and use of the merged sketch (sketch.ino.cpp.merged) and Arduino Preprocessed sketch (sketch.ino.cpp).
| preprocessedSketch, err := l.makeSourceFile(sketchBuildPath, sketchBuildPath, paths.New(sketch.MainFile.Base()+".cpp")) | ||
| if err != nil { | ||
| return err | ||
| } |
There was a problem hiding this comment.
the preprocessedSketch seems not used in the code (the file is removed a few lines below)
There was a problem hiding this comment.
The file is removed from the queue, we add it here in order to be able to intercept it
|
|
||
| b.logIfVerbose(false, i18n.Tr("Generating function prototypes...")) | ||
| if err := b.preprocessSketch(b.libsDetector.IncludeFolders()); err != nil { | ||
| if err := b.preprocessSketch(b.libsDetector.IncludeFolders(), b.libsDetector.IsSketchUnchanged()); err != nil { |
There was a problem hiding this comment.
Why not check the boolean of the sketch here instead of passing the boolean down the preprocessor?
| if err := b.preprocessSketch(b.libsDetector.IncludeFolders(), b.libsDetector.IsSketchUnchanged()); err != nil { | |
| if b.libsDetector.IsSketchUnchanged() { | |
| // log skip unchanged | |
| b.Progress.CompleteStep() | |
| return nli | |
| } | |
| if err := b.preprocessSketch(b.libsDetector.IncludeFolders()); err != nil { |
Please check if the PR fulfills these requirements
See how to contribute
before creating one)
our contributing guidelines
UPGRADING.mdhas been updated with a migration guide (for breaking changes)configuration.schema.jsonupdated if new parameters are added.What kind of change does this PR introduce?
In an effort to optimize compilation times, this PR adds the ability to the Arduino CLI to detect whether the Arduino Preprocessing of the sketch could be skipped.
What is the current behavior?
The GCC task is run even if the Task did not changed
What is the new behavior?
The GCC task args are hashed and is stored in order to be able to compare it with prev/next recompile GCC task
Does this PR introduce a breaking change, and is titled accordingly?
Other information