r3wretrhy opened a new pull request, #20085:
URL: https://github.com/apache/nuttx/pull/20085

   cmake: reconfigure when .config changes.
   
   ## Summary
   
     * Why change is necessary: `config.h` and `CONFIG_*` are generated at 
configure time. `kconfig-tweak` (and other out-of-band `.config` edits) do not 
go through the `menuconfig` target, so Ninja left a stale 
`include/nuttx/config.h`.
     * What functional part of the code is being changed: CMakeLists.txt 
configure-depends for `${NUTTX_BINARY_DIR}/.config`.
     * How: `CMAKE_CONFIGURE_DEPENDS` on `.config`. That file is only rewritten 
when it is missing or the board defconfig path changes, so watching it does not 
loop.
     * Related NuttX Issue: https://github.com/apache/nuttx/issues/12322
   
   ## Impact
   
     * Is new feature added? Is existing feature changed? NO
     * Impact on user (will user need to adapt to change)? NO
     * Impact on build (will build process change)? YES. Ninja re-runs CMake 
after an out-of-band `.config` edit, which is what the reporter expected 
(`Re-running CMake...`).
     * Impact on hardware (will arch(s) / board(s) / driver(s) change)? NO
     * Impact on documentation (is update required / provided)? NO
     * Impact on security (any sort of implications)? NO
     * Impact on compatibility (backward/forward/interoperability)? NO. 
Unchanged `.config` still does not reconfigure.
   
   ## Testing
   
     I confirm that changes are verified on local setup and works as intended:
     * Build Host(s): Windows 11, CMake 3.29.2, Ninja
     * Target(s): cmake -P lock that CMakeLists.txt watches `.config`; a Ninja 
mini-project with the same `CMAKE_CONFIGURE_DEPENDS` one-liner
   
     Testing logs before change:
   
     ```
     gh search code repo:apache/nuttx CMAKE_CONFIGURE_DEPENDS
     []
     ```
   
     Testing logs after change:
   
     ```
     cmake -P _tmp_test_cfgdep.cmake
     -- CMAKELISTS_WATCHES_DOTCONFIG
   
     cmake --build mini/b   # after editing watched.txt
     [0/1] Re-running CMake...
     -- Configuring done (0.0s)
     -- Generating done (0.0s)
     ```
   
   ## PR verification Self-Check
   
     * [x] This PR introduces only one functional change.
     * [x] I have updated all required description fields above.
     * [x] My PR adheres to Contributing Guidelines and Documentation (git 
commit title and message, coding standard, etc).
     * [ ] My PR is still work in progress (not ready for review).
     * [x] My PR is ready for review and can be safely merged into a codebase.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to