Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPSL explorer can't compile files #28

Open
Mcgode opened this issue May 6, 2023 · 4 comments
Open

RPSL explorer can't compile files #28

Mcgode opened this issue May 6, 2023 · 4 comments

Comments

@Mcgode
Copy link

Mcgode commented May 6, 2023

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

@FlorianHerickAMD
Copy link
Collaborator

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?

@Mcgode
Copy link
Author

Mcgode commented May 12, 2023

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 default x64-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'

@Mcgode
Copy link
Author

Mcgode commented May 12, 2023

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>

@FlorianHerickAMD
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants