From 2a72f491e4fcea46a00fc8ee095c96c198c142c5 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 21 Jul 2020 05:09:33 -0300 Subject: [PATCH] Fix build for Windows path edge case --- .../scripts/common-features-dependencies.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/common-features-dependencies.py b/buildroot/share/PlatformIO/scripts/common-features-dependencies.py index 1612904638..a04f2e0eea 100644 --- a/buildroot/share/PlatformIO/scripts/common-features-dependencies.py +++ b/buildroot/share/PlatformIO/scripts/common-features-dependencies.py @@ -127,19 +127,13 @@ def install_features_dependencies(): def search_compiler(): if env['PLATFORM'] == 'win32': # the first path have the compiler - compiler_path = None for path in env['ENV']['PATH'].split(';'): - if re.search(r'platformio\\packages.*\\bin', path): - compiler_path = path - break - if compiler_path == None: - print("Could not find the g++ path") - return None - - print(compiler_path) - for file in os.listdir(compiler_path): - if file.endswith("g++.exe"): - return file + if not re.search(r'platformio\\packages.*\\bin', path): + continue + #print(path) + for file in os.listdir(path): + if file.endswith("g++.exe"): + return file print("Could not find the g++") return None else: