Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
QMK Bot 2025-04-19 22:10:27 +00:00
commit c8763c9fdb

View File

@ -54,10 +54,13 @@ def _check_arm_gcc_installation():
"""Returns OK if the arm-none-eabi-gcc is fully installed and can produce binaries. """Returns OK if the arm-none-eabi-gcc is fully installed and can produce binaries.
""" """
with TemporaryDirectory() as temp_dir: 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), '-'] temp_in.write_text('#include <newlib.h>\nint main() { return __NEWLIB__ * __NEWLIB_MINOR__ * __NEWLIB_PATCHLEVEL__; }', encoding='utf-8')
result = cli.run(args, stdin=None, stdout=None, stderr=None, input='#include <newlib.h>\nint main() { return __NEWLIB__ * __NEWLIB_MINOR__ * __NEWLIB_PATCHLEVEL__; }')
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: if result.returncode == 0:
cli.log.info('Successfully compiled using arm-none-eabi-gcc') cli.log.info('Successfully compiled using arm-none-eabi-gcc')
else: else:
@ -65,8 +68,8 @@ def _check_arm_gcc_installation():
cli.log.error(f'Command: {" ".join(args)}') cli.log.error(f'Command: {" ".join(args)}')
return CheckStatus.ERROR return CheckStatus.ERROR
args = ['arm-none-eabi-size', str(temp_file)] args = ['arm-none-eabi-size', str(temp_out)]
result = cli.run(args, stdin=None, stdout=None, stderr=None) result = cli.run(args, stdout=None, stderr=None)
if result.returncode == 0: if result.returncode == 0:
cli.log.info('Successfully tested arm-none-eabi-binutils using arm-none-eabi-size') cli.log.info('Successfully tested arm-none-eabi-binutils using arm-none-eabi-size')
else: else:
@ -91,10 +94,13 @@ def _check_avr_gcc_installation():
"""Returns OK if the avr-gcc is fully installed and can produce binaries. """Returns OK if the avr-gcc is fully installed and can produce binaries.
""" """
with TemporaryDirectory() as temp_dir: 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 = ['avr-gcc', '-mmcu=atmega32u4', '-x', 'c', '-o', str(temp_file), '-'] temp_in.write_text('int main() { return 0; }', encoding='utf-8')
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: if result.returncode == 0:
cli.log.info('Successfully compiled using avr-gcc') cli.log.info('Successfully compiled using avr-gcc')
else: else:
@ -102,8 +108,8 @@ def _check_avr_gcc_installation():
cli.log.error(f'Command: {" ".join(args)}') cli.log.error(f'Command: {" ".join(args)}')
return CheckStatus.ERROR return CheckStatus.ERROR
args = ['avr-size', str(temp_file)] args = ['avr-size', str(temp_out)]
result = cli.run(args, stdin=None, stdout=None, stderr=None) result = cli.run(args, stdout=None, stderr=None)
if result.returncode == 0: if result.returncode == 0:
cli.log.info('Successfully tested avr-binutils using avr-size') cli.log.info('Successfully tested avr-binutils using avr-size')
else: else: