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

extends doesn't override options as it is described in documentation #4462

Closed
1 task done
stas-sl opened this issue Nov 16, 2022 · 4 comments
Closed
1 task done

extends doesn't override options as it is described in documentation #4462

stas-sl opened this issue Nov 16, 2022 · 4 comments
Labels
bug config platformio.ini
Milestone

Comments

@stas-sl
Copy link

stas-sl commented Nov 16, 2022

What kind of issue is this?

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

Configuration

Operating system: Mac OS 11.7.1

PlatformIO Version (platformio --version): 6.1.5

Description of problem

Documentations says:

If multiple items specified in the extends field then only values from the latter one will be used in the final configuration.

But in reality if multiple sections contain same options, then the value will be taken from the first one, not the last.

Steps to Reproduce

Basically, just copy the example from the documentation:

[base]
platform = teensy
framework = arduino
board = teensy31

[lib_deps1]
lib_deps =
    monstrenyatko/ArduinoMqtt @ ^1.5.1
    bblanchon/ArduinoJson @ ^6.18.3
    knolleary/PubSubClient @ ^2.8

[lib_deps2]
lib_deps =
    sstaub/Ticker @ ^4.3.0
    thijse/ArduinoLog @ ^1.1.1
    adafruit/RTClib @ ^1.14.0

[env:final]
extends = base, lib_deps1, lib_deps2
; The values from `lib_deps2` will override the values from lib_deps1, so
; the final `lib_deps` option will be equivalent to the following:
; lib_deps =
;    sstaub/Ticker @ ^4.3.0
;    thijse/ArduinoLog @ ^1.1.1
;    adafruit/RTClib @ ^1.14.0

and run pio project config:

> pio project config
Computed project configuration for .../test-extends
base
----
platform   =  teensy
framework  =  arduino
board      =  teensy31

lib_deps1
---------
lib_deps  =  monstrenyatko/ArduinoMqtt @ ^1.5.1
             bblanchon/ArduinoJson @ ^6.18.3
             knolleary/PubSubClient @ ^2.8

lib_deps2
---------
lib_deps  =  sstaub/Ticker @ ^4.3.0
             thijse/ArduinoLog @ ^1.1.1
             adafruit/RTClib @ ^1.14.0

env:final
---------
extends    =  base
              lib_deps1
              lib_deps2
platform   =  teensy
framework  =  arduino
board      =  teensy31
lib_deps   =  monstrenyatko/ArduinoMqtt @ ^1.5.1
              bblanchon/ArduinoJson @ ^6.18.3
              knolleary/PubSubClient @ ^2.8

Actual Results

You can see, that lib_deps option value is taken from lib_deps1 section which comes first in the extends list.

Expected Results

Options from latter sections overwrite options from previous sections as it is stated in the documentation.

@stas-sl
Copy link
Author

stas-sl commented Nov 17, 2022

It was also mentioned before here: #3952.

@ivankravets
Copy link
Member

Thanks for the report. Please re-test with pio upgrade --dev.

@stas-sl
Copy link
Author

stas-sl commented Jan 15, 2023

Thanks for fixing it! I tried and it works now.
💙💛

@cyberman54
Copy link

i can confirm that issue #4448 is fixed on my windows machine with current --dev version, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug config platformio.ini
Projects
None yet
Development

No branches or pull requests

3 participants