How can I build/upload all my builds at the same time?

Hi,

I have a platformio.ini file with different envs, one for each board where I define some defines for each device. When I press upload (or build), it proceeds to build/upload everything one at a time. Since the builds are not dependent on another, would there be a way to make all those run in parallel?
Here is my .ini

[env]
platform = espressif8266
board = nodemcuv2
board_build.f_cpu = 160000000L
board_build.f_flash = 80000000L
framework = arduino

upload_protocol = espota
lib_deps =
    Time
    https://github.com/gmag11/NtpClient.git
    ESPAsyncUDP
    OneWire
    DallasTemperature

[env:1]
build_flags =
    -D PORT=4201
    -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
upload_port = 192.168.0.191

[env:2]
build_flags =
    -D PORT=4202
    -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
upload_port = 192.168.0.192

[env:3]
build_flags =
    -D PORT=4203
    -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
upload_port = 192.168.0.193

[env:4]
build_flags =
    -D PORT=4204
    -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
upload_port = 192.168.0.194

[env:5]
build_flags =
    -D PORT=4205
    -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
upload_port = 192.168.0.195

[env:6]
build_flags =
    -D PORT=4206
    -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
upload_port = 192.168.0.190

Thanks

Isn’t it just annoying when you’ve seen something, and can’t find it again later? :man_facepalming:

There isn’t direct support for this AFAIK, but I seem to remember Ivan mentioning in a post where someone ask a similar question, and presented a workaround - basically some way to query platformio for the build environments, and then use that to start multiple builds, one for each target environment. If I find it again, I’ll link it here.

If you are using *nix (mac should probably work too, but I can’t prove due to lack of hardware :wink: ) some kind of “shell magic” could solve your problem:

for e in $(pio project config |grep "env:"|cut -c5-); do (pio run -e $e &); done
1 Like

years passed but this feature would be a must have :smiley:
will this ever be implemented?

This may in general not be a safe operation to do if extra_scripts are in play that e.g. try and generate some environment-specific files in the source tree. Parallel build for all of these would trample on the feet of some other build.