Skip to content

build: clean previous compiled files after menuconfig updates#18821

Open
HyphenAlpha456 wants to merge 1 commit intoapache:masterfrom
HyphenAlpha456:fix/16151-menuconfig-clean
Open

build: clean previous compiled files after menuconfig updates#18821
HyphenAlpha456 wants to merge 1 commit intoapache:masterfrom
HyphenAlpha456:fix/16151-menuconfig-clean

Conversation

@HyphenAlpha456
Copy link
Copy Markdown

@HyphenAlpha456 HyphenAlpha456 commented Apr 29, 2026

Summary

This PR addresses a build system bug where orphaned object files are left behind after configuration changes.

  • Captures the state of the .config file before entering configuration interfaces (menuconfig, nconfig, qconfig, gconfig, xconfig).
  • Compares the .config state upon exit.
  • If the configuration was modified, it automatically triggers make clean to ensure a fresh environment for the next build.

Fixes #16151

Impact

  • Users/Developers: Eliminates the need to manually run make clean after tweaking configurations. Prevents hidden linking errors and build corruption.
  • Build System: Improves reliability and automation across all Unix configuration targets.

Testing

  • Simulator/Local: Verified that changing settings inside menuconfig successfully triggers a clean build upon exit.
  • Verified that opening and closing menuconfig without saving changes bypasses the clean step, preserving the existing build.

@github-actions github-actions Bot added Area: Build system Size: XS The size of the change in this PR is very small labels Apr 29, 2026
@lupyuen lupyuen requested review from acassis and simbit18 April 30, 2026 01:27
Comment thread tools/Unix.mk
Copy link
Copy Markdown
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

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

Please follow the PR template :)

Fixes apache#16151. Compares .config state before and after kconfig-mconf and triggers 'make clean' if the configuration was modified to prevent orphaned object files.

Signed-off-by: Agnimitra sasaru <158492301+HyphenAlpha456@users.noreply.github.com>
@HyphenAlpha456
Copy link
Copy Markdown
Author

Hi @xiaoxiang781216, I have updated nconfig, qconfig, and gconfig in Unix.mk with the same cmp and rm cleanup logic as requested. Let me know if everything looks good to merge!

@github-actions github-actions Bot added Size: S The size of the change in this PR is small and removed Size: XS The size of the change in this PR is very small labels May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Build system Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Building System is not clearing previous compiled files after running "make menuconfig"

4 participants