8000 New handling of missing perferences.txt by mhightower83 · Pull Request #8814 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

New handling of missing perferences.txt #8814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
New handling of missing perferences.txt
Draft: alternative option for handling missing perferences.txt - safe-mode
  • Loading branch information
mhightower83 committed Jan 17, 2023
commit 956dd59f3bd28c472fd2d25bce7c19d52eca329f
16 changes: 9 additions & 7 deletions tools/mkbuildoptglobals.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,15 +510,17 @@ def check_preferences_txt(runtime_ide_path, preferences_file):
# This should never fail.
file_fqfn = find_preferences_txt(runtime_ide_path)
if file_fqfn[0] != None:
print_msg(f"Using preferences from '{file_fqfn[0]}'")
val0 = get_preferences_txt(file_fqfn[0], key)
val1 = val0
if file_fqfn[1] != None:
val1 = get_preferences_txt(file_fqfn[1], key)
if val0 == val1: # We can safely ignore that there were two preferences.txt files
print_msg(f"Using preferences from '{file_fqfn[0]}'")
return val0
else:
print_err(f"Found too many preferences.txt files with different values for '{key}'")
print_err(f" '{file_fqfn[0]}'")
print_err(f" '{file_fqfn[1]}'")
raise UserWarning
else:
# Something is wrong with the installation or our understanding of the installation.
Expand Down Expand Up @@ -595,13 +597,13 @@ def determine_cache_state(args, runtime_ide_path, source_globals_h_fqfn):
caching_enabled = check_preferences_txt(ide_path, preferences_fqfn)
except UserWarning:
if os.path.exists(source_globals_h_fqfn):
caching_enabled = None
print_err(f" runtime_ide_version: {args.runtime_ide_version}")
print_err(f" This must be resolved to use '{globals_name}'")
print_err(f" When using '{globals_name}', resolve these issues for better build performance.")
print_err(f" Using safe-mode")
print_err(f" Read more at {docs_url}")
else:
# We can quietly ignore the problem because we are not needed.
caching_enabled = True
# fall-through fail case - assume the worst case - safe-mode
# else case - We can quietly ignore the problem because we are not needed
caching_enabled = True

return caching_enabled

Expand Down Expand Up @@ -742,7 +744,7 @@ def main():

use_aggressive_caching_workaround = determine_cache_state(args, runtime_ide_path, source_globals_h_fqfn)
if use_aggressive_caching_workaround == None:
# Specific rrror messages already buffered
# Specific error messages already buffered
handle_error(1)

print_dbg(f"first_time: {first_time}")
Expand Down
0