stakira / OpenUtau

Open singing synthesis platform / Open source UTAU successor
http://www.openutau.com
MIT License
1.91k stars 272 forks source link

Fix issue when using exe wavtools on Linux #1198

Open parallelepiped2718 opened 1 week ago

parallelepiped2718 commented 1 week ago

I encountered this error when trying to use an external .exe wavtool on Linux: (the first image shows the original error, and the second shows the error after I marked temp.bat and temp_helper.bat as executable) openutau error 1 openutau error 2

The cause was that OpenUtau creates a temporary batch file to run the wavtool and attempts to run it directly, which does not work on Linux because batch files can only run on Windows or through Wine.

This patch fixes it by creating a temporary shell wrapper to run the batch file, but there were a few other changes I had to make to accommodate this, which is described in more detail in the commit messages (there are 5 commits when really there are 2 because I changed one of the commit messages to be worded more clearly). All of the new code is behind checks for OS.IsLinux(), so none of the new code affects things on Windows, but to make sure, I tested it in a Windows VM and external wavtools and resamplers worked fine.

I don't know if macOS faces the same issue, nor do I know if the same fix would work on macOS (because I have never used a mac or developed anything for a mac), so for now this patch affects only Linux.