Closed salos1982 closed 6 years ago
That looks really odd. Just like iwyu doesn't get the whitespaces in the include paths despite the fact that they are all quoted. Maybe there is a quote missing somewhere, I'll take a deeper look tomorrow or during the weekend. Does this happen for you with every file and every project you try it on?
Yes it is on all my files in project. it realy strange becuase I take command line and remove includes from it and then add it in the following way include-what-you-use.exe ^ -I "%ProgramFiles(x86)%/Microsoft SDKs/Windows/v7.1A/Include" ^ -I "%ProgramFiles(x86)%/Microsoft Visual Studio 14.0/VC/include" ^ -I "%ProgramFiles(x86)%/Windows Kits/10/Include/10.0.10586.0/ucrt" ^ -I "%ProgramFiles(x86)%/Windows Kits/10/Include/10.0.10586.0/shared" ^ -I D:\work\HiddenLands\src\trunk\project\external\SDL\ -ID:\work\HiddenLands\src\trunk\project\h\ -I D:\work\HiddenLands\src\trunk\project\external\SDL_image -I D:\work\HiddenLands\src\trunk\project\external\SDL_mixer -I D:\work\HiddenLands\src\trunk\project\external\SDL_ttf -I D:\work\HiddenLands\src\trunk\project\e -I D:\work\HiddenLands\src\trunk\project\external\libcurl\include -I D:\work\HiddenLands\src\trunk\project\h\h\framework -I D:\work\HiddenLands\src\trunk\project\h\h\framework\Core -I D:\work\HiddenLands\src\trunk\project\h\h\framework\Utils -I D:\work\HiddenLands\src\trunk\project\h\h\framework\Geom -I D:\work\HiddenLands\src\trunk\project\h\h\framework\Gfx ^ -DWIN32 -DHIDDEN_LAND -DM3_GAME -D_DEBUG -D_CONSOLE -DCHEATS_ON -DFILTER_DEBUG_PRINTF -DPRINTF_TO_DEBUG_OUTPUT_WINDOW -DNEED_TRACE_FUNCTIONAL_WINDOW -DNEED_TRACE_EVENTS_DISPATCHER -DNEED_TRACE_ORIGINAL_TUTORIAL -DNEED_TRACE_ALPHA -DNEED_TRACE_LOBBY_WINDOW -DNEED_TRACE_BOT_MESSAGES ^ -w -Wno-invalid-token-paste -std=c++14 -fms-compatibility -fms-extensions -fdelayed-template-parsing -fmsc-version=1900 -Xiwyu --mapping_file="D:\work\include-what-you-use\bin\msvc.imp" -Xiwyu --mapping_file="D:\work\include-what-you-use\bin\stl.c.headers.imp" -Xiwyu --pch_in_code -Xiwyu --prefix_header_includes=add -Xiwyu --max_line_length=1024 ^ D:\work\HiddenLands\src\trunk\project\h\h\HOScene.cpp
and it works fine. It seems something wrong with quotes.
Thx for checking! I tried putting the command line that failed for you directly into my iwyu installation and pointed it to a different file. Apparently it read all the -I arguments fine since it jumped directly to "file not found" errors, but didn't complain about the paths at all. All the quotes and whitespaces are in the right place. Maybe I should be concerned about the backslashes (escaped characters?) but then again it works fine on my machine. Very mysterious! have you tried running iwyu directly with the arguments that IncludeToolbox suggested? So in your case that would be copy pasting the following into a command prompt:
D:\work\include-what-you-use\bin\include-what-you-use.exe -I "D:\work\HiddenLands\src\trunk\external\SDL" -I "D:\work\HiddenLands\src\trunk\project\external\SDL" -I "D:\work\HiddenLands\src\trunk\project\h" -I "D:\work\HiddenLands\src\trunk\project\external\SDL_image" -I "D:\work\HiddenLands\src\trunk\project\external\SDL_mixer" -I "D:\work\HiddenLands\src\trunk\project\external\SDL_ttf" -I "D:\work\HiddenLands\src\trunk\project\e" -I "D:\work\HiddenLands\src\trunk\project\external\libcurl\include" -I "D:\work\HiddenLands\src\trunk\project\h\h\framework" -I "D:\work\HiddenLands\src\trunk\project\h\h\framework\Core" -I "D:\work\HiddenLands\src\trunk\project\h\h\framework\Utils" -I "D:\work\HiddenLands\src\trunk\project\h\h\framework\Geom" -I "D:\work\HiddenLands\src\trunk\project\h\h\framework\Gfx" -I "D:\Work\Atlantis_mobile\MemoryManager" -I "D:\Work\Atlantis_mobile\MemoryManager" -I "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" -I "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include" -I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt" -I "C:\Program Files (x86)\Windows Kits\8.1\Include\um" -I "C:\Program Files (x86)\Windows Kits\8.1\Include\shared" -I "C:\Program Files (x86)\Windows Kits\8.1\Include\winrt" -I "D:\Work\Atlantis_mobile\MemoryManager" -I "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" -I "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include" -I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt" -I "C:\Program Files (x86)\Windows Kits\8.1\Include\um" -I "C:\Program Files (x86)\Windows Kits\8.1\Include\shared" -I "C:\Program Files (x86)\Windows Kits\8.1\Include\winrt" -DWIN32 -DHIDDEN_LAND -DM3_GAME -D_DEBUG -D_CONSOLE -DCHEATS_ON -DFILTER_DEBUG_PRINTF -DPRINTF_TO_DEBUG_OUTPUT_WINDOW -DNEED_TRACE_FUNCTIONAL_WINDOW -DNEED_TRACE_EVENTS_DISPATCHER -DNEED_TRACE_ORIGINAL_TUTORIAL -DNEED_TRACE_ALPHA -DNEED_TRACE_LOBBY_WINDOW -DNEED_TRACE_BOT_MESSAGES -w -Wno-invalid-token-paste -std=c++14 -fms-compatibility -fms-extensions -fdelayed-template-parsing -fmsc-version=1900 -Xiwyu --verbose=2 -Xiwyu --mapping_file="D:\work\include-what-you-use\bin\msvc.imp" -Xiwyu --mapping_file="D:\work\include-what-you-use\bin\stl.c.headers.imp" -Xiwyu --pch_in_code -Xiwyu --prefix_header_includes=add -Xiwyu --max_line_length=1024 "D:\work\HiddenLands\src\trunk\project\e\e\GUI.h"
Yes I tried to run command line. and I got the same error. May be end of line is not correct.
I'm getting the same issue with file paths having whitespace in them.
Running command 'C:\Users\WardlawP\iwyu\include-what-you-use.exe' with following arguments:
...
-I "D:\projects\src\foreign\ATI AGS\ags_lib\inc"
error: no such file or directory: 'AGS\ags_lib\inc -I D:\projects\src\foreign include -I D:\projects\include -I C:\Program'
I think upgrading the IWYU build at https://github.com/Wumpf/iwyu_for_vs_includetoolbox might fix it.
The new version docs mention a windows file path fix: https://include-what-you-use.org/
Actually I think the issue may be when you give include-what-you-use.exe too long an input...
IncludeToolbox made a very nice (but long) call to include-what-you-use.exe. I copy+pasted it and tried to get it to run on the command line... no dice. After removing a large chunk of the "-I" statements it will run.
I think the problem is process.StartInfo.Arguments in IncludeWhatYouUse.cs gets truncated. Could we call the process using a different .Net API?
Ah perfect, thanks for investigating! I think all this makes sense now: process.StartInfo.Arguments is onlz allowed to be maximal 32699 characters and even CreateProcess limits to 32768 chars. So what we need here is a response file to put in our command line instead. I'd be suprised if iwyu doesn't support that. I'll see if I can find the time to look into that soon.
Meanwhile I updated the iwyu build repository as suggested. Existing installs should pick that update up automatically next time they use iwyu.
The amount of characters process.StartInfo.Arguments allows should be ok... it documents that pre XP it only supported 2200 characters. Weirdly that's the behavior I am getting when using IncludeToolbar. I also see this input limitation with cmd but not powershell.
Also I'm pretty sure IWYU does not support a file argument input.
Hm yeah the input isn't even close to that size. I checked though by now, IWYU does support response files just like clang.
I just tried this and had the exact same error. Looking back at how I'd used IWYU before I noticed I passed the filename to before any -I. Moving it to be the first instead of last parameter got me further.
Ideally the Visual Studio includes should be -isystem instead of -I
Please check my commit for fixing this issue. At least on my side the issue is fixed with using support files.
I have issue with using with include-what-you-need
Running command 'D:\work\include-what-you-use\bin\include-what-you-use.exe' with following arguments: -I "D:\work\HiddenLands\src\trunk\external\SDL\" -I "D:\work\HiddenLands\src\trunk\project\external\SDL" -I "D:\work\HiddenLands\src\trunk\project\h" -I "D:\work\HiddenLands\src\trunk\project\external\SDL_image" -I "D:\work\HiddenLands\src\trunk\project\external\SDL_mixer" -I "D:\work\HiddenLands\src\trunk\project\external\SDL_ttf" -I "D:\work\HiddenLands\src\trunk\project\e" -I "D:\work\HiddenLands\src\trunk\project\external\libcurl\include" -I "D:\work\HiddenLands\src\trunk\project\h\h\framework" -I "D:\work\HiddenLands\src\trunk\project\h\h\framework\Core" -I "D:\work\HiddenLands\src\trunk\project\h\h\framework\Utils" -I "D:\work\HiddenLands\src\trunk\project\h\h\framework\Geom" -I "D:\work\HiddenLands\src\trunk\project\h\h\framework\Gfx" -I "D:\Work\Atlantis_mobile\MemoryManager" -I "D:\Work\Atlantis_mobile\MemoryManager" -I "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" -I "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include" -I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt" -I "C:\Program Files (x86)\Windows Kits\8.1\Include\um" -I "C:\Program Files (x86)\Windows Kits\8.1\Include\shared" -I "C:\Program Files (x86)\Windows Kits\8.1\Include\winrt" -I "D:\Work\Atlantis_mobile\MemoryManager" -I "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" -I "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include" -I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt" -I "C:\Program Files (x86)\Windows Kits\8.1\Include\um" -I "C:\Program Files (x86)\Windows Kits\8.1\Include\shared" -I "C:\Program Files (x86)\Windows Kits\8.1\Include\winrt" -DWIN32 -DHIDDEN_LAND -DM3_GAME -D_DEBUG -D_CONSOLE -DCHEATS_ON -DFILTER_DEBUG_PRINTF -DPRINTF_TO_DEBUG_OUTPUT_WINDOW -DNEED_TRACE_FUNCTIONAL_WINDOW -DNEED_TRACE_EVENTS_DISPATCHER -DNEED_TRACE_ORIGINAL_TUTORIAL -DNEED_TRACE_ALPHA -DNEED_TRACE_LOBBY_WINDOW -DNEED_TRACE_BOT_MESSAGES -w -Wno-invalid-token-paste -std=c++14 -fms-compatibility -fms-extensions -fdelayed-template-parsing -fmsc-version=1900 -Xiwyu --verbose=2 -Xiwyu --mapping_file="D:\work\include-what-you-use\bin\msvc.imp" -Xiwyu --mapping_file="D:\work\include-what-you-use\bin\stl.c.headers.imp" -Xiwyu --pch_in_code -Xiwyu --prefix_header_includes=add -Xiwyu --max_line_length=1024 "D:\work\HiddenLands\src\trunk\project\e\e\GUI.h"
error: no such file or directory: 'Files'
error: no such file or directory: '(x86)\Microsoft' error: no such file or directory: 'Visual' error: no such file or directory: 'Studio' error: no such file or directory: '14.0\VC\include -I C:\Program' error: no such file or directory: 'Files' error: no such file or directory: '(x86)\Microsoft' error: no such file or directory: 'Visual' error: no such file or directory: 'Studio' error: no such file or directory: '14.0\VC\atlmfc\include -I C:\Program' error: no such file or directory: 'Files' error: no such file or directory: '(x86)\Windows' error: no such file or directory: 'Kits\10\Include\10.0.10240.0\ucrt -I C:\Program' error: no such file or directory: 'Files' error: no such file or directory: '(x86)\Windows' error: no such file or directory: 'Kits\8.1\Include\um -I C:\Program' error: no such file or directory: 'Files' error: no such file or directory: '(x86)\Windows' error: no such file or directory: 'Kits\8.1\Include\shared -I C:\Program' error: no such file or directory: 'Files' error: no such file or directory: '(x86)\Windows' error: no such file or directory: 'Kits\8.1\Include\winrt -I D:\Work\Atlantis_mobile\MemoryManager -I C:\Program' error: no such file or directory: 'Files' error: no such file or directory: '(x86)\Microsoft' error: no such file or directory: 'Visual' error: no such file or directory: 'Studio' error: no such file or directory: '14.0\VC\include -I C:\Program' error: no such file or directory: 'Files' error: no such file or directory: '(x86)\Microsoft' error: no such file or directory: 'Visual' error: no such file or directory: 'Studio' error: no such file or directory: '14.0\VC\atlmfc\include -I C:\Program' error: no such file or directory: 'Files' error: no such file or directory: '(x86)\Windows' error: no such file or directory: 'Kits\10\Include\10.0.10240.0\ucrt -I C:\Program' error: no such file or directory: 'Files' error: no such file or directory: '(x86)\Windows' error: no such file or directory: 'Kits\8.1\Include\um -I C:\Program' error: no such file or directory: 'Files' error: no such file or directory: '(x86)\Windows' error: no such file or directory: 'Kits\8.1\Include\shared -I C:\Program' error: no such file or directory: 'Files' error: no such file or directory: '(x86)\Windows' error: no such file or directory: 'Kits\8.1\Include\winrt -DWIN32 -DHIDDEN_LAND -DM3_GAME -D_DEBUG -D_CONSOLE -DCHEATS_ON -DFILTER_DEBUG_PRINTF -DPRINTF_TO_DEBUG_OUTPUT_WINDOW -DNEED_TRACE_FUNCTIONAL_WINDOW -DNEED_TRACE_EVENTS_DISPATCHER -DNEED_TRACE_ORIGINAL_TUTORIAL -DNEED_TRACE_ALPHA -DNEED_TRACE_LOBBY_WINDOW -DNEED_TRACE_BOT_MESSAGES -w -Wno-invalid-token-paste -std=c++14 -fms-compatibility -fms-extensions -fdelayed-template-parsing -fmsc-version=1900 -Xiwyu --verbose=2 -Xiwyu --mapping_file=D:\work\include-what-you-use\bin\msvc.imp -Xiwyu --mapping_file=D:\work\include-what-you-use\bin\stl.c.headers.imp -Xiwyu --pch_in_code -Xiwyu --prefix_header_includes=add -Xiwyu --max_line_length=1024 D:\work\HiddenLands\src\trunk\project\e\e\GUI.h' error: no input files error: unable to handle compilation, expected exactly one compiler job in ''