--
You received this message because you are subscribed to the Google Groups "build" group.
To unsubscribe from this group and stop receiving emails from it, send an email to build+un...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/build/CADRnnSXWWqOcuNJUK-%3DdkFrdZFOge%2BMHwBDTsXs4yeFM%2BD-bbw%40mail.gmail.com.
Hi,there's some very recent activity talking about include-cleaner over at https://issues.chromium.org/issues/40248422 . Maybe ask there, you might get a better reply there :)NicoOn Wed, Apr 24, 2024 at 10:11 AM 'Florent Castelli' via build <bu...@chromium.org> wrote:Hi,As part of an effort to improve the code quality in the WebRTC library, we're currently experimenting with clang-include-cleaner to sort out which headers should be added, which should be removed and fix any surfacing layering violations.This led me to discover how the tool is figuring out which compilation flags are used for each input. While CC files are fine since there is a matching command line in the compile compile_commands.json file, headers are a bit problematic. The tool attempts to identify a related file and use its flags, which works quite often (especially when the header is paired with a .cc file), but fails in some situations (we provide header-only mocks using gmock, so it needs to depend on a special target for the right include path).Some workarounds exist around this such as adding headers to the compilation database with a tool called compdb (which is having specific issues too). I think we can do better and have that functionality integrated directly in GN since it has all the required information.
I think it would be interesting to see if we can generate rules to create pch files out of our headers automatically from executable, static_library or source_set rules automatically (possibly guarded by a GN setting), and those rules would not necessarily be built by default by Ninja either, merely used for other tooling relying on compilation databases.
Do you think that would be the right way forward?
Do you think we could come up with a solution that is transparent with the current toolchain definitions in GN?Would anyone be interested in this project and willing to guide me to achieve this?
----Any feedback is interesting!/Florent
You received this message because you are subscribed to the Google Groups "build" group.
To unsubscribe from this group and stop receiving emails from it, send an email to build+un...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/build/CADRnnSXWWqOcuNJUK-%3DdkFrdZFOge%2BMHwBDTsXs4yeFM%2BD-bbw%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "build" group.
To unsubscribe from this group and stop receiving emails from it, send an email to build+un...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/build/CADZ1XiaE1OepU9mBU1mKnETnQT28f1m_Ahwrq9npSSpYNPZa5Q%40mail.gmail.com.
Hi,On Wed, Apr 24, 2024 at 11:30 PM Nico Weber <tha...@chromium.org> wrote:Hi,there's some very recent activity talking about include-cleaner over at https://issues.chromium.org/issues/40248422 . Maybe ask there, you might get a better reply there :)NicoOn Wed, Apr 24, 2024 at 10:11 AM 'Florent Castelli' via build <bu...@chromium.org> wrote:Hi,As part of an effort to improve the code quality in the WebRTC library, we're currently experimenting with clang-include-cleaner to sort out which headers should be added, which should be removed and fix any surfacing layering violations.This led me to discover how the tool is figuring out which compilation flags are used for each input. While CC files are fine since there is a matching command line in the compile compile_commands.json file, headers are a bit problematic. The tool attempts to identify a related file and use its flags, which works quite often (especially when the header is paired with a .cc file), but fails in some situations (we provide header-only mocks using gmock, so it needs to depend on a special target for the right include path).Some workarounds exist around this such as adding headers to the compilation database with a tool called compdb (which is having specific issues too). I think we can do better and have that functionality integrated directly in GN since it has all the required information.Thanks, I didn't know about compdb. But can we also know what kind of issues does that have?I think it would be interesting to see if we can generate rules to create pch files out of our headers automatically from executable, static_library or source_set rules automatically (possibly guarded by a GN setting), and those rules would not necessarily be built by default by Ninja either, merely used for other tooling relying on compilation databases.Why do you need to have a rule for pch instead of individual headers?Do you think that would be the right way forward?Yeah, I think it is reasonable to change GN to export compilation database entries for header files. Although it is better if clang-include-cleaner can handle #includes in header files.
Do you think we could come up with a solution that is transparent with the current toolchain definitions in GN?Would anyone be interested in this project and willing to guide me to achieve this?And I think we can do that by updating aroundI can review the CL if you send that to me.----Any feedback is interesting!/Florent
You received this message because you are subscribed to the Google Groups "build" group.
To unsubscribe from this group and stop receiving emails from it, send an email to build+un...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/build/CADRnnSXWWqOcuNJUK-%3DdkFrdZFOge%2BMHwBDTsXs4yeFM%2BD-bbw%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "build" group.
To unsubscribe from this group and stop receiving emails from it, send an email to build+un...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/build/CADZ1XiaE1OepU9mBU1mKnETnQT28f1m_Ahwrq9npSSpYNPZa5Q%40mail.gmail.com.
--Takuto IkutaSoftware Engineer in TokyoChrome Ops (chrome browser build team)
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/build/CALNjmMo0m7QOp4Dg3iM9PAanO0XKv6me2DiQdtG6gNwa8TY%3DgQ%40mail.gmail.com.
Hi,On Wed, Apr 24, 2024 at 11:30 PM Nico Weber <tha...@chromium.org> wrote:Hi,there's some very recent activity talking about include-cleaner over at https://issues.chromium.org/issues/40248422 . Maybe ask there, you might get a better reply there :)NicoOn Wed, Apr 24, 2024 at 10:11 AM 'Florent Castelli' via build <bu...@chromium.org> wrote:Hi,As part of an effort to improve the code quality in the WebRTC library, we're currently experimenting with clang-include-cleaner to sort out which headers should be added, which should be removed and fix any surfacing layering violations.This led me to discover how the tool is figuring out which compilation flags are used for each input. While CC files are fine since there is a matching command line in the compile compile_commands.json file, headers are a bit problematic. The tool attempts to identify a related file and use its flags, which works quite often (especially when the header is paired with a .cc file), but fails in some situations (we provide header-only mocks using gmock, so it needs to depend on a special target for the right include path).Some workarounds exist around this such as adding headers to the compilation database with a tool called compdb (which is having specific issues too). I think we can do better and have that functionality integrated directly in GN since it has all the required information.Thanks, I didn't know about compdb. But can we also know what kind of issues does that have?
I think it would be interesting to see if we can generate rules to create pch files out of our headers automatically from executable, static_library or source_set rules automatically (possibly guarded by a GN setting), and those rules would not necessarily be built by default by Ninja either, merely used for other tooling relying on compilation databases.Why do you need to have a rule for pch instead of individual headers?
Do you think that would be the right way forward?Yeah, I think it is reasonable to change GN to export compilation database entries for header files. Although it is better if clang-include-cleaner can handle #includes in header files.
Do you think we could come up with a solution that is transparent with the current toolchain definitions in GN?Would anyone be interested in this project and willing to guide me to achieve this?And I think we can do that by updating around