Platform IO used to always work as expected, only building the files that were altered or dependent upon an edited file.
Of late it is always re-building all my source files despite only changing some lines of source in one file.
The only real change I can think of is the new V4.0.0 core (since updated to V4.0.2).
Is my platform IO file deficient in some area, causing the full rebuild?
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:esp32dev]
platform = espressif32
lib_extra_dirs = ~/Documents/Arduino/libraries
board = esp32dev
framework = arduino
board_build.partitions = min_spiffs.csv
upload_speed = 921600
upload_port = COM16
upload_protocol = esptool
monitor_speed = 115200
extra_scripts = post:add_CRC.py
; replace shitty Arduino millis with a linear time version
build_flags =
-Wl,–wrap,millis
I don’t see anything there that would trigger a rebuild. And I’m not seeing that behaviour on 4.0 or later (also running 4.0.2 atm)… although I’m mainly doing espressif8266 stuff atm, not espressif32.
Just to be clear, you aren’t making changes to platformio.ini when this happens? As that is also a trigger for a full rebuild. And what OS/IDE is this with?
I’m adding a CRC across the generated .bin file so when it gets uploaded by others there is an extra level of confirmation the file is really meant for the device.
No I am no changing platformIO.ini, its file date is always older than the source files.
FWIW, I have also pulled my project to another PC, just in case it was something to do with my PC.
Still exhibits the same rebuild of all the project files - noting the IDF only gets done once.
Yes I did try the build twice
The timestamp on platformIO.ini does not change.
I also tried commenting out my post: - made no difference.
I have read the other instances of full rebuild in the issues and cannot understand why my problem is persisting.
It appears the checksum stays the same, always.
One thing I have just noticed though is the Build: (platformio.exe run) seems to behave OK.
Whereas Upload: (platformio.exe run --target upload) is always rebuilding my files, but not the IDF.
THEN, the next time I did Build:, it rebuilt all my source files, then was happy again after that first build.
Hopefully that is useful to you
I have pasted the checksums of a few builds, and commented against each line:
Build: Checksum = 69f678a8d4a118cea67084fca5087c4d8af52468 - rebuilt everything, including IDF files
Build: Checksum = 69f678a8d4a118cea67084fca5087c4d8af52468 - did not rebuild after dependency check!
Build: Checksum = 69f678a8d4a118cea67084fca5087c4d8af52468 - same, no rebuild
.
Changed some source
.
Build: Checksum = 69f678a8d4a118cea67084fca5087c4d8af52468 - rebuilt changed file!
Upload: Checksum = 69f678a8d4a118cea67084fca5087c4d8af52468 - rebuilt ALL MY source files - not IDF
Upload: Checksum = 69f678a8d4a118cea67084fca5087c4d8af52468 - rebuilt ALL MY source files - not IDF - AGAIN!
Upload: Checksum = 69f678a8d4a118cea67084fca5087c4d8af52468 - rebuilt ALL MY source files - not IDF - AGAIN!
.
Build: Checksum = 69f678a8d4a118cea67084fca5087c4d8af52468 - rebuilt ALL MY source files - not IDF - AGAIN!
Build: Checksum = 69f678a8d4a118cea67084fca5087c4d8af52468 - did not rebuild after dependency check!
I have reduced it down to the following, any more and I cannot use upload!
Still rebuilds all the files when I use Upload.
As I mentioned before, works OK when I just Build.
it is the same project you looked at in regards to “the linker line is too long” from me a couple of months back.
Have since implemented you suggestions and streamlined the directory structures.
OK, I’ve found your project on Gitlab and didn’t notice any problems: the project is compiled exactly once then I can build, upload without recompiling. BTW, what is your OS?
Hmmmm, prompted by your success, I pulled the repo to a new directory and it now builds correctly there!
There are other non source files and directories floating about that are not in in the repo.
Is it possible platformio is looking at things other than the src, lib and data directories?
I’ll try pruning some stuff to elsewhere for now…
I removed the solution as it is still not clear why the full rebuild takes place.
What is unsettling platform IO it is surely more concerning, and if I can determine that I will certainly then post a true solution.