Platform_packages ESP and pio pkg and ci

Hi, I using GitHub actions with pio ci on my repository.
For most projects, it’s easy and works fine.
I have a problem with project with ESP and C++17.
In platformio.ini I have something like this:

[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
platform_packages =
    mcspr/toolchain-xtensa@~5.100200.0
    framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git

When I run this, everything is installed correctly and build positive. But when I try this in the console:

pio pkg install -p "espressif8266" -p "mcspr/toolchain-xtensa@~5.100200.0" -p  "framework-arduinoespressif8266@https://github.com/esp8266/Arduino.git"

I got error:

Error: Could not find the package with ‘mcspr/toolchain-xtensa @ ~5.100200.0’ requirements for your system ‘windows_amd64’

And the same on CI GitHub Actions.
Is any solution for that?

As you can see in https://registry.platformio.org/tools/mcspr/toolchain-xtensa/compatibility, the author does not provide this package for Windows, only MacOs. That’s a third-party (not released by PlatformIO staff) package, so the best you can do is ask the original author (mcspr (Max Prokhorov) · GitHub) to update.

However, PlatformIO has this package too: PlatformIO Registry

So why not use

platform_packages =
    platformio/toolchain-xtensa@~2.100200.0
    framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git

instead? (Or just ~2.100300.0 for that matter, it’s the most recent one…)

But when I run my project with mention pilafromio.ini with mcspr/toolchain-xtensa@~5.100200.0 it work (I have Windows).
I try with platformio/toolchain-xtensa but same effect:

Error: Could not find the package with ‘platformio/toolchain-xtensa @ ~5.100300.0’ requirements for your system ‘windows_amd64’

I overlocked that 5.100300.211127+darwin exists. What happens when you use

   mcspr/toolchain-xtensa@5.100300.211127

?

You did not properly copy-paste what I have posted above. It’s not 5.100300.0 it’s 2.100300.0 for the latest 10.3.0 version for the platformio/ releases.

Yes, thx, wrong copy/paste. Project work when I use that in platfromio.ini.
But still when I try:

pio pkg install -p “espressif8266” -p “platformio/toolchain-xtensa@~2.100300.0” -p “framework-arduinoespressif8266@GitHub - esp8266/Arduino: ESP8266 core for Arduino

I got

Error: Could not find the package with ‘platformio/toolchain-xtensa @ ~2.100300.0’ requirements for your system 'windows_amd64

And on CI I use ubuntu, there I got:

Error: Could not find the package with ‘platformio/toolchain-xtensa @ ~2.100300.0’ requirements for your system ‘linux_x86_64’

-p is for platform. The toolchain is a tool, use -t.

pio pkg install -g -p "espressif8266" -t "platformio/toolchain-xtensa@~2.100300.0" -t "https://github.com/esp8266/Arduino.git"

executes just fine on my machine.

>pio pkg install -g -p "espressif8266" -t "platformio/toolchain-xtensa@~2.100300.0" -t "https://github.com/esp8266/Arduino.git"
Platform Manager: Installing espressif8266
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Platform Manager: espressif8266@3.2.0 has been installed!
Tool Manager: Installing platformio/toolchain-xtensa @ ~2.100300.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: toolchain-xtensa@2.100300.210717 has been installed!
Tool Manager: Installing platformio/tool-esptool @ <2
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: tool-esptool@1.413.0 has been installed!
Tool Manager: Installing platformio/tool-esptoolpy @ ~1.30000.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: tool-esptoolpy@1.30000.201119 has been installed!
Tool Manager: toolchain-xtensa@2.100300.210717 is already installed
Tool Manager: Installing git+https://github.com/esp8266/Arduino.git
[..]
Tool Manager: framework-arduinoespressif8266@3.1.0-dev+sha.b080c50 has been installed!

But you don’t need to execute pio pkg install commands when the CI just uses the platformio.ini of the project. pio run will already install it.

1 Like

Ok, It’s starting looking good :slight_smile: thx!