platformio-core: Cannot use generic platform_packages = $URL with different OS
Configuration
Operating system: Any
PlatformIO Version (platformio --version):
abc0489
Description of problem
Original issues: https://github.com/platformio/platform-espressif8266/issues/224 https://github.com/esp8266/Arduino/pull/6294
From the platform/espressif8266 issue, this is the local configuration for the current development version for esp8266 Core: platformio.ini
[env]
platform = espressif8266
board = d1_mini
framework = arduino
platform_packages =
framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git
toolchain-xtensa @ https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/x86_64-linux-gnu.xtensa-lx106-elf-0474ae9.200706.tar.gz
[env:test]
src_build_flags = -DTEST
While this configuration is valid on Linux x86_64, it is not possible to re-use the same environment options on Windows.
My proposal is to either:
- add
platform_repositories = ...setting with file:///… (or just filename, same directory), https:///… syntax, allowing the user to create the package manifest manually (as described in the https://docs.platformio.org/en/latest/platforms/creating_platform.html), thus allowing to specify multiple package options which could be filtered by OS. - allow ‘framework’ package to somehow override package versions. For example, esp8266/Arduino already maintains Arduino IDE manifests, which could be read by PIO (or, read directly). Current implementation uses tools/get.py external script to read it’s contents, which it turn downloads OS-specific package to be used with the arduino-cli
- edit: allow to also specify the
"system"clause (linux_x86_64, darwin_x86_64 etc.). idk how this would happen in .ini though
As discussed in the esp8266/Arduino issue, this also creates problems with their CI system while building development versions. Current implementation simply re-uses tools/get.py result and replaces the ~/.platformio/packages/toolchain-xtensa with the up-to-date version, preserving the old package.json to avoid version conflicts https://github.com/esp8266/Arduino/pull/6294#issuecomment-641513627
Additional info
It is possible to create a custom platform and provide a correct manifest.json. However this would also require maintaining differences between the real platform and the fork, as there is also python code shipped with the platform: https://github.com/Jason2866/platform-espressif8266/tree/new_gcc
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 23 (14 by maintainers)
Commits related to this issue
- pio: fix git builds & bump current platform - platform == platform_latest - mcspr/toolchain-xtensa via https://github.com/platformio/platformio-core/issues/3612 - avoid useless warnings with old plat... — committed to mcspr/espurna by mcspr 4 years ago
- pio: fix git builds & bump current platform - platform == platform_latest - mcspr/toolchain-xtensa via https://github.com/platformio/platformio-core/issues/3612 Yet, this does not avoid useless warn... — committed to mcspr/espurna by mcspr 4 years ago
- pio: fix git builds & bump current platform - platform == platform_latest - mcspr/toolchain-xtensa via https://github.com/platformio/platformio-core/issues/3612 Yet, this does not avoid useless warn... — committed to mcspr/espurna by mcspr 4 years ago
Can confirm. It does work 😃 Thx @ivankravets for your help (again!) and @mcspr for the doing (i thought to much complicated…)