Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependencies of private libraries should not be re-installed #4987

Open
1 task done
SRGDamia1 opened this issue Oct 3, 2024 · 0 comments
Open
1 task done

Dependencies of private libraries should not be re-installed #4987

SRGDamia1 opened this issue Oct 3, 2024 · 0 comments
Labels
Milestone

Comments

@SRGDamia1
Copy link

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

  1. 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
  1. 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:

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 env_lm.get_package(spec):
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)

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.

@ivankravets ivankravets added this to the 6.1.17 milestone Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants