RPSL explorer can't compile files
Mcgode opened this issue · 4 comments
Using Visual Studio on Windows, whenever I try to load an uncompiled .rpsl file, I get the following error:
Failed to compile RPSL 'rps_hlslc/rps-hlslc.exe "${PROJECT_DIR}\my_file.rpsl" -od ""${PROJECT_DIR}\\tmp"" -m my_file -O3 -rps-target-dll -rps-bc -cbe=0
Turns out this is because of the following line from rpsl_explorer.hpp
:
rpsHlslcCmdLine << "rps_hlslc/rps-hlslc.exe \"" << pendingFileName << "\" -od \"" << tmpDir << "\" -m "
<< moduleName << " -O3 -rps-target-dll -rps-bc -cbe=0";
Changing the line accordingly for windows fixes the issue, but will most likely not work for Linux:
rpsHlslcCmdLine << "rps_hlslc\\rps-hlslc.exe \"" << pendingFileName << "\" -od " << tmpDir << " -m "
<< moduleName << " -O3 -rps-target-dll -rps-bc -cbe=0";
This does not happen is the file was already compiled, as the explorer fetches the already compiled version instead. This might be why the issue went unnoticed
I cannot reproduce this issue by getting a fresh clone of this repo, running the explorer and loading e.g. any of the test rpsl samples on my Windows system. Could you provide us the specific error that occured (presumably during new process creation at compilation time here), the rpsl file it occured with and the path that file is located at?
I'll go over my repro steps:
- Open project with Visual Studio Community 2019
- Clean build directory and all pre-compiled rpsl files (usually in
tmp
folders) - Rebuild and open
rpsl_explorer.exe
using the defaultx64-Debug
profile - Load
${PROJECT_DIR}/tests/gui/test_triangle.rpsl
- Get this error:
Trying to load RPSL '${PROJECT_DIR}\tests\gui\test_triangle.rpsl'...
Compiling...The thread 0x8314 has exited with code 0 (0x0).
The thread 0x82d4 has exited with code 0 (0x0).
Failed to compile RPSL 'rps_hlslc/rps-hlslc.exe "${PROJECT_DIR}\tests\gui\test_triangle.rpsl" -od ""${PROJECT_DIR}\\tests\\gui\\tmp"" -m test_triangle -O3 -rps-target-dll -rps-bc -cbe=0'
Trying the provided command in the Windows command line results in the following error: 'rps_hlslc/rps-hlslc.exe' is not recognized as an internal or external command, operable program or batch file
.
Powershell has a similar error message.
Looks like a dir seperator issue, so moving to a backslash (rps_hlslc\rps-hlslc.exe
) solves this issue.
However we get another error:
${PROJECT_DIR}\out\build\x64-Debug\tools\rpsl_explorer> rps_hlslc\rps-hlslc.exe "${PROJECT_DIR}\tests\gui\test_triangle.rpsl" -od ""${PROJECT_DIR}\\tests\\gui\\tmp"" -m test_triangle -O3 -rps-target-dll -rps-bc -cbe=0
rps-hlslc.exe: Too many positional arguments specified!
Can specify at most 1 positional arguments: See: rps_hlslc\rps-hlslc.exe -help
Tough if I fix the double double-quote from the command, it finally works properly:
${PROJECT_DIR}\out\build\x64-Debug\tools\rpsl_explorer> rps_hlslc\rps-hlslc.exe "${PROJECT_DIR}\tests\gui\test_triangle.rpsl" -od "${PROJECT_DIR}\\tests\\gui\\tmp" -m test_triangle -O3 -rps-target-dll -rps-bc -cbe=0
${PROJECT_DIR}\out\build\x64-Debug\tools\rpsl_explorer>
It is very peculiar that even by closely following your repro steps the issue it not reproducible. Did you generate the CMake files with the build.bat file we provide.
We will nevertheless include these changes in the next update or a small maintenance one because they make sense.