-
Notifications
You must be signed in to change notification settings - Fork 115
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
unable to create database if there is a space in the command argument #73
Comments
Thanks for reporting this! We have a fix in progress that will make it into a future version of CodeQL, most likely 2.6.0. |
Thank you Aditya. |
@adityasharad Is the beta version have the fix for this above issue? |
@adityasharad Is this issue fixed in the latest v2.6.0 ? Can you please confirm. Thank you. |
To handle spaces in your command arguments, I believe the safest approach is to create a separate batch script that contains your build command, and invoke that from For example, create a script msbuild /t:rebuild "C:\codeql-home\drivers\kmdf\kmdfecho.sln" /p:Configuration="win10 Debug" /p:UseSharedCompilation=false and then run C:\codeql-home\codeql\codeql.cmd database create -l=cpp -s="C:\codeql-home\drivers\kmdf" -c "build.bat" "C:\codeql-home\databases\kmdf" -j 0 Could you please try that with CodeQL 2.6.0? |
@adityasharad Thank you for your response.
We are currently using this approach and it is working well from v2.5.8(we started from this version). Only issue is we are adding additional bat file in the process and want to know if it can be avoided. If this is the preferred solution we will continue as suggested.
Just confirming since it was mentioned. Please keep us posted in case if it can be expected in upcoming releases. |
Hi @adityasharad tried escaping the quotes and didn't work. Tried the following and none of them worked. Do you have anything to suggest here to escape the quotes,
|
Has this been resolved? running into the same issue |
Running into the same issue in |
@qianfei11 I think this is a ongoing issue. I had to do the same thing in order to get the commands to work. |
From, https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/static-tools-and-codeql
C:\codeql-home>C:\codeql-home\codeql\codeql.cmd database create -l=cpp -s=C:\codeql-home\drivers\kmdf -c "msbuild /t:rebuild "C:\codeql-home\drivers\kmdf\kmdfecho.sln" /p:UseSharedCompilation=false" "C:\codeql-home\databases\kmdf" -j 0
If the above command is modified to incorporate configuration the database creation fails,
C:\codeql-home>C:\codeql-home\codeql\codeql.cmd database create -l=cpp -s=C:\codeql-home\drivers\kmdf -c "msbuild /t:rebuild "C:\codeql-home\drivers\kmdf\kmdfecho.sln" /p:Configuration="win10 Debug" /p:UseSharedCompilation=false" "C:\codeql-home\databases\kmdf" -j 0
Error:
The system cannot find the file specified.
Invalid value for positional parameter at index 0 (): cannot convert 'Debug /p:UseSharedCompilation=false' to Path (java.nio.file.InvalidPathException: Trailing char < > at index 5: Debug /p:UseSharedCompilation=false)
Try codeql database create --help for usage help.
However the same command using msbuild succeeds. Also the same command without space works,
C:\codeql-home>C:\codeql-home\codeql\codeql.cmd database create -l=cpp -s=C:\codeql-home\drivers\kmdf -c "msbuild /t:rebuild "C:\codeql-home\drivers\kmdf\kmdfecho.sln" /p:Configuration="win10Debug" /p:UseSharedCompilation=false" "C:\codeql-home\databases\kmdf" -j 0
Creates database successfully.
Initializing database at C:\codeql-home\databases\kmdf.
Running build command: [msbuild, /t:rebuild, kmdfecho.sln, /p:Configuration=win10Debug, /p:UseSharedCompilation=false]
The text was updated successfully, but these errors were encountered: