Skip to content

Commit 6b01393

Browse files
committed
Correct timestamp on CommonHFile.h
More improvements to printing Updated docs.
1 parent 9d6c1cb commit 6b01393

File tree

2 files changed

+31
-10
lines changed

2 files changed

+31
-10
lines changed

doc/faq/a06-global-build-options.rst

+10
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,16 @@ a hidden directory. For help with this do an Internet search on
123123
``windows disk cleanup``. Or, type ``disk cleanup`` in the Windows®
124124
taskbar search box.
125125

126+
You can run multiple Arduino IDE windows as long as you run one version
127+
of the Arduino IDE at a time. When testing different versions,
128+
completely exit one before starting the next version. For example,
129+
Arduino IDE 1.8.19 and Arduino IDE 2.0 work with different temp and
130+
build paths. With this combination, the workaround logic sometimes fails
131+
to enable. At the time of this writing, when Arduino IDE 2.0 rc5 exits,
132+
it leaves the temp space dirty. This keeps the workaround active the
133+
next time the IDE is started. If this is an issue, manually delete the
134+
temp files.
135+
126136
If you think your workflow performance would benefit from keeping a per
127137
Sketch copy of ``core.a``, you can turn off the “Aggressively cache
128138
compiled core” feature. You need to find the location of

tools/mkbuildoptglobals.py

+21-10
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,16 @@
212212

213213
def print_msg(*args, **kwargs):
214214
global msg_print_buf
215-
# At this time, we can only handle one args value.
215+
if 'sep' in kwargs:
216+
sep = kwargs['sep']
217+
else:
218+
sep = ' '
219+
216220
msg_print_buf += args[0]
221+
for arg in args[1:]:
222+
msg_print_buf += sep
223+
msg_print_buf += arg
224+
217225
if 'end' in kwargs:
218226
msg_print_buf += kwargs['end']
219227
else:
@@ -225,8 +233,7 @@ def print_err(*args, **kwargs):
225233
global err_print_flag
226234
if (args[0])[0] != ' ':
227235
print_msg("")
228-
print_msg("*** ", end='')
229-
print_msg(*args, **kwargs)
236+
print_msg("***", *args, **kwargs)
230237
err_print_flag = True
231238

232239

@@ -311,9 +318,9 @@ def extract_create_build_opt_file(globals_h_fqfn, file_name, build_opt_fqfn):
311318
if line == build_opt_signature:
312319
if complete_comment:
313320
build_opt_error = True
314-
print_err(" Multiple embedded build.opt blocks in " + file_name + ":" + str(line_no))
321+
print_err(" Multiple embedded build.opt blocks in", f'{file_name}:{line_no}')
315322
continue
316-
print_msg("Extracting embedded compiler command-line options from " + file_name + ":" + str(line_no))
323+
print_msg("Extracting embedded compiler command-line options from", f'{file_name}:{line_no}')
317324
for line in src:
318325
line = line.strip()
319326
line_no += 1
@@ -330,19 +337,19 @@ def extract_create_build_opt_file(globals_h_fqfn, file_name, build_opt_fqfn):
330337
continue
331338
# some consistency checking before writing - give some hints about what is wrong
332339
elif line == build_opt_signature:
333-
print_err(" Double begin before end for embedded build.opt block in " + file_name + ":" + str(line_no))
340+
print_err(" Double begin before end for embedded build.opt block in", f'{file_name}:{line_no}')
334341
build_opt_error = True
335342
elif line.startswith(build_opt_signature):
336-
print_err(" build.opt signature block ignored, trailing character for embedded build.opt block in " + file_name + ":" + str(line_no))
343+
print_err(" build.opt signature block ignored, trailing character for embedded build.opt block in", f'{file_name}:{line_no}')
337344
build_opt_error = True
338345
elif "/*" in line or "*/" in line :
339-
print_err(" Nesting issue for embedded build.opt block in " + file_name + ":" + str(line_no))
346+
print_err(" Nesting issue for embedded build.opt block in", f'{file_name}:{line_no}')
340347
build_opt_error = True
341348
else:
342-
print_msg(" Add command-line option: " + line)
349+
print_msg(" ", f'{line_no:2}, Add command-line option: {line}', sep='')
343350
build_opt.write(line + "\n")
344351
elif line.startswith(build_opt_signature):
345-
print_err(" build.opt signature block ignored, trailing character for embedded build.opt block in " + file_name + ":" + str(line_no))
352+
print_err(" build.opt signature block ignored, trailing character for embedded build.opt block in", f'{file_name}:{line_no}')
346353
build_opt_error = True
347354
if not complete_comment or build_opt_error:
348355
build_opt.truncate(0)
@@ -507,6 +514,10 @@ def main():
507514
not os.path.exists(commonhfile_fqfn):
508515
enable_override(False, commonhfile_fqfn)
509516

517+
if time.time_ns() < os.stat(commonhfile_fqfn).st_mtime_ns:
518+
print_err(f"Neutralize future timestamp on build file: {commonhfile_fqfn}")
519+
touch(commonhfile_fqfn)
520+
510521
if not os.path.exists(build_path_core):
511522
os.makedirs(build_path_core)
512523
print_msg("Clean build, created dir " + build_path_core)

0 commit comments

Comments
 (0)