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

Cannot pin version for transitive dependency #2115

Closed
1 task done
OttoWinter opened this issue Feb 11, 2019 · 2 comments
Closed
1 task done

Cannot pin version for transitive dependency #2115

OttoWinter opened this issue Feb 11, 2019 · 2 comments
Labels
help wanted LDF Library Dependency Finder

Comments

@OttoWinter
Copy link
Contributor

OttoWinter commented Feb 11, 2019

What kind of issue is this?

  • 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: macOS (Darwin Kernel Version 18.5.0)

PlatformIO Version (platformio --version): PlatformIO, version 3.6.4

Description of problem

Cannot pin version of dependency when another dependency uses it (general library dependency graph problem, not specific to platform).

I recently tried the [email protected] package, but that turned out to be too unstable in a couple of places. Now I want to go back to [email protected] but am hitting a problem downgrading a dependency.

I'm using the Async MQTT client library which uses the AsyncTCP library. [email protected] is only compatible with [email protected], but [email protected] is only compatible with [email protected] - so I need platformio to pin AsyncTCP to @1.0.1 for using [email protected]

However, since AsyncMQTTClient uses AsyncTCP, I cannot manually pin the version in lib_deps:

results in:

Scanning dependencies...
Dependency Graph
|-- <AsyncMqttClient> 0.8.2
|   |-- <AsyncTCP> 1.0.3
|-- <AsyncTCP> 1.0.1

which fails because AsyncTCP is compiled twice (once with 1.0.3 and once with 1.0.1).
AsyncMqttClient does not pin the AsyncTCP version, so I would expect putting [email protected] would also override the AsyncTCP platformio uses for AsyncMqttClient (like most package managers)

Steps to Reproduce

  1. New platformio project, platformio.ini (nothing in src/):
[env:nodemcu-32s]
platform = [email protected]
board = nodemcu-32s
framework = arduino
lib_deps =
    [email protected]
    [email protected]
  1. Observe pio run output:
Scanning dependencies...
Dependency Graph
|-- <AsyncMqttClient> 0.8.2
|   |-- <AsyncTCP> 1.0.3
|-- <AsyncTCP> 1.0.1

AsyncTCP appears twice with two versions.

  1. When compiling (touch src/main.cpp), it also appears like 1.0.3 is compiled (resulting in compile error)

Actual Results

see above

Expected Results

|-- <AsyncMqttClient> 0.8.2
|   |-- <AsyncTCP> 1.0.1
|-- <AsyncTCP> 1.0.1

(can pin transitive dependencies in lib_deps)

Additional info

@OttoWinter
Copy link
Contributor Author

Turns out order matters for these entries:

results in

Dependency Graph
|-- <AsyncTCP> 1.0.1
|-- <AsyncMqttClient> 0.8.2
|   |-- <AsyncTCP> 1.0.1

I'm gonna keep this issue open because order shouldn't matter for these things IMO

OttoWinter added a commit to esphome/esphome-core that referenced this issue Feb 11, 2019
OttoWinter added a commit to esphome/esphome-core that referenced this issue Feb 11, 2019
* Revert espressif32 package upgrade

* Update platformio.ini

* Move AsyncTCP to front

See platformio/platformio-core#2115
@ivankravets
Copy link
Member

lib_deps =
[email protected]
[email protected]

Could you swap 2 of these lines? Please [email protected] as first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted LDF Library Dependency Finder
Projects
None yet
Development

No branches or pull requests

2 participants