Skip to content

Commit

Permalink
Fix preflight complex extend handling (MarlinFirmware#21191)
Browse files Browse the repository at this point in the history
  • Loading branch information
kad committed Feb 27, 2021
1 parent 56462cf commit 24623d3
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions buildroot/share/PlatformIO/scripts/preflight-checks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# preflight-checks.py
# Script to check for common issues prior to compiling
# Check for common issues prior to compiling
#
import os
import re
Expand All @@ -25,9 +25,12 @@ def check_envs(build_env, base_envs, config):
return True
ext = config.get(build_env, 'extends', default=None)
if ext:
for ext_env in ext:
if check_envs(ext_env, base_envs, config):
return True
if isinstance(ext, str):
return check_envs(ext, base_envs, config)
elif isinstance(ext, list):
for ext_env in ext:
if check_envs(ext_env, base_envs, config):
return True
return False

# Sanity checks:
Expand Down Expand Up @@ -56,7 +59,7 @@ def check_envs(build_env, base_envs, config):
# Check for Config files in two common incorrect places
#
for p in [ env['PROJECT_DIR'], os.path.join(env['PROJECT_DIR'], "config") ]:
for f in [ "Configuration.h", "Configuration_adv.h" ]:
if os.path.isfile(os.path.join(p, f)):
err = "ERROR: Config files found in directory %s. Please move them into the Marlin subfolder." % p
raise SystemExit(err)
for f in [ "Configuration.h", "Configuration_adv.h" ]:
if os.path.isfile(os.path.join(p, f)):
err = "ERROR: Config files found in directory %s. Please move them into the Marlin subfolder." % p
raise SystemExit(err)

0 comments on commit 24623d3

Please sign in to comment.