Closed neophiliac closed 4 years ago
See https://community.platformio.org/t/build-cache-dir-will-not-share-object-files-between-envs/10011 in the example above, you modify global build_flags = ..., so the ~/.pio/build/env-name dir is destroyed by the platformio build signature checks as far as I understood it, at this time different envs will not share build cache because of the different paths used by the two different environments and a different contents of source files (ref: https://scons.org/doc/latest/HTML/scons-api/SCons.CacheDir-pysrc.html, signature calculation via https://scons.org/doc/latest/HTML/scons-api/SCons.Node.FS-pysrc.html#File.get_cachedir_bsig). If you delete the .pio/build/env-name and try to build it again without dynamic flags, it will use the cache. edit: sorry for the confusion between scons and pio actions, since pio itself also tracks source files + .ini
maybe this issue should be moved to platformio/platformio-core?
Yes, it's probably a platformio-core issue. Sorry for leaving this in the wrong place. I'll read the docs you linked before I do that though.
Thanks.
For future readers. I've made this issue with platformio: https://github.com/platformio/platformio-core/issues/4574
-DBUILD_DATE="$(date +'%y%m%d-%H%M%S')"
This is the issue that triggers recompilation. The macro value changes on each build.
Ooh. Ignore my interpretation then for this issue. :)
I'm building with both the IDE and the CLI, and I rarely see output about getting objects from the cache while building the arduino framework files for esp8266, but most of the time all of the framework files are recompiled every time. I have build_cache_dir set (and also PLATFORMIO_BUILD_CACHE_DIR) and the build_cache_dir subdirectories are populated with object files with every build.
The build log shows the object files being put in a local directory, e.g. .pio/build/debug_ota/FrameworkArduino/spiffs/spiffs_check.cpp.o (which is not the build_cache_dir). The files in the build_cache_dir directories have hashes for names. and new files are added to each subdirectory with each build.
I have run pio update && pio upgrade so everything is up to date, PlatformIO 4.0.3 on Ubuntu 19.04.
It seems like I must be missing something about using the build cache setting. Suggestions? Advice?
Thanks.
platformio.ini: