What is the exact Compiler Include Path?

Can someone explain the mechanism that is used to define the include path for the compiler? I’m building an ESP32 project with local compilation. It seems that some paths are modified by various yaml file contents. Is that correct?

For example in my project FreeRTOS.h is located in the directory…

    ./deps/freertos/FreeRTOS/Source/include 

but this directory is not included in the paths captured in build.log. The only two freertos entries listed in build.log are:

    ./deps/freertos/include 
    ./deps/freertos/include/esp32  

Neither directory includes FreeRTOS.h. The second directory doesn’t even exist on my system.
There is a mos.yaml file in the ./deps/freertos/include directory that contains the lines:

      includes:
        - FreeRTOS/Source/include
        - FreeRTOS/Source/portable/${build_vars.FREERTOS_PORT}
        - include/cmsis

This seems to indicate that these additional directories are somehow included in the path searched by the compiler.

How can I get an exact and complete path that the compiler is using to find include files?

Build process deep dive explains how the build process work.

Thanks for the link. So by looking at Build process deep dive it implies that the include file path for the app is accumulated from the individual lib yamls but no where does it explain how to get a complete and exact include file path that the compiler is using. The include path in ./build/gen/mos_final.yml matches the build log and does not include the accumulated library paths.

So my questions remains…
How can I get an exact and complete path that the compiler is using to find include files?

cat build/gen/vars.mk |grep APP_INCLUDES
APP_INCLUDES=/home/liviu/.mos/deps/i2c/include /home/liviu/.mos/deps/atca/include /home/liviu/.mos/deps/atca/cryptoauthlib/lib /home/liviu/.mos/deps/atca/cryptoauthlib/lib/crypto /home/liviu/.mos/deps/atca/cryptoauthlib/lib/hal /home/liviu/.mos/deps/mbedtls/include /home/liviu/.mos/deps/mbedtls/include/esp8266 /home/liviu/.mos/deps/mbedtls/mbedtls/include /home/liviu/.mos/deps/vfs-common/include /home/liviu/.mos/deps/vfs-common/include/esp8266 /home/liviu/.mos/deps/mongoose/include /home/liviu/.mos/deps/vfs-dev-part/include /home/liviu/.mos/deps/vfs-fs-lfs/include /home/liviu/.mos/deps/vfs-fs-lfs/littlefs /home/liviu/.mos/deps/vfs-fs-lfs/littlefs1 /home/liviu/.mos/deps/vfs-fs-spiffs/include /home/liviu/.mos/deps/vfs-fs-spiffs/include/spiffs /home/liviu/.mos/deps/vfs-fs-spiffs/include/esp8266 /home/liviu/.mos/deps/core/include /home/liviu/.mos/deps/core/include/esp8266 /home/liviu/.mos/deps/http-server/include /home/liviu/.mos/deps/ota-common/src /home/liviu/.mos/deps/ota-common/include /home/liviu/.mos/deps/ota-common/include/esp8266 /home/liviu/.mos/deps/ota-http-client/include /home/liviu/.mos/deps/rpc-common/include /home/liviu/.mos/deps/rpc-service-config/include /home/liviu/.mos/deps/rpc-service-fs/include /home/liviu/.mos/deps/rpc-uart/include /home/liviu/.mos/deps/rpc-ws/include /home/liviu/.mos/deps/wifi/include /home/liviu/.mos/deps/wifi/include/esp8266

My build command for this example

mos build --local --deps-dir $DEPS_DIR --binary-libs-dir $LIBS_DIR --platform esp8266

Ok, I think I found the issue. The missing include path in my app is associated with FreeRTOS. In the freertos mos library yaml there is this hint…

    # On ESP32 FreeRTOS itself is provided by IDF and is heavily modified.

I am compiling for the ESP32 so there must be some special handling that adds the missing include files to the compiler include path during the build. I’m guessing this is provided by the Docker container. One of the “mount” commands in the build.log must be overlaying FreeRTOS.h (and other freertos files) into the local files\directory structure. It might even be adding in the missing ./deps/freertos/include/esp32 directory listed in my APP_INCLUDES that is not present on my drive. Does this sound reasonable? Can I get a copy of the ‘heavily modified’ FreeRTOS files?

The heavily modified files are part of esp-idf. The current version used by Mongoose OS is 3.3-r4

What are the errors you see in the build.log, if any?