platformio-core icon indicating copy to clipboard operation
platformio-core copied to clipboard

`lib_compat_mode` should impact `lib_deps`

Open MacDada opened this issue 1 year ago • 0 comments

  • [x] Feature Request.
  • [x] PlatformIO Core.

One will say it would be a new "feature", from the other perspective it could be considered bug report :P

PlatformIO Version (platformio --version): PlatformIO Core, version 6.1.7

Description of problem

lib_deps downloads libs, even if they cannot be used with the current lib_compat_mode settings. If the lib_compat_mode settings won't allow to use the lib, there is no point downloading it.

What would be the use case to include an incompatible lib anyway o.O

Steps to Reproduce

  1. lib_deps: https://github.com/bblanchon/ArduinoJson.git#5.x
  2. #include "ArduinoJson.h"

Actual Results

The lib is successfully downloaded. The code does not compile.

The lib requires Arduino framework – while I’m trying to use it on native platform, without Arduino framework.

Expected Results

The lib should not have been downloaded. Waste of time, if it won't work anyway.

More info

https://community.platformio.org/t/lib-compat-mode-does-not-make-a-difference-for-lib-deps/32664/1

MacDada avatar Jun 18 '23 00:06 MacDada