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

lib_deps piolibdeps issue creates dependences on all platforms #1153

Closed
txinto opened this issue Oct 31, 2017 · 3 comments
Closed

lib_deps piolibdeps issue creates dependences on all platforms #1153

txinto opened this issue Oct 31, 2017 · 3 comments
Milestone

Comments

@txinto
Copy link

txinto commented Oct 31, 2017

What kind of issue is this?

A library dependency and env platforms crossed issue. Piolibdeps directory is applying lib_deps in wrong compilation environments.

  • [c ] PlatformIO Core. If you’ve found a bug, please provide an information below.

Configuration

Operating system: Windows x64

PlatformIO Version (platformio --version): 3.5.0a16

Description of problem

I have a project that has to be compiled on many platforms. The Arduino Uno is the last platform environment of my platformio.ini file, and it is the only one with the "Arduino Motor Shield" library dependence. With an empty .piolibdeps everything is compiling without problems, but when I try to launch another compilation, all the other platforms fail (Teensy, ESP32...). The reason is that the first compilation created a .piolibdeps/ArduinoMotorShieldLibrary_ID28 folder, and this folder is being compiled in all the platforms (not only on Uno). As a result, the second time you compile, it fails.

Steps to Reproduce

  1. Use the given platformio.ini file in a project.
  2. Compile it once --> ok.
  3. Compile it twice --> error!
  4. Delete the .piolibdeps/AdafruitMotorShield....ID27 folder.
  5. Compile it again --> ok.
  6. Compile it again --> error!.

Actual Results

Tries to compile wrong libraries in compilation environment that do not depend on them.

 [10/31/17 12:38:33] Processing esp32doit-devkit-v1 (platform: espressif32; lib_deps: PubSubClient, Adafruit NeoPixel; board: esp32doit-devkit-v1; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
Converting src.ino
Collected 19 compatible libraries
Looking for dependencies...
Library Dependency Graph
|-- < PubSubClient > v2.6
|-- < Adafruit NeoPixel > v1.1.3
|-- < Adafruit Motor Shield library > v1.0.0
|-- < gatArduinOSEK >
Compiling .pioenvs\esp32doit-devkit-v1\src\src.ino.o
Compiling .pioenvs\esp32doit-devkit-v1\lib\Adafruit Motor Shield library_ID27\AFMotor.o
.piolibdeps\Adafruit Motor Shield library_ID27\AFMotor.cpp:136:5: error: #error "This chip is not supported!"
#error "This chip is not supported!"

Expected Results

The compilation environment must only compile the libraries they depend on.

If problems with PlatformIO Build System:

The content of platformio.ini:

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

[platformio]
; env_default = esp32doit-devkit-v1
; --> ESP32_DEV
; -DARDUINO=10610 -DARDUINO_ARCH_ESP32 -DESP32 -DESP_PLATFORM -DF_CPU=240000000L -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DPLATFORMIO=30500 -DESP32_DEV -DARDUINO_ESP32_DEV
; env_default = esp32dev
; --> ESP32_DEV
; -DARDUINO=10610 -DARDUINO_ARCH_ESP32 -DESP32 -DESP_PLATFORM -DF_CPU=240000000L -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DPLATFORMIO=30500 -DESP32_DEV -DARDUINO_ESP32_DEV
; env_default = d1_mini
; --> ESP8266_WEMOS_D1MINI
; -DARDUINO=20300 -DLWIP_OPEN_SRC -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -DPLATFORMIO=30500 -DESP8266 -DARDUINO_ARCH_ESP8266 -DESP8266_WEMOS_D1MINI
; env_default = nodemcuv2
; --> ARDUINO_ESP8266_NODEMCU
; -DARDUINO=20300 -DLWIP_OPEN_SRC -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -DPLATFORMIO=30500 -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_NODEMCU
; env_default = teensy31
; --> TEENSY31
; -DF_CPU=72000000L -DLAYOUT_US_ENGLISH -DPLATFORMIO=30500 -D__MK20DX256__ -DTEENSY31 -DUSB_SERIAL -DARDUINO=10610 -DTEENSYDUINO=136
; env_default = uno
; --> ARDUINO_AVR_UNO
; -DF_CPU=16000000L -DPLATFORMIO=30500 -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10619
[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
lib_deps =
  PubSubClient
  Adafruit NeoPixel


[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps =
  PubSubClient
  Adafruit NeoPixel


[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
lib_deps =
  PubSubClient
  Adafruit NeoPixel


[env:d1_mini]
platform = espressif8266
board = d1_mini
framework = arduino
lib_deps =
  PubSubClient
  Adafruit NeoPixel


[env:teensy31]
platform = teensy
framework = arduino
board = teensy31
lib_deps =
  Adafruit NeoPixel


[env:uno]
platform = atmelavr
board = uno
framework = arduino
lib_deps =
  Adafruit Motor Shield library
  Adafruit NeoPixel
@universam1
Copy link

exact same issue here with PlatformIO, version 3.5.0a17

atanisoft referenced this issue in bjorniuppsala/BaseStation Nov 21, 2017
implementing generation of dcc signal remains to be done though.
@ivankravets
Copy link
Member

It seems that you have IFDEF guard for different dev/Platforms. Please take a look at chain+ of http://docs.platformio.org/en/latest/librarymanager/ldf.html#dependency-finder-mode

@euphi
Copy link

euphi commented Dec 8, 2017

How do I handle this situation for libraries where I try to have a CI integration?

Please see my question on community.platformio.org: https://community.platformio.org/t/set-lib-ldf-mode-for-libraries-library-json-only/3044

ivankravets added a commit that referenced this issue Dec 28, 2017
… issue #1236, issue #1235, issue #953, issue #1118, issue #1107, issue #1196, issue #1179, issue #1161, issue #1126, issue #104, issue #1033, issue #1034, issue #1175, issue #1173, issue #1155, issue #1188, issue #1111, issue #1153, issue #1150, issue #1145, issue #1139, issue #1137, issue #1170, issue #1157, issue #1102, issue #1105, issue #1140, issue #1154, issue #1066, issue #1038, issue #1054, issue #1055, issue #1061, issue #1017)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants