nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

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

Open acassis opened this issue 8 months ago • 4 comments

Description / Steps to reproduce the issue

Today during our Live Demo showing how to use BMP180 ( https://www.youtube.com/watch?v=Q6mJn7_boo8 ) with NuttX we found a case that initially seems to be a building system failure.

Initially Rodrigo selected the BMP180 driver without using UORB support and testing it using the bmp180 application. Everything worked as expected. Then we decided to use the BMP180 with UORB support.

After selecting the BMP180 with UORB support and SENSORTEST in the menuconfig, compile and flash it, we noticed that /dev/uorb/sensor_baro0 wasn't created.

Then we noticed that stm32_bmp180.c in common board logic at boards/arm/stm32 was using "bmp180_register(devpath, i2c)". Then we replaced it with "bmp180_register_uorb(0, i2c)", the compilation happened correctly the the /dev/uorb/sensor_baro0 was generated.

Analyzing the file drivers/sensors/Make.defs initially I thought that it could be the source of the issue:

ifeq ($(CONFIG_SENSORS_BMP180),y) CSRCS += bmp180_base.c ifeq ($(CONFIG_SENSORS_BMP180_UORB),y) CSRCS += bmp180_uorb.c else CSRCS += bmp180.c endif endif

But looking the file bmp180.c I found the bmp180_register() function there and this file shouldn't be compiled when CONFIG_SENSORS_BMP180_UORB is selected. So in this case the build system preserved the previous compiled file.

A possible solution should be the building system automatically run "make clean" after user running "make menuconfig"

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

Ubuntu 24.04

NuttX Version

mainline

Issue Architecture

[Arch: all]

Issue Area

[Area: Build System]

Host information

No response

Verification

  • [x] I have verified before submitting the report.

acassis avatar Apr 07 '25 15:04 acassis

@xiaoxiang781216 @raiden00pl @lupyuen @pkarashchenko for awareness

acassis avatar Apr 10 '25 12:04 acassis

I think that this is a known issue (at least for me) that is there from the first day I started using NuttX. Since changing the config very likely will change your dependency tree running make clean after menuconfig will fail or not clean-up all the files from previous run. The only reliable way is to run make clean before you run make menuconfig.

pkarashchenko avatar Apr 11 '25 05:04 pkarashchenko

@pkarashchenko maybe the proper thing to do it automatically force a "make clean" when user type "make menuconfig"

acassis avatar Apr 11 '25 14:04 acassis

@pkarashchenko maybe the proper thing to do it automatically force a "make clean" when user type "make menuconfig"

That may be a good option.

pkarashchenko avatar Apr 11 '25 15:04 pkarashchenko