Using a platformio.ini on Windows (through pioarduino) that contains the following relevant snippets:
[platformio]
default_envs = esp32dev_debug
;default_envs = esp32dev_release
…
[common]
lib_deps_external =
Adafruit_BusIO=symlink://../code_mcu_libs/lib/Adafruit BusIO@1.17.4
Adafruit_GFX_Library=symlink://../code_mcu_libs/lib/Adafruit GFX Library@1.12.6
Adafruit_MCP23017=symlink://../code_mcu_libs/lib/Adafruit MCP23017 Arduino Library@2.3.2
Adafruit_PWM_Servo_Driver_Library=symlink://../code_mcu_libs/lib/Adafruit PWM Servo Driver Library@3.0.3
Adafruit_SSD1306=symlink://../code_mcu_libs/lib/Adafruit SSD1306@2.5.16
…
[env]
extends = common
lib_ldf_mode = chain
…
[common_esp32dev]
lib_deps =
${env.lib_deps_builtin}
${env.lib_deps_internal}
${env.lib_deps_external}
…
[env:esp32dev_debug]
extends = common_esp32dev
build_type = debug
The symlink is required because I don’t want to keep redundant copies of these files (not to mention speed of backup, etc.), and I also want to be sure that the three apps are drawing from the same resources in case I need to modify any of them.
There are 3 platformio files for 3 apps using two src folders, and these common libs (and more - but these are the problem ones) for one system. The de-referencing is to try and keep things simple, believe it or not! (Like changing from debug to release in one place).
When installing these libs (by changing platformio.ini), I ‘sometimes’ get these messages:
Resolving esp32dev_debug dependencies...
Removing unused dependencies...
Library Manager: Removing Adafruit SSD1306 @ 2.5.16
Library Manager: Removing dependencies...
Library Manager: Removing Adafruit GFX Library @ 1.12.6
Library Manager: Removing dependencies...
Library Manager: Removing Adafruit BusIO @ 1.17.4
Library Manager: Adafruit BusIO@1.17.4 has been removed!
Library Manager: Adafruit GFX Library@1.12.6 has been removed!
Library Manager: Adafruit SSD1306@2.5.16 has been removed!
Library Manager: Installing symlink://../code_mcu_libs/lib/Adafruit BusIO @ 1.17.4
PackageException: Can not create a symbolic link for `../code_mcu_libs/lib/Adafruit BusIO`, not a directory
And it is quite serious about the removal! Even if I set all the folders and contents to ‘read only’, it will actually delete these folders, despite being ‘symlink’ed. I am writing this while the issue is hot so I can recover get the error messages. So, I make the following observation, which might be the problem: I only noticed this after I added the ‘@’ version information. (It was for reference only - if I ever publish this I wanted the library versions used to be obvious.)
Nevertheless, this strikes me as very incorrect behaviour. It should IMHO flag a version ‘not correct’ error or something rather than just deleting the source folder - and then NOT FINDING IT (because it deleted it!)
Now, something also may be out of wack on my system (including a dirty pio folder). These are complex ESP32 apps (though I suspect this might apply to other MCUs), and big platformio.ini files. But if PlatformIO can somehow delete folders through symbolic links, especially if they are read-only, then there is a problem - somewhere, right?