Micropython rp2 fails to build on windows systems.
When attempting to build micropython for rp2040 in a windows environment, the make/cmake environment generates a command line that exceeds the windows10/cmd.exe line length limit of 8191 characters.
This is because the RP2 SDK requires about 3k worth of C include paths, and the list of files compiled that is generated on a single command line is about 6k (depending on exact path names.)
Extensive discussion and whining here: https://www.raspberrypi.org/forums/viewtopic.php?f=144&t=306333
I'll add that compiling all the C files for micropython with a single command line seems ... dangerously likely not to scale well on other build platforms as well.
RP2:
Checks
-
I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.
-
I've searched for existing issues matching this bug, and didn't find any.
Port, board and/or hardware
RP2, Pi Pico W
MicroPython version
Hi,
This maybe a pico-sdk bug? But posting here since I'm building micropython for Pico W with double precision ...
Building v1.22.0-402-g03cf4d498-dirty, using ARM toolchain 13.2.Rel1-x86_64-arm-none-eabi
System specs are: Linux 6.1.67-gentoo-x86_64, AMD Ryzen 5 1600X, 32GiB RAM
Build fails at object linking stage.
Solution provided, but this might break something else downstream?
Reproduction
make -C mpy-cross
cd ports/rp2/
make BOARD=RPI_PICO_W submodules
make BOARD=RPI_PICO_W clean
make BOARD=RPI_PICO_W
Expected behaviour
Expect object linkage to complete successfully
Observed behaviour
In file included from /micropython/lib/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:72,
from /micropython/lib/pico-sdk/src/common/pico_base/include/pico.h:33,
from /micropython/lib/pico-sdk/src/common/pico_binary_info/include/pico/binary_info/code.h:13,
from /micropython/lib/pico-sdk/src/common/pico_binary_info/include/pico/binary_info.h:28,
from /micropython/lib/pico-sdk/src/rp2_common/pico_standard_link/binary_info.c:8:
/micropython/ports/rp2/sys/cdefs.h:234: error: "__packed" redefined [-Werror]
234 | #define __packed attribute((packed))
|
In file included from /micropython/lib/pico-sdk/src/common/pico_binary_info/include/pico/binary_info.h:24:
/micropython/lib/pico-sdk/src/common/pico_binary_info/include/pico/binary_info/structure.h:21: note: this is the location of the previous definition
21 | #define __packed attribute((packed))
|
cc1: all warnings being treated as errors
make[3]: *** [CMakeFiles/firmware.dir/build.make:6871: CMakeFiles/firmware.dir/micropython/lib/pico-sdk/src/rp2_common/pico_standard_link/binary_info.c.obj] Error 1
make[2]: *** [CMakeFiles/Makefile2:1516: CMakeFiles/firmware.dir/all] Error 2
make[1]: *** [Makefile:91: all] Error 2
See https://github.com/micropython/micropython/wiki/Build-Troubleshooting
make: *** [Makefile:60: all] Error 1
Additional Information
Bug fixed with following patch on
micropython/lib/pico-sdk/src/common/pico_binary_info/include/pico/binary_info/structure.h
21c21
< #define __packed __attribute__((packed))
---
> #define __packed __attribute__((__packed__))