@@ -477,7 +477,7 @@ def main():
477
477
print_msg ("Using global include from " + source_globals_h_fqfn )
478
478
else :
479
479
print_msg ("Note: optional global include file '" + source_globals_h_fqfn + "' does not exist." )
480
- print_msg (" (please check " + docs_url + ")" )
480
+ print_msg (" Read more at " + docs_url )
481
481
482
482
copy_create_build_file (source_globals_h_fqfn , globals_h_fqfn )
483
483
@@ -487,10 +487,26 @@ def main():
487
487
embedded_options = extract_create_build_opt_file (globals_h_fqfn , globals_name , build_opt_fqfn )
488
488
489
489
if use_aggressive_caching_workaround :
490
+ # commonhfile_fqfn encodes the following information
491
+ # 1. When touched, it causes a rebuild of core.a
492
+ # 2. When file size is non-zero, it indicates we are using the
493
+ # aggressive cache workaround. The workaround is set to true
494
+ # (active) when we discover a non-zero length global .h file in
495
+ # any sketch. The aggressive workaround is cleared on the 1ST
496
+ # compile by the Arduino IDE after starting.
497
+ # 3. When the timestamp matches the build copy of globals.h
498
+ # (globals_h_fqfn), we know one two things:
499
+ # * The cached core.a matches up to the current build.opt and
500
+ # globals.h. The current sketch owns the cached copy of core.a.
501
+ # * globals.h has not changed, and no need to rebuild core.a
502
+ # 4. When core.a's timestamp does not match the build copy of
503
+ # the global .h file, we only know we need to rebuild core.a, and
504
+ # that is enough.
505
+ #
490
506
# When the sketch build has a "Sketch.ino.globals.h" file in the
491
507
# build tree that exactly matches the timestamp of "CommonHFile.h"
492
- # in the platform source tree, it owns the core cache. If not, or
493
- # "Sketch.ino.globals.h" has changed, rebuild core.
508
+ # in the platform source tree, it owns the core.a cache copy . If
509
+ # not, or "Sketch.ino.globals.h" has changed, rebuild core.
494
510
# A non-zero file size for commonhfile_fqfn, means we have seen a
495
511
# globals.h file before and workaround is active.
496
512
if os .path .getsize (commonhfile_fqfn ):
0 commit comments