Platformio relative path configs


I would like to reuse some ini file and some scripts. This works great using extra_configs and extra_scripts.
However, I want to re-arrange my file to group some of them in a folder outside the project.
This is when I discovered that any extra_configs and extra_scripts are relative to the project home folder.

This is annoying as it force me to add “…/…/” in all the extra_configs I import (more specifically, one of my ini file I want to add also has extra_configs in it and this is this second layer or extra_configs that have the problem)

Is there a way to specify that a path is relative to the current ini file?


Mh, I would also say that it should be the default behavior of each platformio.ini or configuration ini file to treat relative paths as relative to the configuration ini file itself, not the path of the file that may have included it. At least when it comes to evaluating extra_configs and extra_scripts, not paths used in e.g. build_src_filter etc. I think you have a solid case to open an issue in

oh, ok! So it is relative to the main ini file path, not the project dir path then? (anyway I think this is the same)
The problem by doing this is that it make impossible to share ini files from different projects.
Common → scripts
Common → common.ini (that use extra_configs = esp32.ini for example)
Common → esp32.ini
Project1 → platform.ini (extra_configs = …/Common/common.ini)

The problem here is that platform.ini will include common.ini that will include esp32.ini… but it will not find esp32.ini because it will search it in Project1 dir! :frowning:

By the way, is there any way to know if an extra_configs is no found? (I see no warning, not even in verbose mode)

Thanks maxgerhardt!