aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Challis <[email protected]>2025-04-19 23:09:54 +0100
committerGitHub <[email protected]>2025-04-20 08:09:54 +1000
commitedf34315affe4427f862ccd70ff2aa9143ee1966 (patch)
treeeb4b655d6c1e354e26af6f0c4f4ca1f1a7a78b68
parent800bc78d26ea02083be86596ab63fe7d4bf17e5c (diff)
downloadqmk_firmware-edf34315affe4427f862ccd70ff2aa9143ee1966.tar.gz
qmk_firmware-edf34315affe4427f862ccd70ff2aa9143ee1966.zip
Fix 'Would you like to clone the submodules?' prompt under msys (#24958)0.28.6
-rw-r--r--lib/python/qmk/cli/doctor/check.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/lib/python/qmk/cli/doctor/check.py b/lib/python/qmk/cli/doctor/check.py
index 2804a1d7df..51b0f0c80a 100644
--- a/lib/python/qmk/cli/doctor/check.py
+++ b/lib/python/qmk/cli/doctor/check.py
@@ -54,10 +54,13 @@ def _check_arm_gcc_installation():
"""Returns OK if the arm-none-eabi-gcc is fully installed and can produce binaries.
"""
with TemporaryDirectory() as temp_dir:
- temp_file = Path(temp_dir) / 'test.elf'
+ temp_in = Path(temp_dir) / 'test.c'
+ temp_out = Path(temp_dir) / 'test.elf'
- args = ['arm-none-eabi-gcc', '-mcpu=cortex-m0', '-mthumb', '-mno-thumb-interwork', '--specs=nosys.specs', '--specs=nano.specs', '-x', 'c', '-o', str(temp_file), '-']
- result = cli.run(args, stdin=None, stdout=None, stderr=None, input='#include <newlib.h>\nint main() { return __NEWLIB__ * __NEWLIB_MINOR__ * __NEWLIB_PATCHLEVEL__; }')
+ temp_in.write_text('#include <newlib.h>\nint main() { return __NEWLIB__ * __NEWLIB_MINOR__ * __NEWLIB_PATCHLEVEL__; }', encoding='utf-8')
+
+ args = ['arm-none-eabi-gcc', '-mcpu=cortex-m0', '-mthumb', '-mno-thumb-interwork', '--specs=nosys.specs', '--specs=nano.specs', '-x', 'c', '-o', str(temp_out), str(temp_in)]
+ result = cli.run(args, stdout=None, stderr=None)
if result.returncode == 0:
cli.log.info('Successfully compiled using arm-none-eabi-gcc')
else:
@@ -65,8 +68,8 @@ def _check_arm_gcc_installation():
cli.log.error(f'Command: {" ".join(args)}')
return CheckStatus.ERROR
- args = ['arm-none-eabi-size', str(temp_file)]
- result = cli.run(args, stdin=None, stdout=None, stderr=None)
+ args = ['arm-none-eabi-size', str(temp_out)]
+ result = cli.run(args, stdout=None, stderr=None)
if result.returncode == 0:
cli.log.info('Successfully tested arm-none-eabi-binutils using arm-none-eabi-size')
else:
@@ -91,10 +94,13 @@ def _check_avr_gcc_installation():
"""Returns OK if the avr-gcc is fully installed and can produce binaries.
"""
with TemporaryDirectory() as temp_dir:
- temp_file = Path(temp_dir) / 'test.elf'
+ temp_in = Path(temp_dir) / 'test.c'
+ temp_out = Path(temp_dir) / 'test.elf'
+
+ temp_in.write_text('int main() { return 0; }', encoding='utf-8')
- args = ['avr-gcc', '-mmcu=atmega32u4', '-x', 'c', '-o', str(temp_file), '-']
- result = cli.run(args, stdin=None, stdout=None, stderr=None, input='int main() { return 0; }')
+ args = ['avr-gcc', '-mmcu=atmega32u4', '-x', 'c', '-o', str(temp_out), str(temp_in)]
+ result = cli.run(args, stdout=None, stderr=None)
if result.returncode == 0:
cli.log.info('Successfully compiled using avr-gcc')
else:
@@ -102,8 +108,8 @@ def _check_avr_gcc_installation():
cli.log.error(f'Command: {" ".join(args)}')
return CheckStatus.ERROR
- args = ['avr-size', str(temp_file)]
- result = cli.run(args, stdin=None, stdout=None, stderr=None)
+ args = ['avr-size', str(temp_out)]
+ result = cli.run(args, stdout=None, stderr=None)
if result.returncode == 0:
cli.log.info('Successfully tested avr-binutils using avr-size')
else: