Giter VIP home page Giter VIP logo

Comments (13)

Wumpf avatar Wumpf commented on June 8, 2024

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?

from includetoolbox.

salos1982 avatar salos1982 commented on June 8, 2024

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.

from includetoolbox.

Wumpf avatar Wumpf commented on June 8, 2024

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"

from includetoolbox.

salos1982 avatar salos1982 commented on June 8, 2024

Yes I tried to run command line. and I got the same error. May be end of line is not correct.

from includetoolbox.

wardlawp avatar wardlawp commented on June 8, 2024

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'

from includetoolbox.

wardlawp avatar wardlawp commented on June 8, 2024

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/

from includetoolbox.

wardlawp avatar wardlawp commented on June 8, 2024

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.

from includetoolbox.

wardlawp avatar wardlawp commented on June 8, 2024

I think the problem is process.StartInfo.Arguments in IncludeWhatYouUse.cs gets truncated. Could we call the process using a different .Net API?

from includetoolbox.

Wumpf avatar Wumpf commented on June 8, 2024

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.

from includetoolbox.

wardlawp avatar wardlawp commented on June 8, 2024

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.

from includetoolbox.

Wumpf avatar Wumpf commented on June 8, 2024

Hm yeah the input isn't even close to that size. I checked though by now, IWYU does support response files just like clang.

from includetoolbox.

danafortyfour avatar danafortyfour commented on June 8, 2024

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

from includetoolbox.

codingdave avatar codingdave commented on June 8, 2024

Please check my commit for fixing this issue. At least on my side the issue is fixed with using support files.

from includetoolbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.