arduino / Arduino

Arduino IDE 1.x
https://www.arduino.cc/en/software
Other
14.08k stars 7.01k forks source link

"pwsh not found in %PATH%" on Windows + MacOS #11565

Open CraigHutchinson opened 3 years ago

CraigHutchinson commented 3 years ago

Issue

Powershell can be installed on Windows or MacOS and a script is used from a custom platform.txt but the pwsh fails to be found even though it can be ran from any cmd windows or terminal

Reproducer

Winows Powershell 7 can be obtained from the store here https://www.microsoft.com/store/productId/9MZ1SNWT0N5D Then in Platform.txt add: recipe.hooks.sketch.prebuild.01.pattern=pwsh

Diagnostics

On windows pwsh is installed to C:\Program Files\WindowsApps\Microsoft.PowerShell_7.1.3.0_x64__8wekyb3d8bbwe which is not part of 'path' however there is some sort of symlink (alias?) that is used MacOs similar occurrence but a symlink exists to /usr/local/microsoft/powershell/7 but Ardunio IDE doens't seem to follow links.

Workaround

Pretty hacky and destined to fail after an update but on Windows adding the C:\Program Files\WindowsApps\Microsoft.PowerShell_7.1.3.0_x64__8wekyb3d8bbwe to PATH environment is a workaround, we tried to repeat it on MacOS but modifying PATH was not as easy.

Conclusion

The Arduino IDE is not following/supporting Symlinks in some manner and/or launching in some 'custom' manner that does not reproduce what a cmd or terminal prompt can launch.

CraigHutchinson commented 2 years ago

How do we get Ardunio IDE bugs chased up, I would be willing to look into this one but the code is foreign to me atm so would need some initial guidance. It is apparent that the PWSH is installed as a symbolic-link and the IDE most likely is not following the links.