platformio / platform-ststm32

ST STM32: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/ststm32
Apache License 2.0
407 stars 312 forks source link

Improving west.yml support when using framework-zephyr #817

Open jalinei opened 3 days ago

jalinei commented 3 days ago

Hi,

I would like to propose changes to scripts located inside framework-zephyr but I understood that they were not on git yet. Is it possible to have a separate issue tracker for framework-zephyr pio scripts (namely install-deps.py platformio-build.py and platformio-pre-build.py ?

Problem statement :

In the current implementation zephyr dependencies are installed by parsing and downloading entries in main west.yml file in framework-zephyr folder. Installed dependencies version numbers are stored in state.json in _pio folder.

I found two improvements that should be relatively easy to implement (I can propose a PR if there is a git for these files)

1) Fix the way install-deps.py check if dependency should be installed or not. At the moment even if version number is stored in state.json, the only thing triggering download action is the presence (or the absence) of the module folder in _pio directory, no matter if the version has changed. Then no matter what, state.json is updated with new version hash, without upgrading the module itself. Currently, the only way of changing the version of a dependency is to manually edit west.yml then to supress corresponding module folder to trigger module install.

2) In zephyr workflow, user can have a project based west.yml file that permits to have per project dependencies. This is currently not the case in platformio, where west.yml is not meant to be modified by the user.
Proposed change is :

What do you think ?