cppinsights icon indicating copy to clipboard operation
cppinsights copied to clipboard

Add the ability to use windows headers for insights

Open chuggafan opened this issue 6 years ago • 8 comments

While yes I know the rules about windows headers and open source projects, being able to see insights for windows headers on certain things would be a great way to see how clang treats them and get a deeper understanding of how they're processed (since the headers are so different)

chuggafan avatar Apr 09 '19 14:04 chuggafan

Hello @chuggafan,

that is an interesting request. Any suggestion how to achieve it?

Andreas

andreasfertig avatar Apr 09 '19 18:04 andreasfertig

The main (and easiest way) would probably be running this project on windows, a different method would depend on how much clang supports compiling for windows on linux. The way to do this would essentially be take all the headers from Visual C++ Build Tools, copying them to a directory, and then compile against that (but not linking). https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017 should be available somewhere in that link...

chuggafan avatar Apr 09 '19 22:04 chuggafan

Thanks for contributing to this issue. As it has been 60 days since the last activity waiting for a followup. This issue will be automatically closed in 7 days, if no further activity occurs. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please respond before the issue is closed. We'll gladly take a look again! In any case, thank you for your contributions!

stale[bot] avatar Jun 08 '19 22:06 stale[bot]

I do believe my previous post went over a pretty good idea on how to do it, another way specifically would be to make docker containers with Visual Studio C++ already installed and then have the customized clang run on that...

chuggafan avatar Jun 08 '19 23:06 chuggafan

Hello @chuggafan,

messing with the headers is in my experience a bad idea. It is already troublesome to switch between Linux version with a pre-compiled C++ Insights binary. Hosting it on Windows it outside of my comfort zone. I've never heard about a Windows Docker container. However, this would require a Windows license for an unknown number of users. Thinking about this a Docker image using wine with Visual C++ and a Windows compiled C++ Insights could be an option. I do not have a Windows computer, if you like to add windows compile support to C++ Insights that would be a great step into a Windows direction.

Andreas

andreasfertig avatar Jun 10 '19 20:06 andreasfertig

I can look into testing it with what clang normally does on windows soon enough, I generally dislike working with the clang buildsystem unfortunately. Also unfortunately, I've looked into the windows official docker for servercore: https://hub.docker.com/_/microsoft-windows-servercore the license explicitly states you need to be running windows to run it. It may overall just be better to mess around with doing MINGW or WINE in your case if doing a windows server -> docker hosting for all setup is untenable or costs too much for you.

chuggafan avatar Jun 11 '19 12:06 chuggafan

Thanks to the work of @grishavanika there is now support for building C++ Insights on Windows. I managed to setup an AppVeyor build yesterday (#196 ). The AppVeyor build uses the kindly provided pre-compiled LLVM/Clang version from ziglan. If they stop providing images of newer Clang versions the Windows support will not work any longer. With that there is at least a base. However, as I currently not near a Windows computer I have not tested whether the executable is working. To get that thing to the web-site there are a couple of things to do:

  • [x] Add Windows build support.
  • [ ] Test if Windows executable works.
  • [ ] Automatic deployment of Windows executable to the C++ Insights web-server.
  • [ ] Setup a Wine Docker.
  • [ ] Add at least the Windows header to the Wine Docker and install the C++ Insights executable.
  • [ ] Add OS selection support to the C++ Insights web front-end.
  • [ ] Check that it is fine from a legal perspective to run Wine with Windows headers for everybody.

As I'm more the Linux/macOS user, anyone please feel free to jump in!

Andreas

andreasfertig avatar Jun 21 '19 08:06 andreasfertig

I never made progress with Windows support. I recently removed one of the Windows builds due to a compiler regression. I see Windows support as unreliable, which will cost me too much effort. I will leave this request open for a couple more days in case one wants to jump on and progress with, for example, the Wine setup.

andreasfertig avatar Jul 18 '22 14:07 andreasfertig