Workflow tip: When to delete <project>/build
Posted: Wed Sep 20, 2017 3:47 am
From experimentation, it seems that we are ok to delete the <project>/build directory as it will get rebuilt when we next perform a new compilation. The question then becomes "is it necessary and if yes, under what circumstances?".
These are my empirical experiences:
1. When ever I install a new version of the ESP-IDF, it does no harm.
2. When ever I perform an SDKCONFIG change through "make menuconfig".
3. When ever I see a compilation/linkage fail and the reason appears to be a mystery.
The reason for this post tonight is that I had replace an SDKCONFIG in a BLE project with a newer version that did NOT have "BT Enabled" in it. I perform a build and, of course, the build failed. I then ran "make menuconfig" and switched on Bluetooth Enablement. I then re-compiled the app by running "make" and although I didn't get the same errors as not having BT enabled at all, the errors related to missing includes which I could clearly see existed. I spent about 15 minutes trying to track that down and then, on a hunch, deleted "build" and this time all rebuilt cleanly performing the exact same make. What this seemed to tell me was that doing a "make" with an "SDKCONFIG" that did not include BT resulted in some state being written (into build) that wasn't resolved by changing "SDKCONFIG" to include BT and then re-running make.
It might be that a "make clean" has the same effect as removing "build".
These are my empirical experiences:
1. When ever I install a new version of the ESP-IDF, it does no harm.
2. When ever I perform an SDKCONFIG change through "make menuconfig".
3. When ever I see a compilation/linkage fail and the reason appears to be a mystery.
The reason for this post tonight is that I had replace an SDKCONFIG in a BLE project with a newer version that did NOT have "BT Enabled" in it. I perform a build and, of course, the build failed. I then ran "make menuconfig" and switched on Bluetooth Enablement. I then re-compiled the app by running "make" and although I didn't get the same errors as not having BT enabled at all, the errors related to missing includes which I could clearly see existed. I spent about 15 minutes trying to track that down and then, on a hunch, deleted "build" and this time all rebuilt cleanly performing the exact same make. What this seemed to tell me was that doing a "make" with an "SDKCONFIG" that did not include BT resulted in some state being written (into build) that wasn't resolved by changing "SDKCONFIG" to include BT and then re-running make.
It might be that a "make clean" has the same effect as removing "build".