Skip to content
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

cmake:fix invalid configs when export defconfig and .config #10421

Merged
merged 1 commit into from Aug 29, 2023

Conversation

xuxin930
Copy link
Contributor

Summary

when configuring nuttx compile-time config, defconfig and .config need to be read,
and the func nuttx_export_kconfig will be called twice.

this will cause dirty data in cmake config, resulting in unexpected compilation problems.

# for example my defconfig enable CONFIG_FEAT_FOO
# then call cmake --build build menuconfig
#         disable CONFIG_FEAT_FOO
# variables in the cmake compilation phase CONFIG_FEAT_FOO still y
# this creates compilation issues

this patch records the key values modified each time the config is refreshed, and then deletes these keys when calling nuttx_export_kconfig again, thereby updating the global config.

similar to the CONFIG_BASE_DEFCONFIG flag -dirty in the Makefile.

Impact

Testing

  • CI Build
  • cmake --build build -t menuconfig # disable some feature

cmake/nuttx_kconfig.cmake Outdated Show resolved Hide resolved
when func `nuttx_export_kconfig` is called for the second time,
the expired configuration will be retained causing compilation failure

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
Copy link
Contributor

@anchao anchao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@xiaoxiang781216 xiaoxiang781216 merged commit 94e6cfb into apache:master Aug 29, 2023
23 of 26 checks passed
@jerpelea jerpelea added this to To-Add in Release Notes - 12.3.0 Sep 26, 2023
@jerpelea jerpelea moved this from To-Add to done in Release Notes - 12.3.0 Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants