Skip to content
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

Fixes preflight-checks.py #21365

Closed
Closed
Changes from all commits
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
8 changes: 4 additions & 4 deletions buildroot/share/PlatformIO/scripts/preflight-checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ def get_envs_for_board(board, envregex):
line = file.readline()
found_envs = re.match(r"\s*#include .+" + envregex, line)
if found_envs:
return re.findall(envregex + r"(\w+)", line)
return re.findall(re.compile("%s\w+" % envregex), line)
return []

def check_envs(build_env, board_envs, config):
if build_env in board_envs:
def check_envs(build_env, board_envs, config, envregex):
if any((re.compile("%s%s" % (envregex,build_env)).match(x)) for x in board_envs):
return True
ext = config.get(build_env, 'extends', default=None)
if ext:
Expand Down Expand Up @@ -56,7 +56,7 @@ def check_envs(build_env, board_envs, config):
motherboard = env['MARLIN_FEATURES']['MOTHERBOARD']
board_envs = get_envs_for_board(motherboard, osregex)
config = env.GetProjectConfig()
result = check_envs(build_env, board_envs, config)
result = check_envs(build_env, board_envs, config, osregex)

if not result:
err = "Error: Build environment '%s' is incompatible with %s. Use one of these: %s" % \
Expand Down