arjav1528 commented on PR #18400:
URL: https://github.com/apache/nuttx/pull/18400#issuecomment-3922444549

   > Hi @acassis , the error occurs for any build with cmake.
   > 
   > The test with
   > 
   > * grep CONFIG_BASE_DEFCONFIG build/.config
   > 
   > alone is not sufficient; the build must be tested with
   > 
   > * **cmake --build build**
   
   Hi @simbit18 @acassis, thanks for catching this and for the detailed logs. 
You're right that just grepping .config isn't enough -- cmake --build build 
needs to pass too.
   I found the root cause: the previous version used file(write) in 
nuttx_mkconfig.cmake to write CONFIG_BASE_DEFCONFIG back into build/.config. 
But CMakeLists.txt already registers .config as a configure-time dependency via 
configure_file() when creating .config.orig. So every cmake --build build sees 
the timestamp change, triggers a spurious re-configuration, and config.h 
doesn't get properly regenerated -- leading to all the missing CONFIG_ macro 
errors you saw.
   the fix moves the CONFIG_BASE_DEFCONFIG write into the CMakeLists.txt 
initialization block, before configure_file() registers the dependency. that 
way it's set once at init and doesn't cause re-configuration on subsequent 
builds. the file(write) to .config in nuttx_mkconfig.cmake is removed entirely 
-- the dirty-flag logic is kept and used directly when generating config.h.
   I verified locally with sim:nsh using cmake --build build. With the old 
code, compilation fails immediately with the same 
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK undeclared errors as CI. With the fix, about 
1180 source files compile cleanly with 0 errors
   also on macOS, the build still fails at the linking stage (not compilation) 
with ar: CMakeFiles/arch.rsp: No such file or directory. This is a pre-existing 
macOS issue where /usr/bin/ar doesn't support response files -- it happens on 
upstream master too with no changes applied, and doesn't affect CI since that 
runs on Linux with GNU ar.


-- 
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