I have a project for esp8266 and esp32. For each cpu, I support various boards, sometimes different features are enabled for different builds.
Does platformio supports hierarchical scopes? Or is this feature planed?
It would be great, if the envoriment [env:esp8266:xyz] uses the config from [env:esp8266] and also from [env]
Example:
[env]
; Config for all Builds
[env:esp32]
; Config for esp32-Builds
[env:esp8266]
; Config for esp8266-Builds
[env:esp32:dev]
; Config for one esp32 Board
[env:esp8266:dev]
; Config for one esp8266 Board
yes, I know. It helps to limit the amount of changes, if an options is changed, but I still have to add many, many lines to the platformio.ini.
I attached my platform.ini below. It already uses the new [env] feature in Version 4.
I still have to add the board_build and the platform options in every single esp8266 section. I can not add them to [env], because it isn’t needed for the esp32-sections.
With Version 4, the [env:*]-section are “inheriting” from the [env].
My proposal would be:
[env:esp8266:X] inherts from [env:esp8266] and [env:esp8266] from [env].
So [env:esp8266:X] has all the configs from [env:esp8266] and [env].
Perhaps I’m doing something wrong but is this applicable also on Windows? It appears that : is not allowed in filesystem names and so the following in builder/main.py throws:
if not isdir(env.subst("$BUILD_DIR")):
makedirs(env.subst("$BUILD_DIR")) # NotADirectoryError: [WinError 267] The directory name is invalid: '...\esp32:dev':
Did you call your environment [env:esp32:dev]? The name after env should not contain illegal characters in the context of the filesystem. Rename it to e.g. [env:esp32dev].