Skip to content

Old dependencies are not removed from .pio folder #3076

@manuelbl

Description

@manuelbl

Temporary solution

Please remove .pio folder from a project and restart build.


Configuration

Operating system:
macOS 10.14

PlatformIO Version (platformio --version):
4.0.3

Description of problem

Old dependencies that are no longer referenced from platformio.ini are not removed from .pio folder and are still included in the build.

As a consequence, invalid projects still build as long as they are not shared with other developers via a repository. Furthermore, header files from old dependencies can be included if they have the same name as other files in the project causing hard to find bugs.

Steps to Reproduce

  1. Build project - succeeds
  2. Remove lib_deps line from platformio.ini
  3. Build project again - succeeds even though it should fail

Actual Results

Project without lib_deps still builds even if dependency is removed

Expected Results

Project without lib_deps should fail to build since it's missing a dependency

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:uno]
platform = atmelavr
board = uno
framework = arduino

lib_deps = 4

Source file to reproduce issue:

#include <Arduino.h>
#include <IRremote.h>

IRrecv ir(10);
decode_results results;

void setup() {
    Serial.begin(115200);
    ir.enableIRIn();
}

void loop() {
    if (ir.decode(&results)) {
        Serial.println(results.value);
    }
    delay(100);
}

Additional info

The folder /Users/me/.platformio/lib is empty.

If the folder .pio within the project folder is deleted, the project (without lib_deps) no longer compiles as expected.

Also see: https://community.platformio.org/t/what-is-the-proper-way-to-remove-dependency/9580

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions