sigprof / guix-qmk

GNU Guix support for QMK firmware
GNU General Public License v3.0
1 stars 2 forks source link

Compile error for rp2040 controller #15

Open minikN opened 1 month ago

minikN commented 1 month ago

Hello,

Thank you for this manifest. I've turned this into an rde feature for my personal usage. But it's essentially just a wrapper around your manifest that automatically adds the udev rules and correct user group.

That being said, I'm getting an error trying to compile for my ergoDash keoyboard using this micro controller:

Compiling: .build/obj_omkbd_ergodash_rev1_omkbd_ergodash_rev1_my_layout/src/default_keyboard.c     In file included from ./lib/pico-sdk/src/common/pico_base/include/pico/types.h:12:0,
                 from ./lib/pico-sdk/src/common/pico_base/include/pico.h:24,
                 from ./lib/pico-sdk/src/rp2_common/hardware_flash/include/hardware/flash.h:10,
                 from ./platforms/chibios/drivers/wear_leveling/wear_leveling_rp2040_flash_config.h:6,
                 from <command-line>:0:
./lib/pico-sdk/src/common/pico_base/include/pico/assert.h:18:10: fatal error: assert.h: No such file or directory
 #include <assert.h>
          ^~~~~~~~~~
compilation terminated.
 [ERRORS]
 |
 |
 |
make: *** [builddefs/common_rules.mk:373: .build/obj_omkbd_ergodash_rev1_omkbd_ergodash_rev1_my_layout/.build/obj_omkbd_ergodash_rev1_omkbd_ergodash_rev1_my_layout/src/default_keyboard.o] Error 1

Command used:

qmk compile ~/.local/share/git/dots/config/applications/qmk/ergoDash.json -e CONVERT_TO=helios

I'm not really familiar with qmk. This is my first keyboard using it. But I've compiled firmware for it on Windows successfully (using the same command after following basic setup guide)

Seems like something is missing on Guix. I'd appreciate any help on this. Thanks in advance.

sigprof commented 1 month ago

Looks like the compiler does not find its C library headers (newlib). One reason why this might happen is that the environment variables which are set by (native-search-paths new-search-paths) inside qmk-wrap-toolchain are not actually present in the environment where the compiler is invoked. Normally guix shell does that; does your solution collect native-search-paths from the listed packages and add them to the environment?

However, all that may be moot, because since QMK 0.25.0 the core QMK code for ChibiOS requires GCC >= 8, and Guix provides at most arm-none-eabi-nano-toolchain-7-2018-q2-update, so you will get compile errors like:

In file included from tmk_core/protocol/chibios/usb_main.h:16:0,
                 from tmk_core/protocol/chibios/usb_endpoints.c:7:
tmk_core/protocol/chibios/usb_report_handling.h:33:32: error: expected expression before '_Alignas'
         .reports            = (_Alignas(4) usb_fs_report_t *[_report_count]){_reports},                                                        \

So Guix is no longer suitable for building QMK firmware for ARM-based controllers until someone updates the ARM toolchain.