github / github/codeql-cli-binaries

unable to create database if there is a space in the command argument

Open
#73 10 comments 0 reactions 0 assignees View on GitHub
CLI
Dominant language
No language data
Stars
1k
Forks
184
PR merge metrics
No merged PRs in 30d

Description

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]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.