Skip to content

LDF chain+ and deep+ in atmelavr platform include spurious Robot Control library #1930

@conklech

Description

@conklech

What kind of issue is this?

  • Question.
    This issue tracker is not the place for questions. If you want to ask how to do something,
    or to understand why something isn't working the way you expect it to,
    use Community Forums or Premium Support

  • PlatformIO IDE.
    All issues related to PlatformIO IDE should be reported to appropriate repository:
    PlatformIO IDE for Atom or
    PlatformIO IDE for VSCode

  • Development Platform or Board.
    All issues (building, uploading, adding new boards, etc.) related to PlatformIO development platforms
    should be reported to appropriate repository related to your hardware
    https://github.com/topics/platformio-platform

  • Feature Request.
    Start by telling us what problem you’re trying to solve. Often a solution
    already exists! Don’t send pull requests to implement new features without first getting our
    support. Sometimes we leave features out on purpose to keep the project small.

  • 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 10

PlatformIO Version (platformio --version):

3.6.2a2, through VSCode plugin

Description of problem

A minimal test case is linked below.

Steps to Reproduce

  1. Create new project using atmelavr platform, arduino framework. I used megaatmega2560 board.
  2. Add lib_ldf_mode = chain+ or lib_ldf_mode = deep+ to platformio.ini.
  3. Add #include <SD.h> to main.cpp
  4. Build.

Actual Results

LDF erroneously determines that SD library depends on Robot Control library. Build fails because Robot Control cannot be built.

Full output, with modified project files

Relevant portion of output:

Dependency Graph
|-- <SD> 1.1.1 (C:\Users\chris\.platformio\packages\framework-arduinoavr\libraries\SD)
|   |-- <Robot Control> 1.0.3 (C:\Users\chris\.platformio\packages\framework-arduinoavr\libraries\Robot_Control)
|   |   |-- <SPI> 1.0 (C:\Users\chris\.platformio\packages\framework-arduinoavr\libraries\__cores__\arduino\SPI)
|   |   |-- <Wire> 1.0 (C:\Users\chris\.platformio\packages\framework-arduinoavr\libraries\__cores__\arduino\Wire)

and

avr-g++ -o .pioenvs\megaatmega2560\libf55\Robot_Control\Arduino_LCD.cpp.o -c -fno-exceptions -fno-threadsafe-statics -fpermissive -std=gnu++11 -Os -Wall -ffunction-sections -fdata-sections -flto -mmcu=atmega2560 -DPLATFORMIO=30602 -DARDUINO_AVR_MEGA2560 -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO=10805 -IC:\Users\chris\.platformio\packages\framework-arduinoavr\cores\arduino -IC:\Users\chris\.platformio\packages\framework-arduinoavr\variants\mega -IC:\Users\chris\.platformio\packages\framework-arduinoavr\libraries\__cores__\arduino\SPI\src
-IC:\Users\chris\.platformio\packages\framework-arduinoavr\libraries\__cores__\arduino\Wire\src -IC:\Users\chris\.platformio\packages\framework-arduinoavr\libraries\Robot_Control\src C:\Users\chris\.platformio\packages\framework-arduinoavr\libraries\Robot_Control\src\Arduino_LCD.cpp
C:\Users\chris\.platformio\packages\framework-arduinoavr\libraries\Robot_Control\src\ArduinoRobot.cpp: In constructor 'RobotControl::RobotControl()':
C:\Users\chris\.platformio\packages\framework-arduinoavr\libraries\Robot_Control\src\ArduinoRobot.cpp:26:42: error: 'LCD_CS' was not declared in this scope
RobotControl::RobotControl():Arduino_LCD(LCD_CS,DC_LCD,RST_LCD){
^

leading to build failure.

Expected Results

Build succeeds; LDF determines that library SD depends on library SPI, not on Robot Control.

Dependency Graph
|-- <SD> 1.1.1 (C:\Users\chris\.platformio\packages\framework-arduinoavr\libraries\SD)
|   |-- <SPI> 1.0 (C:\Users\chris\.platformio\packages\framework-arduinoavr\libraries\__cores__\arduino\SPI)

Changing to chain or deep LDF mode results in successful build, so this seems related to the CPP functionality implied by +.

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
lib_ldf_mode = deep+

Source file to reproduce issue:

#include <Arduino.h>
#include <SD.h> // Adding this include triggers inclusion of Robot_Control with deep+ library dependency resolution

void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}

Additional info

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions