Re: Pull request 799 in include-what-you-use: build + ci GitHub action

0 views
Skip to first unread message

notifi...@include-what-you-use.org

unread,
Nov 30, 2021, 3:19:08 PM11/30/21
to include-wh...@googlegroups.com
Comment #19 on pull request 799 by kimgr: build + ci GitHub action
https://github.com/include-what-you-use/include-what-you-use/pull/799

> My personal opinion is that the burden of getting source builds working for some arbitrary end
> user is substantially alleviated if there was a github ci that built iwyu and ran it through a small
> number of regression tests.

There is. Or you mean for Windows specifically? Yeah, it would be nice to get a Windows CI in place, though I'm not sure what the story is for packages on Windows these days.

When I used Windows many moons ago, I found it impressively straightforward to build Clang/LLVM (and eventually IWYU) there, it just took a long time. Compared to other open source projects on Windows, it really was a breeze. Maybe other projects are even better these days with better tooling?

I'd rather not talk about the IWYU project providing binaries, because I don't think that's sustainable. I would love to discuss:

* concrete pain points/difficulties in building on Windows
* how to set up a Windows CI
* how to kick-start and support packaging for Windows separately from the IWYU project


notifi...@include-what-you-use.org

unread,
Nov 30, 2021, 3:42:19 PM11/30/21
to include-wh...@googlegroups.com
Comment #20 on pull request 799 by aminya: build + ci GitHub action
https://github.com/include-what-you-use/include-what-you-use/pull/799

I decided to fork this project and provide the binaries. If you do not want to do it, I will take responsibility.

However, I tried to build the windows version of include-what-you-use for a couple of weeks. But it is incredibly hard to do it. I will probably make another round of attacks, but not sure if this is possible.
https://github.com/aminya/include-what-you-use-bin/tree/clang_12

Here is the list of jobs I tried
https://github.com/aminya/include-what-you-use-bin/actions


notifi...@include-what-you-use.org

unread,
Nov 30, 2021, 3:45:33 PM11/30/21
to include-wh...@googlegroups.com
Comment #21 on pull request 799 by aminya: build + ci GitHub action
https://github.com/include-what-you-use/include-what-you-use/pull/799

I decided to fork this project and provide the binaries. If you do not want to do it, I will take responsibility.

However, I tried to build the windows version of include-what-you-use for a couple of weeks. But it is incredibly hard to do it. I will probably make another round of attacks, but not sure if this is possible. It is not clear, what project structure `find_package(CLANG)` expects. Should it be an llvm-project structure, an llvm structure, or a clang sub-folder structure?

notifi...@include-what-you-use.org

unread,
Nov 30, 2021, 3:47:49 PM11/30/21
to include-wh...@googlegroups.com
Comment #21 on pull request 799 by aminya: build + ci GitHub action
https://github.com/include-what-you-use/include-what-you-use/pull/799

I decided to fork this project and provide the binaries. If you do not want to do it, I will take responsibility.

The build for Linux and MacOS was not that hard. However, I tried to build the windows version of include-what-you-use for a couple of weeks. But it is incredibly hard to do it. I will probably make another round of attacks, but not sure if this is possible. It is not clear, what project structure `find_package(CLANG)` expects. Should it be an llvm-project structure, an llvm structure, or a clang sub-folder structure?

notifi...@include-what-you-use.org

unread,
Nov 30, 2021, 3:48:28 PM11/30/21
to include-wh...@googlegroups.com
Comment #21 on pull request 799 by aminya: build + ci GitHub action
https://github.com/include-what-you-use/include-what-you-use/pull/799

I decided to fork this project and provide the binaries. If you do not want to do it, I will take responsibility.

The build for Linux and MacOS was not that hard. However, I tried to build the windows version of include-what-you-use for a couple of weeks. But it is incredibly hard to do it. I will probably make another round of attacks, but not sure if this is possible. It is not clear, what project structure `find_package(CLANG)` expects. Should it be an llvm-project structure, an llvm release structure, or a clang sub-folder structure?

notifi...@include-what-you-use.org

unread,
Nov 30, 2021, 3:54:38 PM11/30/21
to include-wh...@googlegroups.com
Comment #21 on pull request 799 by kimgr: build + ci GitHub action
https://github.com/include-what-you-use/include-what-you-use/pull/799

@aminya Thanks for taking it on!

`find_package(CLANG)` expects a clang install tree rooted in `CMAKE_PREFIX_PATH`. So on Debian-like systems after installing the packages from https://apt.llvm.org/, the directory tree starts in `/usr/lib/llvm-14` (or whatever version suffix), and that tree contains headers, libraries and CMake modules for the LLVM/Clang distribution.

Incidentally, that installed tree has the same structure as the build tree for LLVM/Clang, so if you build it locally from source in `~/llvm/out`, you can use the build root as your prefix path:
```
include-what-you-use/build$ cmake -DCMAKE_PREFIX_PATH=/usr/lib/llvm-14 ..
```
or
```
include-what-you-use/build$ cmake -DCMAKE_PREFIX_PATH=~/llvm/out ..
```
should both be viable (assuming all the right projects have been built in `~/llvm/out`).

So it looks like your CI downloads LLVM source. But what you actually want is a packaged LLVM. I don't know if that exists for Windows. The alternative is to start from LLVM source, then build all of LLVM+Clang and then configure IWYU against the build tree, as described above.


Reply all
Reply to author
Forward
0 new messages