platformio / platformio/platformio-core

`lib_compat_mode` should impact `lib_deps`

Open
#4,666 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement package management
Dominant language
Python
Stars
9.5k
Forks
905
Avg merge
2d 13h
Merged PRs (30d)
2

Description

  • Feature Request.
  • 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source files or tests are named. Start by reproducing the dependency setup with lib_deps: https://github.com/bblanchon/ArduinoJson.git#5.x and the native platform without the Arduino framework, then trace how lib_compat_mode is applied during library dependency resolution; done means incompatible libraries are not downloaded while compatible dependencies still are.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.