Skip to content

Commit 2c45e71

Browse files
committed
Expanded comment and made print help consistent
1 parent 7932a24 commit 2c45e71

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

tools/mkbuildoptglobals.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def main():
477477
print_msg("Using global include from " + source_globals_h_fqfn)
478478
else:
479479
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)
481481

482482
copy_create_build_file(source_globals_h_fqfn, globals_h_fqfn)
483483

@@ -487,10 +487,26 @@ def main():
487487
embedded_options = extract_create_build_opt_file(globals_h_fqfn, globals_name, build_opt_fqfn)
488488

489489
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+
#
490506
# When the sketch build has a "Sketch.ino.globals.h" file in the
491507
# 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.
494510
# A non-zero file size for commonhfile_fqfn, means we have seen a
495511
# globals.h file before and workaround is active.
496512
if os.path.getsize(commonhfile_fqfn):

0 commit comments

Comments
 (0)