Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Issue with Qt6's 'rcc.exe' + Ninja

Dec
51
0
Hello.

In a CMake project using Ninja as the "make" program, TCC have problem with this command spawned from Ninja:

"cd /D F:\gv\dx-radio\DAB\AbracaDABra\gv-build &&
F:\gv\Qt\6.7.0\msvc2019_64\.\bin\rcc.exe --output F:/gv/dx-radio/DAB/AbracaDABra/gv-build/.rcc/qrc_AbracaDABra_translations.cpp
--name AbracaDABra_translations F:/gv/dx-radio/DAB/AbracaDABra/gv-build/.rcc/AbracaDABra_translations.qrc --no-zstd"


With quotes ("") and all on 1 line.

TCC errors with "TCC: Unknown command "cd /D F:\gv\dx-radio\DAB\AbracaDABra\gv-build..."

I do have "UnixPaths=Yes" in my tcmd.ini. If I use cmd.exe /C with the ninja build, there is no such problem.
Or if I remove the quotes and run the above manually, there's no problem.

So what could be the problem with the quoted command?
 
When you start a command line with quotes, both CMD and TCC interpret that string as a filename to be executed.

To see what is happening try executing this from the command line in CMD and TCC.

Code:
"c:\FileWhichDoesNotExist.bat TestParm"

When you run cmd.exe /c "..." then the quotes are surrounding a parameter string passed to cmd. CMD then interprets that parameter as a command line to be executed without the quotes.
 
When you start a command line with quotes, both CMD and TCC interpret that string as a filename to be executed.

To see what is happening try executing this from the command line in CMD and TCC.

Code:
"c:\FileWhichDoesNotExist.bat TestParm"

When you run cmd.exe /c "..." then the quotes are surrounding a parameter string passed to cmd. CMD then interprets that parameter as a command line to be executed without the quotes.
Not sure I follow.

But I found a newer version of ninja.exe and the problem vanished.
 
@Gisle Vanem

From ChatGPT resp. MS (and edited by myself):
Code:
/c — Carries out the command specified by <string> and then exits the command processor.

/s — When used with /c or /k, triggers special non-parsing rules that strip the first and last quotes (") around the <string> but leaves the rest of the command unchanged.

For /c or /k, cmd processes the remainder of <string>. Quotation marks are preserved only when all of these conditions apply:

- /s is not used.
- There is exactly one pair of quotation marks.
- No special characters such as & < > ( ) @ ^ | occur inside them.
- There is at least one whitespace character inside them.
- The quoted string is the name of an executable file.

If these conditions are not met, cmd checks whether the first character is an opening ". If so, that opening quote and the corresponding closing quote are removed; text after the closing quote remains.
 
Back
Top