Wasted-Audio / hvcc

The heavy hvcc compiler for Pure Data patches. Updated to python3 and additional generators
https://wasted-audio.github.io/hvcc/
GNU General Public License v3.0
240 stars 28 forks source link

fix: if os is Windows call emcc via batch not shell script #151

Closed vulcu closed 7 months ago

vulcu commented 9 months ago

On Windows (possibly only on some systems), calling which("emcc") in Python returns the path to the emcc shell script entry point used by Unix systems, and not the batch file entry point required to run emcc from Window's cmd shell.

This PR adds a quick check to ensure the correct script is pointed to when running HVCC on Windows systems. The emcc shell script has no .sh extension, so appending .bat is sufficient to fix the issue.

vulcu commented 9 months ago

just realized I should have put this after the if emcc_path is None conditional, not before it

dromer commented 9 months ago

This is not correct. which() searches for the emcc command, not the emcc.sh command.

Please check if on your os which("emcc.bat") works. Then the check needs to happen before which() is called.

dromer commented 7 months ago

@vulcu this works correctly for you on windows now?

vulcu commented 7 months ago

@dromer Yes, I have tested it on two different windows machines I have. It works as expected on both systems. One caveat is that I have only tested using MinGW and/or MSYS2, and not when running python in cmd or powershell. Let me know and I can test those too, although would not expect a different result.

dromer commented 7 months ago

Would be a nice test yeah. If you can test that as well than I'll merge it right away!

vulcu commented 7 months ago

Okay, I've tested it on two windows machines when running python from cmd and from powershell, and it works as expected. I think we're good!