PlatformIO Community

PlatformIO installing dependencies for the wrong platform

Hello, for some reason, PlatformIO ignores dependency platforms when installing dependencies from library.json from an actual dependency defined in platformio.ini.

My platformio.ini

[platformio]
default_envs = esp32dev

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_ldf_mode = chain+
lib_deps = 
	sandeepmistry/LoRa@^0.8.0
	ottowinter/ESPAsyncWebServer-esphome @ ^2.1.0
board_build.f_cpu = 80000000L
monitor_speed = 115200

[env:nanoatmega328]
platform = atmelavr
board = nanoatmega328

Here is a library.json from ESPAsyncWebServer-esphome

{
  "name":"ESPAsyncWebServer-esphome",
  "description":"Asynchronous HTTP and WebSocket Server Library for ESP8266 and ESP32",
  "keywords":"http,async,websocket,webserver",
  "authors":
  {
    "name": "ESPHome Team",
    "maintainer": true
  },
  "repository":
  {
    "type": "git",
    "url": "https://github.com/esphome/ESPAsyncWebServer.git"
  },
  "version": "2.1.0",
  "license": "LGPL-3.0",
  "frameworks": "arduino",
  "platforms": ["espressif8266", "espressif32"],
  "dependencies": [
    {
      "owner": "ottowinter",
      "name": "ESPAsyncTCP-esphome",
      "platforms": "espressif8266"
    },
    {
      "owner": "esphome",
      "name": "AsyncTCP-esphome",
      "platforms": "espressif32"
    },
    {
      "name": "Hash",
      "platforms": "espressif8266"
    },
    {
      "name": "ESP8266WiFi",
      "platforms": "espressif8266"
    }
  ]
}

For some reason, PlatformIO installs all the dependencies ignoring the “platforms” despite me tryingto build it only for platform “espressif32”. When I manually remove these dependencies from the file the libraries no longer install.

What can I do to fix it? Thank you

And that happens with the latest PlatformIO core? Remove the .pio folder, CLIpio upgrade --dev and build again. Does it again download the wrong deps?

1 Like

Just tried it. Unfortunately, it does. Here is the command line output:

PlatformIO has been successfully upgraded to 6.1.0b1!

*********************************************************************************************************************
If you like PlatformIO, please:
- follow us on Twitter to stay up-to-date on the latest project news > https://twitter.com/PlatformIO_Org
- star it on GitHub > https://github.com/platformio/platformio
- try PlatformIO IDE for embedded development > https://platformio.org/platformio-ide
*********************************************************************************************************************

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
---------------------------------------------------------------------------------------------------------------------
Library Manager: Installing sandeepmistry/LoRa @ ^0.8.0
Unpacking  [####################################]  100%
Library Manager: LoRa@0.8.0 has been installed!
Library Manager: Installing ottowinter/ESPAsyncWebServer-esphome @ ^2.1.0
Unpacking  [####################################]  100%
Library Manager: ESPAsyncWebServer-esphome@2.1.0 has been installed!
Library Manager: Resolving dependencies...
Library Manager: Installing ottowinter/ESPAsyncTCP-esphome
Unpacking  [####################################]  100%
Library Manager: ESPAsyncTCP-esphome@1.2.3 has been installed!
Library Manager: Installing esphome/AsyncTCP-esphome
Unpacking  [####################################]  100%
Library Manager: AsyncTCP-esphome@1.2.2 has been installed!
Library Manager: Installing Hash
Library Manager: Installing ESP8266WiFi
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (4.4.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 80MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.20003.220626 (2.0.3) 
 - tool-esptoolpy @ 1.30300.0 (3.3.0) 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain+, Compatibility ~ soft
Found 36 compatible libraries
Scanning dependencies...
Dependency Graph
|-- LoRa @ 0.8.0
|   |-- SPI @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 2.1.0
|   |-- AsyncTCP-esphome @ 1.2.2
|   |-- ESP8266WiFi
|   |-- FS @ 2.0.0
|   |-- WiFi @ 2.0.0
|-- SPI @ 2.0.0
|-- WiFi @ 2.0.0
|-- AsyncTCP-esphome @ 1.2.2
|-- Update @ 2.0.0
|-- FS @ 2.0.0
Building in release mode

According to dependencies — PlatformIO latest documentation this should work. Please file an issue in Issues · platformio/platformio-core · GitHub so that @ivankravets can look into it.

1 Like