mstorsjo/msvc-wine

output of `/showIncludes /scanDependencies` not translated

huangqinjin opened this issue · 4 comments

Repro

main.cpp

#include <stdio.h>

without /scanDependencies

$ /opt/msvc/bin/x64/cl.exe /c main.cpp /showIncludes
Microsoft (R) C/C++ Optimizing Compiler Version 19.36.32502 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

main.cpp
Note: including file: /opt/msvc/kits/10/include/10.0.22621.0/ucrt/stdio.h
Note: including file:  /opt/msvc/kits/10/include/10.0.22621.0/ucrt/corecrt.h
Note: including file:   /opt/msvc/vc/tools/msvc/14.36.32502/include/vcruntime.h
Note: including file:    /opt/msvc/vc/tools/msvc/14.36.32502/include/sal.h
Note: including file:     /opt/msvc/vc/tools/msvc/14.36.32502/include/concurrencysal.h
Note: including file:    /opt/msvc/vc/tools/msvc/14.36.32502/include/vadefs.h
Note: including file:  /opt/msvc/kits/10/include/10.0.22621.0/ucrt/corecrt_wstdio.h
Note: including file:   /opt/msvc/kits/10/include/10.0.22621.0/ucrt/corecrt_stdio_config.h

with /scanDependencies

$ /opt/msvc/bin/x64/cl.exe /c main.cpp /showIncludes /scanDependencies main.cpp.obj.ddi
Microsoft (R) C/C++ Optimizing Compiler Version 19.36.32502 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

main.cpp
Note: including file: z:\opt\msvc\kits\10\include\10.0.22621.0\ucrt\stdio.h
Note: including file:  z:\opt\msvc\kits\10\include\10.0.22621.0\ucrt\corecrt.h
Note: including file:   z:\opt\msvc\vc\tools\msvc\14.36.32502\include\vcruntime.h
Note: including file:    z:\opt\msvc\vc\tools\msvc\14.36.32502\include\sal.h
Note: including file:     z:\opt\msvc\vc\tools\msvc\14.36.32502\include\concurrencysal.h
Note: including file:    z:\opt\msvc\vc\tools\msvc\14.36.32502\include\vadefs.h
Note: including file:  z:\opt\msvc\kits\10\include\10.0.22621.0\ucrt\corecrt_wstdio.h
Note: including file:   z:\opt\msvc\kits\10\include\10.0.22621.0\ucrt\corecrt_stdio_config.h

Additional Information

Seems if /scanDependencies is not specified, /showIncludes output to stdout, otherwise /showIncludes output to stderr.

Thanks for the report, this should be fixed by 635a3aa.

Including iostream for test, I found stderr of wine and cl interleave.

...
Note: including file:         /opt/msvc/kits/10/include/10.0.22621.0/ucrt/wchar.h
Note: including file:          /opt/msvc/kits/10/include/10.0.22621.0/ucrt0024:fixme:file:server_get_file_info Unsupported info class 33
\corecrt_wconio.h
Note: including file:          /opt/msvc/kits/10/include/10.0.22621.0/ucrt/corecrt_wctype.h
...

I think we should suppress all outputs of wine by WINEDEBUG=-all.

Including iostream for test, I found stderr of wine and cl interleave.

...
Note: including file:         /opt/msvc/kits/10/include/10.0.22621.0/ucrt/wchar.h
Note: including file:          /opt/msvc/kits/10/include/10.0.22621.0/ucrt0024:fixme:file:server_get_file_info Unsupported info class 33
\corecrt_wconio.h
Note: including file:          /opt/msvc/kits/10/include/10.0.22621.0/ucrt/corecrt_wctype.h
...

I think we should suppress all outputs of wine by WINEDEBUG=-all.

Right, if something is parsing the output from stderr, then we probably must do that.

I'm not familiar with the use case of /scanDependencies, can you explain where/how it's used. Do cmake set that up, and does it make ninja parse the output of stderr instead of stdout?

/scanDependencies is to support building projects of C++20 Modules. Because modules should be built in order of their dependencies.

Yes cmake set that up, a trivial example is here https://github.com/huangqinjin/cxxmodules.

make ninja parse the output of stderr instead of stdout

I have no idea, but I guess ninja always parse both stderr and stdout when the ninja rule has deps = msvc specified.