Skip to content

Commit 2fe3ed5

Browse files
committed
Fixed cleanup of the .pio/libdeps folder // Resolve #5110
1 parent c6909db commit 2fe3ed5

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ test-driven methodologies, and modern toolchains for unrivaled success.
2828
* Fixed an issue where fully-qualified serial port URLs (e.g., ``rfc2217://host:port``) were incorrectly treated as wildcard patterns (`issue #5225 <https://github.com/platformio/platformio-core/issues/5225>`_)
2929
* Fixed an issue where the toolchain path in static analysis was not handled correctly if it contained spaces (`pull #5351 <https://github.com/platformio/platformio-core/issues/5351>`_)
3030
* Fixed installation failure when the executable path contains spaces for ``postinstall`` scripts and handling both list and string command formats (`pull #5366 <https://github.com/platformio/platformio-core/pull/5366>`_)
31+
* Fixed cleanup of the ``.pio/libdeps`` folder so that leftover libraries are properly removed when the `lib_deps <https://docs.platformio.org/en/latest/projectconf/sections/env/options/library/lib_deps.html>`__ option is empty (`issue #5110 <https://github.com/platformio/platformio-core/issues/5110>`_)
3132

3233
6.1.18 (2025-03-11)
3334
~~~~~~~~~~~~~~~~~~~

platformio/package/commands/install.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,12 @@ def _install_project_env_libraries(project_env, options):
264264

265265
def _uninstall_project_unused_libdeps(project_env, options):
266266
config = ProjectConfig.get_instance()
267+
storage_dir = Path(config.get("platformio", "libdeps_dir"), project_env)
267268
lib_deps = set(config.get(f"env:{project_env}", "lib_deps"))
268269
if not lib_deps:
270+
if storage_dir.exists():
271+
fs.rmtree(str(storage_dir))
269272
return
270-
storage_dir = Path(config.get("platformio", "libdeps_dir"), project_env)
271273
integrity_dat = storage_dir / "integrity.dat"
272274
if integrity_dat.is_file():
273275
prev_lib_deps = set(

0 commit comments

Comments
 (0)