How can one run the PlatformIO CLI engine without installing anything?
1. Context
Let me first sketch the context. As cofounder of Embeetle IDE (https://embeetle.com), I’m trying to integrate PlatformIO into our IDE. Embeetle has its own way to deal with various tools:
- Tools found on the
$PATH
are made accessible. - Other required tools are offered for download.
Those offered for download are just downloaded into a folder without modifying anything on your system. In other words: Embeetle keeps your system clean by avoiding “tool installations”. Because we don’t put tools on the $PATH
, Embeetle always invokes tools by their absolute paths. This approach works remarkably well for all our tools so far:
2. The case for PIO
Let’s now jump to PlatformIO. Basically, PlatformIO will be a tool in the “Build Automation” category. Granted, it’s doing more than just build automation, but we have to choose a category to put it in.
In case the user already has PlatformIO on his system (more in particular the PlatformIO CLI engine), Embeetle will recognize that and make it available. Case closed.
There’s a problem for users that have no PlatformIO CLI yet. Embeetle would then offer a download of the PlatformIO CLI tool and put it in a folder alongside the other tools. Typically, that would be in a folder like:
<embeetle_installation>/beetle_tools/linux/pio_5.2.3_32b
Now it occurs to me that PIO depends on some system settings (perhaps the $PATH
?) I moved my current '~/.platformio'
folder into my Embeetle installation folder, and then tried to invoke the /bin/pio
file. This is what I get:
# Invoke PIO CLI engine with its absolute path
$ /home/kristof/EMBEETLE_IDE/embeetle/beetle_tools/linux/pio_5.2.3_32b/bin/pio --version
bash: /home/kristof/EMBEETLE_IDE/embeetle/beetle_tools/linux/pio_5.2.3_32b/bin/pio: /home/kristof/.platformio/penv/bin/python: bad interpreter: No such file or directory
As you can see, the CLI engine looks for a python interpreter in the old location '/home/kristof/.platformio/penv/bin/python'
even though that’s empty. It should instead look into the same folder where the CLI engine itself is located. Then it could find it at: '/home/kristof/EMBEETLE_IDE/embeetle/beetle_tools/linux/pio_5.2.3_32b/bin/python'
3. Questions
So everything considered, I would like to ask:
How can one run PlatformIO without modifying anything on the system?
I’m tagging @maxgerhardt, @ivankravets and @valeros because I’m in contact with them regarding the PlatformIO integration into Embeetle IDE.