Skip to content

Clang Tidy ideally needs to run as pre-submit, but is too slow #139769

@matanlurey

Description

@matanlurey

Is there an existing issue for this?

Type of Request

feature request

Infrastructure Environment

I'm not sure (partially Goma -> RBE, but potentially other improvements as well)

What is happening?

Background

Clang Tidy is a critical component to the Flutter engine - it provides style guide enforcement, and even catches critical performance-lints (like copying expensive objects that should be moved instead in C++). As of #48145, we now run Clang Tidy on all C++ source and header files.

Problem

Clang Tidy (with the lints we've chosen to enable) is slow.

There is unfortunately a lot of complaints on the web that indicate to me it's a wide problem:

My workplace had such a debacle with clang-tidy that we had to disable it in a PR's CI...
(https://www.reddit.com/r/cpp_questions/comments/10jx0uc/clang_tidy_is_very_slow_when_using_headers_like/)

As a result, we've created a lot of complexity (and are considering more) to defer and shard Clang Tidy:

Ideas

I don't have a concrete suggestion, but I'm opening this issue to discuss one. Some ideas:

  1. Use something like ctccache
  2. Hope that the migration to RBE (and Reclient) provides adequate caching

Steps to reproduce

No response

Expected results

We can get rid of the post-submit, and always run the full set of Clang Tidy on pre-submit

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: tech-debtTechnical debt, code quality, testing, etc.fyi-engineFor the attention of Engine teamteam-infraOwned by Infrastructure team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions