From 3a68d2f621e9b86b045cbbe0edbed0a93fa51c80 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 18 Nov 2023 09:43:36 -0600 Subject: [PATCH] Fix build error when frozen modules are updated When a frozen module was added or updated, a build error would occur during CI: `KeyError: 'FROZEN_MPY_DIRS'`. In e40abda1bc I decided that it should be an error if all the expected keys were not defined in the board settings dict. I made this change and all seemed to be well; however, my testing did not exercise the case that a frozen module was changed. It turns out that FROZEN_MPY_DIRS was not being set in the board settings dict because the output of print-FROZEN_MPY_DIRS was "FROZEN_MPY_DIRS =" (which does not match the regular expression) instead of "FROZEN_MPY_DIRS = " (with a trailing space). This change fixes the problem by ensuring that an undefined or empty variable still prints with a space character after the equal character. Tested by running locally: ``` python3 -c 'import shared_bindings_matrix; print(shared_bindings_matrix.get_settings_from_makefile("ports/atmel-samd", "trinket_m0")["FROZEN_MPY_DIRS"])' ``` (prints a blank line, expected) as well as simulating a change to the asyncio frozen submodule: ``` python3 -c 'import shared_bindings_matrix; print(shared_bindings_matrix.get_settings_from_makefile("ports/atmel-samd", "trinket_m0")["FROZEN_MPY_DIRS"])' ``` (which will build the elecfreaks_picoed board) --- py/circuitpy_defns.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 1cb19ff61d..af5b305b63 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -877,4 +877,4 @@ invalid-board: # Print out the value of a make variable. # https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile print-%: - @echo $* = $($*) + @echo "$* = "$($*)