gcclikecompiler: Fix execution of compiler qprocess under windows
ClosedPublic

Authored by geetamc on Nov 15 2017, 8:04 PM.

Details

Summary

Rather than passing null device as input file to the compiler,
"-" is passed as argument which makes the compiler take input from
stdin, then qprocess' standard input file is set to QProcess:nullDevice()
to make it read eof.

Note that it fixes standard includes not being passed to language plugin if
clang is set as default compiler under windows.

Diff Detail

Repository
R32 KDevelop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
geetamc created this revision.Nov 15 2017, 8:04 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptNov 15 2017, 8:04 PM
brauch added a subscriber: brauch.Nov 15 2017, 9:00 PM

I understand what the patch does, but can you explain why this fixes your issue?

I understand what the patch does, but can you explain why this fixes your issue?

QProcess::nullDevice() returns \\.\NUL on windows,
with options -xc++ -std="c++11" -E -v \\.\NUL,
gcc and clang give error "unknown option \\.\NUL", or something similar, not on windows right now,
sorry for not posting the exact error.

So the actual error is: gcc.exe: error: \\.\NUL: Invalid argument

Now if just "NUL" had been passed it would have been fine so reverting https://phabricator.kde.org/R32:7c02e53ffe532632272a9345f506c5ce67155b42 would do the job too.

kfunk accepted this revision.Nov 15 2017, 10:16 PM
kfunk added a subscriber: kfunk.

Makes sense to me.

This revision is now accepted and ready to land.Nov 15 2017, 10:16 PM
This revision was automatically updated to reflect the committed changes.

Thanks a lot for these patches!

In D8831#168209, @kfunk wrote:

Thanks a lot for these patches!

Thanks for the reviews!