hello from Particle :wave:
we've recently received a handful of reports (1, 2) that our Particle Workbench extension (link) does not play well with the PlatformIO extension (link). notably, this appears to only impact Windows machines.
it seems something in the v2.0.0 or v2.0.1 releases (1, 2) interferes with Workbench's ability to configure the user's local environment.
Repro Steps
Particle: Create Project command and follow the promptssrc/<project-name>.ino fileParticle: Compile application (local) commandParticle: Compile application (local) commandExpected
Project compiles successfully
Actual
Project fails to compile, error message of /usr/bin/bash: make: command not found is displayed in the active VSCode terminal panel
_if you then disable the PlatformIO extension, click the "reload required" button, and re-try the Particle: Compile application (local) command, compilation should succeed again._
Environment Info
v10.0.19041 (info)v1.49.2Under the hood, Particle Workbench uses VSCode's TaskProvider APIs (docs) to temporarily configure the user's local environment - specifically prepending paths to their $PATH variable and setting a number of environment variables (e.g PARTICLE_CLI_PATH, DEVICE_OS_PATH, PLATFORM_ID, etc) within the task's shell.
To see this in action, you can run the Particle: Launch Compiler Shell command and in the terminal panel that launches execute echo $PATH. Comparing between the two scenarios, i see:
With PlatformIO disabled
41 entries
Particle entries:
/cygdrive/c/Users/me/.vscode/extensions/particle.particle-vscode-core-1.12.3/src/cli/bin/windows/amd64
/cygdrive/c/Users/me/.particle/toolchains/gcc-arm/5.3.1/bin
/cygdrive/c/Users/me/.particle/toolchains/openocd/0.11.2-adhoc6ea4372.0/bin
With PlatformIO enabled
77 entries, many duplicated
no Particle entries
Happy to help troubleshoot further or otherwise work to coordinate things such that our extensions can peacefully coexist :pray::heart::+1:
Hi,
Thanks for the report! We will investigate this issue.
A temporary solution is to enable this setting https://docs.platformio.org/en/latest/integration/ide/vscode.html#platformio-ide-activateonlyonplatformioproject
So, PlatformIO's extension will be activated only on PlatformIO's project.
@ivankravets
Thanks for the report! We will investigate this issue.
sure thing! thanks for taking a look :pray:
A temporary solution is to enable this setting https://docs.platformio.org/en/latest/integration/ide/vscode.html#platformio-ide-activateonlyonplatformioproject
with that setting enabled within VSCode (screenshot below), i'm still seeing the reported issue. my steps to test were:
Activate Only On Platform IOProject option
Enabling the mentioned setting works here, but I needed one additional step:
If the PIO extension was enabled in my Particle project once, this setting does not help. The following steps worked in my existing project:
Activate Only On PlatformIO Project optionI could reproduce this issue by adding a platformio.ini to my Particle project. As expected, this broke the Particle build, but it remained broken even after deleting the platformio.ini and restarting VSCode.
It seems the PlatformIO extension somehow remembers that it was active in this project once and activates itself again regardless of the option in the settings. Disabling and re-enabling the PlatformIO extension seems to clear this memory.
Please update PlatformIO IDE for VSCode to 2.1.1.
Does it work now?
Please update PlatformIO IDE for VSCode to 2.1.1.
Does it work now?
No. same issue. I disable, restart VSCode, Particle project compiles fine. Go into PlatformIO and Enabled it, even without a restart of VSCode, compiling now fails. Restart VSCode with PlatformIO enabled; particle compile fails with same error messages as before :(
Note: if I disable PlatformIO for just the Particle Workspace/Project folder, it appears to allow me to compile fine in that workspace and open another VSCode with a PlatformIO project.
So under the Extension manager when a Workspace/Project is open, on the PlatformIO IDE settings tab, I select "Disable (Workspace)", click "Reload Required", compiling then works.
2.1.1 did also not change anything for me. As I described in https://github.com/platformio/platformio-vscode-ide/issues/2045#issuecomment-705039040, if the PlatformIO extension was activated once in a Particle project, it breaks compiling until it is disabled.
To reproduce:
With the setting Platformio-ide: Activate Only On Platform IOProject disabled:
With the setting Platformio-ide: Activate Only On Platform IOProject enabled:
platformio.ini in the Particle project folderplatformio.iniSo the Particle compiler does not work if the PlatformIO extension was active anytime in the project before, which can be caused either if the setting Platformio-ide: Activate Only On Platform IOProject was disabled in the project or by adding a platformio.ini (which does not make sense in a Particle project, just for demonstration here).
Hope this information is helpful for your work!
@busticated where is located the source code of Particle extension?
How about 2.1.2 version?
How about 2.1.2 version?
Appears to be working for me! Thanks
Great!
@ivankravets repo is private but the code ships unbundled atm so you can see it in ~/.vscode/extensions/particle.particle-vscode-core-<version-here> :+1:
@busticated it seems like the latest release has fixed this issue. Thanks for the report! 鈽猴笍
Fixed it for me too! (tested with 2.1.3)
Most helpful comment
@busticated it seems like the latest release has fixed this issue. Thanks for the report! 鈽猴笍