Closed
Description
What kind of issue is this?
- PlatformIO Core.
If you’ve found a bug, please provide an information below.
You can erase any parts of this template not applicable to your Issue.
Configuration
Operating system:
WIndows 11
PlatformIO Version (platformio --version
):
PlatformIO Core, version 6.1.16
Description of problem
Dependencies of private libraries should not be re-installed in env lib deps folder if they already exist in the private library folder.
Steps to Reproduce
- Install library with dependencies and those dependencies to private library folder (lib)
- ie, install Adafruit BME280 Library, Adafruit Unified Sensor, and Adafruit BusIO all to the lib folder
- Build
Actual Results
The dependencies are re-installed in the environment folder
- ie, Adafruit Unified Sensor and Adafruit BusIO are reinstalled in .pio\lib_deps(env_name} although they are already in the private lib folder
Expected Results
The dependencies should not be reinstalled
Additional info
I this should be fixed in by changing:
platformio-core/platformio/package/commands/install.py
Lines 293 to 308 in b537004
to
def _install_project_private_library_deps(private_pkg, private_lm, env_lm, options):
for dependency in private_lm.get_pkg_dependencies(private_pkg) or []:
spec = private_lm.dependency_to_spec(dependency)
# skip built-in dependencies
if not spec.external and not spec.owner:
continue
pkg = private_lm.get_package(spec)
if not pkg and not private_lm.get_package(spec) and not env_lm.get_package(spec):
# ^^^ add this ^^^
pkg = env_lm.install(
spec,
skip_dependencies=True,
force=options.get("force"),
)
if not pkg:
continue
_install_project_private_library_deps(pkg, private_lm, env_lm, options)
There should be a check if the library is installed in the private_lm.