-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cmake): Rebuild on changes in sdkconfig.defaults (IDFGH-13269) #14201
base: master
Are you sure you want to change the base?
Conversation
When you change sdkconfig.defaults, sdkconfig is not updated and a rebuild is not triggered. This commit fixes that by adding the files to the target.
👋 Hello MathyV, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
@MathyV Do I understand it right that the situation is:
Do you expect that sdkconfig file will be re-generated at step 3, applying new values from sdkconfig.defaults? |
That is correct |
In that case, I think this doesn't match how we expect sdkconfig to work. Sdkconfig file should get values from the defaults files when the respective options are missing from sdkconfig. In other cases, it's okay for sdkconfig to contain a value different than sdkconfig.defaults has. For example, if you build the project once and then change some options in menuconfig, sdkconfig file will contain the value you have saved in menuconfig. Otherwise, if sdkconfig.defaults would take precedence over sdkconfig (or would overwrite sdkconfig values) then it would not be possible to change the option in menuconfig to a value that doesn't match the one specified in sdkconfig.defaults. |
I think this is something worth exploring further - IMO there should be an If a defaults file has been changed upstream it is usually with good reason - yet we explicitly favour the local file which might not even contain any local changes. I am also certain there are hundreds of projects out there using a git committed My team has successfully been using |
I don't think this change is necessary, although it also doesn't affect my workflow. My understanding is that IDF incentivizes working with sdkconfig.defaults rather than regular sdkconfig, both because the former is tidy and the latter is unstable (although after #13490, I don't know what to think anymore). Made changes in menuconfig? Save it as you would, which changes the sdkconfig and trigger rebuilds. Need to commit to/persist them? |
Sorry for not chiming in earlier, lost track of this one a bit. Like @nebkat , I consider Another reason I do it like this is because I often target multiple platforms with the same code. I don't care about all the options that need to be set for example to have wifi work on the different devices, I just enable the main wifi setting in a shared I tend to structure my configuration over multiple https://github.com/MathyV/fri3d_firmware/blob/main/boards/fox/CMakeLists.txt @nebkat what you are suggesting with a |
I think this could be achieved with a CMake recipe which monitors changes to sdkconfig.defaults and deletes sdkconfig whenever sdkconfig.defaults changes, forcing sdkconfig to be re-generated from sdkconfig.defaults. In that case, you can use sdkconfig for local changes, and when you want to save them to sdkconfig.defaults you run I think we would be open to adding such a CMake recipe in the form of a function which can be called from the project CMakeLists.txt file. (E.g. We are also slowly working towards the new configuration system which will resolve some of Kconfig limitations, while retaining compatibility with Kconfig files. The most significant limitation we want to fix is that we can't distinguish sdkconfig options which have been explicitly set (but equal to the default value) from default values that the project developer doesn't care about. This will help us move closer to having an sdkconfig.defaults-like file as the single source of truth that tools like |
When you change sdkconfig.defaults, sdkconfig is not updated and a rebuild is not triggered. This commit fixes that by adding the files to the target.