platform-espressif32 icon indicating copy to clipboard operation
platform-espressif32 copied to clipboard

How to instruct PlatformIO to store the platform with versioning suffix?

Open lexologe opened this issue 3 years ago • 5 comments

Hello,

I am searching for a solution to have versioned platforms in my ~/.platformio/platforms folder.

If I have in platformio.ini

platform = espressif32

or if I use my own platform in platformio.ini

platform = https://example.com/my-own-platform-espressif32-v1.2.3.tar.gz

In both cases the folder in ~/.platformio/platforms is called espressif32

Would it be possible to add any versioning information to the name of the folder in order to differentiate between both?

lexologe avatar Aug 09 '22 07:08 lexologe

Hi @lexologe ! What problem are you trying to solve? In a nutshell, there is no easy way to do what you want mainly because PlatformIO handles package names by its own rules.

valeros avatar Aug 09 '22 10:08 valeros

Hi @valeros, the problem to solve is that the two platforms are based on different ESP IDF versions. If someone has already installed the platform = espressif32 variant and opens my project, the platform in ~/.platformio/packages/espressif32 will not be updated to my custom one. In that case the project will not build correctly and I have to ask the developer to delete the folder before building my project.

If a Git repo is used, I can use a branch or a tag as a suffix to the URL: e.g. https://github.com/platformio/[email protected]

If I use a ZIP or tar.gz package, I don't know how to add versioning information. I dont think that this will work: e.g. https://example.com/[email protected] Or may be better or easier if a hash of the tar.gz file is used as a suffix to the ~/.platformio/packages/espressif32@<tar-gz-hash>

lexologe avatar Aug 09 '22 10:08 lexologe

Are you in control of the platformio.ini files in your project examples? Why don't you purposely specify platform = https://example.com/my-own-platform-espressif32-v1.2.3.tar.gz in all of them? Alternatively, you can add an extra script that will verify whether the right platform is used (e.g. by checking the platform.json file) and simply raise an error if the platform is not the right one.

valeros avatar Aug 09 '22 11:08 valeros

If i understand it correctly ~/.platformio/packages/espressif32 is always the latest / default one that PIO uses when you just specify platform = espressif32. However, you can specify a specific version platform = espressif32 @ 5.1.0 in your platformio.ini and PIO will use it or download it for you.

xsrf avatar Aug 22 '22 21:08 xsrf

This issue has been automatically marked as stale because it has not had recent activity. Please provide more details or it will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 24 '22 06:09 stale[bot]