From 65b62a900f5c6c234040927fd3162e09b90fd163 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Thu, 8 Jan 2026 17:20:53 +1300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20More=20specific=20preprocess=20e?= =?UTF-8?q?xception=20(#28256)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- .../share/PlatformIO/scripts/preprocessor.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/preprocessor.py b/buildroot/share/PlatformIO/scripts/preprocessor.py index efc3a6261e..3cd279fa57 100644 --- a/buildroot/share/PlatformIO/scripts/preprocessor.py +++ b/buildroot/share/PlatformIO/scripts/preprocessor.py @@ -37,15 +37,20 @@ def run_preprocessor(env, fn=None): else: cmd += ['-D' + s] - cmd += ['-D__MARLIN_DEPS__ -w -dM -E -x c++'] - depcmd = cmd + [ filename ] - cmd = ' '.join(depcmd) + cmd += ['-D__MARLIN_DEPS__ -w -dM -E -x c++', filename] + + cmd = ' '.join(cmd) blab(cmd) + try: - define_list = subprocess.check_output(cmd, shell=True).splitlines() + define_list_text = subprocess.check_output(cmd, shell=True) except: - define_list = {} + raise RuntimeError(f"Command `{cmd}` failed during build pre-processing.") + + define_list = define_list_text.splitlines() if define_list_text else [] + preprocessor_cache[filename] = define_list + return define_list