espressif / clang-tidy-runner

MIT License
9 stars 5 forks source link

Add support for multiple sdk configs (RDT-313) #25

Closed AshUK closed 11 months ago

AshUK commented 1 year ago

Currently idf.py clang-check calls reconfigure, this will clear any existing config. This is problematic if you have feature flags enabled by multiple sdkconfigs.

We created a CI config and usually run CI builds as follows.

idf.py reconfigure -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;configs/sdkconfig.ci"'
idf.py app
hfudev commented 1 year ago

@AshUK set SDKCONFIG_DEFAULTS as an environment variable should also be feasible. (doc)

could you please try the following commands? Tested locally successfully.

export SDKCONFIG_DEFAULTS="sdkconfig.defaults;configs/sdkconfig.ci"
idf.py -B <custom_build_dir> clang-check
AshUK commented 1 year ago

The issue with this approach is that the config path will also be passed to the bootloader on a clean build:

CMake Error at /Users/ash/dev/esp/esp-idf-v5/tools/cmake/project.cmake:416 (message):
  SDKCONFIG_DEFAULTS
  '/Users/ash/dev/esp/esp-idf-v5/components/bootloader/subproject/sdkconfig.defaults'
  does not exist.
Call Stack (most recent call first):
  CMakeLists.txt:58 (project)

-- Configuring incomplete, errors occurred!
igrr commented 1 year ago

Could you explain, what do you mean by

calls reconfigure, this will clear any existing config

As far as i know, reconfigure simply re-runs CMake. If the sdkconfig file exists, it won't be re-created. Are you observing something different?