-
Notifications
You must be signed in to change notification settings - Fork 8k
Description
Answers checklist.
- I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
- I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
- I have searched the issue tracker for a similar issue and not found a similar issue.
IDF version.
v5.5.1
Operating System used.
macOS
How did you build your project?
Other (please specify in More Information)
If you are using Windows, please specify command line type.
None
What is the expected behavior?
When configuring a project using ESP-IDF v5.5.1, the build system generates a build/kconfigs.in file that includes:
source "/<project-path>/build/Kconfig"However, he file build/Kconfig is never created, causing kconfgen to fail with a KconfigError during idf.py reconfigure (and also during initial configuration). Manually creating an empty build/Kconfig allows the configuration to succeed.
This appears to be a regression or oversight in how ESP-IDF populates its COMPONENT_KCONFIGS list when generating kconfigs.in.
- ESP-IDF should not reference
build/Kconfigunless the file is actually produced during the configuration process, OR - ESP-IDF should auto-generate a minimal build/Kconfig file before writing a source statement to kconfigs.in.
What is the actual behavior?
build/kconfigs.in contains:
source "/Users/<user>/.../arduino_idf_demo/build/Kconfig"build/Kconfig does not exist.
Running idf.py reconfigure fails:
kconfiglib.core.KconfigError: kconfigs.in:80:
'/.../arduino_idf_demo/build/Kconfig' not found
(in 'source ".../build/Kconfig"')Creating an empty file:
touch build/Kconfig... allows the configuration to succeed.
Steps to reproduce.
-
Create a project using ESP-IDF v5.5.1.
-
Add any component containing a valid
Kconfigfile, e.g.:
components/drd_handler/Kconfig -
Remove
build/,managed_components/, anddependencies.lock.
rm -rf build managed_components dependencies.lock -
Run:
idf.py -D CMAKE_EXPORT_COMPILE_COMMANDS=ON reconfigure -
Observe the error from
kconfgen. -
Inspect
build/kconfigs.inand notice the reference tobuild/Kconfig. -
Create an empty file:
mkdir -p build touch build/Kconfig
-
Re-run
idf.py reconfigureand observe that it succeeds.
Build or installation Logs.
Excerpt from `build/kconfigs.in`:
...
78 source "/Users/.../esp-idf/components/wear_levelling/Kconfig"
79 source "/Users/.../esp-idf/components/wifi_provisioning/Kconfig"
80 source "/Users/<user>/.../arduino_idf_demo/build/Kconfig"
81 source "/Users/<user>/.../arduino_idf_demo/managed_components/espressif__esp-dsp/Kconfig"
...
Error traceback:
kconfiglib.core.KconfigError: kconfigs.in:80:
'/Users/<user>/arduino_idf_demo/build/Kconfig' not found
(in 'source "/Users/<user>/arduino_idf_demo/build/Kconfig"').
Check that environment variables are set correctly (e.g. $srctree).
Diagnostic report archive.
Running idf_diag in directory /Users/<user>/Library/CloudStorage/OneDrive-Personal/Documents/GitHub/arduino_idf_demo
Executing "/Users/<user>//.espressif/python_env/idf5.5_py3.14_env/bin/python -m esp_idf_diag create --no-hints --force-terminal --project-dir /Users/<user>//Library/CloudStorage/OneDrive-Personal/Documents/GitHub/arduino_idf_demo --build-dir /Users/<user>//Library/CloudStorage/OneDrive-Personal/Documents/GitHub/arduino_idf_demo/build --output idf-diag-4ea28ecb-57d1-491d-8a4d-2bd86e68c9e9"...
Creating report in "idf-diag-4ea28ecb-57d1-491d-8a4d-2bd86e68c9e9" directory.
Searching for device serial port ...
Serial port: /dev/cu.usbserial-210
Shell environment information
* Enviromental Variables
* Python Environmental Variables
Basic ESP-IDF information
* ESP-IDF Version
* ESP-IDF Git Version
IDF Component Manager information
* IDF Component Manager
ESP-IDF project information and artifacts
* Project Description
* Compile Commands
* Linker Scripts
warning: File "/Users/<user>//Library/CloudStorage/OneDrive-Personal/Documents/GitHub/arduino_idf_demo/build/esp-idf/esp_system/ld/sections.ld" does not exist: [Errno 2] No such file or directory: '/Users/<user>//Library/CloudStorage/OneDrive-Personal/Documents/GitHub/arduino_idf_demo/build/esp-idf/esp_system/ld/sections.ld'
* Flash Arguments
* Sdkconfig
* Logs
warning: No files with content matching regex "^Command: ninja all$" found in "/Users/<user>//Library/CloudStorage/OneDrive-Personal/Documents/GitHub/arduino_idf_demo/build/log"
warning: No files with content matching regex "^Command: ninja all$" found in "/Users/<user>//Library/CloudStorage/OneDrive-Personal/Documents/GitHub/arduino_idf_demo/build/log"
warning: No files with content matching regex "^Command: ninja flash$" found in "/Users/<user>//Library/CloudStorage/OneDrive-Personal/Documents/GitHub/arduino_idf_demo/build/log"
warning: No files with content matching regex "^Command: ninja flash$" found in "/Users/<user>//Library/CloudStorage/OneDrive-Personal/Documents/GitHub/arduino_idf_demo/build/log"
warning: No files with content matching regex "^Command: .*idf_monitor.py.*$" found in "/Users/<user>//Library/CloudStorage/OneDrive-Personal/Documents/GitHub/arduino_idf_demo/build/log"
warning: No files with content matching regex "^Command: .*idf_monitor.py.*$" found in "/Users/<user>//Library/CloudStorage/OneDrive-Personal/Documents/GitHub/arduino_idf_demo/build/log"
* Link Map File
warning: No files matching glob "*.map" found in "/Users/<user>/
/Library/CloudStorage/OneDrive-Personal/Documents/GitHub/arduino_idf_demo/build"
ESP-IDF python and virtual environment information
* Python Version
* Python Virtual Environment Packages
System information
* Platform Information
* Darwin Information
Target information
* Esptool - flash_id
* Esptool - get_security_info
warning: Exec command "esptool.py --port /dev/cu.usbserial-210 get_security_info" failed with exit code 2
* Espefuse - summary
ESP-IDF tools information
* ESP-IDF Tools Info
The report has been created in the "idf-diag-4ea28ecb-57d1-491d-8a4d-2bd86e68c9e9" directory.
Please make sure to thoroughly check it for any sensitive information before sharing and remove files you do not want to share. Kindly include any additional files you find relevant that were not automatically added. Please archive the contents of the final report directory using the command:
"idf.py diag --zip idf-diag-4ea28ecb-57d1-491d-8a4d-2bd86e68c9e9".
idf-diag-4ea28ecb-57d1-491d-8a4d-2bd86e68c9e9.zip
More Information.
Environment
-
ESP-IDF version: v5.5.1
-
Target: ESP32
-
Host OS: macOS
-
Python: 3.14.0 (managed by IDF’s virtual environment)
-
Build system: CMake + Ninja (via idf.py)
-
Removing a project-root
Kconfig.projbuilddoes not remove the erroneous reference tobuild/Kconfig. -
The project’s component
Kconfigfiles are valid. -
The issue appears to originate from the content of
build/config.env, whereCOMPONENT_KCONFIGSincludes:
...;<project>/build/Kconfig;...
even though that file does not exist and is not written by any part of the IDF build pipeline. -
The workaround is to create an empty
build/Kconfigbefore runningidf.py, but this should not be required.
Suggested Fix:
-
Modify ESP-IDF’s Kconfig aggregation logic so that
build/Kconfigis not included inCOMPONENT_KCONFIGSunless generated. -
Or ensure that a minimal
build/Kconfigis created before generatingkconfigs.in. -
Or filter out invalid/nonexistent paths before writing the list into
kconfigs.in.
Minimal Project Tree
.
├── CMakeLists.txt
├── cleanproject.sh
├── components
│ └── drd_handler
│ ├── CMakeLists.txt
│ ├── drd_handler.cpp
│ └── Kconfig
├── main
│ ├── CMakeLists.txt
│ └── main.cpp
├── sdkconfig
├── sdkconfig.defaults
└── partitions_16mb.csv
Minimal repro project: