esp-rs / embuild

Build support for embedded Rust: Cargo integration with other embedded build ecosystems & tools, like PlatformIO, CMake and kconfig.
Apache License 2.0
139 stars 40 forks source link

fixes missing include dirs for ulp_fsm compilation #68

Closed taunusflieger closed 1 year ago

taunusflieger commented 1 year ago

This fixes a issue when compiling an assembler file for the ESP32 ulp. gcc was not provided the list of include directories. It seems this is caused by a regression introduced with https://github.com/esp-rs/embuild/commit/c0e52801875b244e1279a6680f22a6a10f41dfad. The include directories are provided through the env variable DEP_ESP_IDF_EMBUILD_C_INCLUDE_ARGS which is further processed (unescaped). The change introduced with the above commit was that the include paths are provided with a -isystem prefix. The unescape function was not modified to cope with that change which resulted in an empty include dir list. The PR addresses this issue.

Remarks: I don't understand why the following code is in line 228

       .flat_map(|s| iter::once("-I".to_owned()).chain(iter::once(s)))

This creates a gcc argument like this "-I" "-isystem/..." which I think is wrong. The "-I" is not required. I deleted the line.

I'm not sure what line 228-239 is doing, it seems that it will not be called, but there is a similar handling of the "-I" argument which might need to be removed as well.

I'm also unsure about line 247. Why removing the -I and later adding it in the way it is done in line 228

ivmarkov commented 1 year ago

Closed as #76 is merged now.