Skip to content

add ccache support for custom toolchain#180737

Merged
auto-submit[bot] merged 2 commits into
flutter:masterfrom
planetmarshall:ccache-for-custom-toolchain
Jan 30, 2026
Merged

add ccache support for custom toolchain#180737
auto-submit[bot] merged 2 commits into
flutter:masterfrom
planetmarshall:ccache-for-custom-toolchain

Conversation

@planetmarshall

Copy link
Copy Markdown
Contributor

Add ccache support when building the engine using a custom toolchain.

Fixes #180736

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.

@github-actions github-actions Bot added the engine flutter/engine related. See also e: labels. label Jan 9, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds ccache support for custom toolchains by introducing a compiler_prefix in the BUILD.gn file. The change is straightforward and correct. I've suggested a minor stylistic improvement to align with the GN style guide for conditional variable assignment, which makes the code slightly more concise.

Comment on lines +10 to +14
if (use_ccache) {
compiler_prefix = "ccache "
} else {
compiler_prefix = ""
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better readability and to align with the GN style guide, it's preferable to initialize the variable to a default value and then conditionally modify it, rather than using an if-else block. This avoids the unnecessary else block.

  compiler_prefix = ""
  if (use_ccache) {
    compiler_prefix = "ccache "
  }
References
  1. The GN Style Guide suggests omitting an else block when it's not needed. This can be achieved by setting a default value for a variable before an if statement that might change it. This change makes the code more concise. (link)

@gaaclarke gaaclarke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, hope this helps!

@jason-simmons jason-simmons force-pushed the ccache-for-custom-toolchain branch from ef5f0e4 to 068b329 Compare January 30, 2026 15:34
@gaaclarke gaaclarke added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 30, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Jan 30, 2026
Merged via the queue into flutter:master with commit ae0fe0d Jan 30, 2026
179 of 180 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jan 30, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 31, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 31, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 1, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 1, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 1, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Feb 2, 2026
flutter/flutter@1d9d6a9...9eafba4

2026-02-01 [email protected] Roll Skia from a8ceddc2bca0 to 4ee9eb659ae0 (1 revision) (flutter/flutter#181773)
2026-02-01 [email protected] Roll Skia from a5a535bc21a3 to a8ceddc2bca0 (1 revision) (flutter/flutter#181772)
2026-02-01 [email protected] Roll Dart SDK from cde322c518b9 to 84abc8d58ec8 (1 revision) (flutter/flutter#181767)
2026-02-01 [email protected] Roll Dart SDK from c72b3f527a07 to cde322c518b9 (1 revision) (flutter/flutter#181763)
2026-01-31 [email protected] Roll Dart SDK from 43de79f08887 to c72b3f527a07 (1 revision) (flutter/flutter#181762)
2026-01-31 [email protected] Roll Fuchsia Linux SDK from 27OsrsrKcrr2pOaqY... to nI52U4LJMrBv8G1M9... (flutter/flutter#181760)
2026-01-31 [email protected] Roll Dart SDK from a0aac59705e5 to 43de79f08887 (1 revision) (flutter/flutter#181758)
2026-01-31 [email protected] Roll Skia from b704afbcd8e7 to a5a535bc21a3 (1 revision) (flutter/flutter#181757)
2026-01-31 [email protected] Roll Dart SDK from d6f77f9098e1 to a0aac59705e5 (1 revision) (flutter/flutter#181756)
2026-01-31 [email protected] Roll Skia from 6f9511ce11ba to b704afbcd8e7 (4 revisions) (flutter/flutter#181753)
2026-01-31 [email protected] Roll Dart SDK from 0cf997832948 to d6f77f9098e1 (2 revisions) (flutter/flutter#181749)
2026-01-31 [email protected] Roll Skia from 33c00c0f3b8b to 6f9511ce11ba (1 revision) (flutter/flutter#181744)
2026-01-31 [email protected] Roll Dart SDK from be3ffc51d407 to 0cf997832948 (1 revision) (flutter/flutter#181740)
2026-01-30 [email protected] Roll Skia from b62d43b59dd6 to 33c00c0f3b8b (1 revision) (flutter/flutter#181735)
2026-01-30 [email protected] [Impeller] Fix type conversion warnings seen on Windows when Impeller GL API wrappers log arguments with function types (flutter/flutter#181734)
2026-01-30 [email protected] Update New Android API Docs (flutter/flutter#180604)
2026-01-30 [email protected] Roll Fuchsia Linux SDK from isy1ARvK-3bsvtfc-... to 27OsrsrKcrr2pOaqY... (flutter/flutter#181733)
2026-01-30 [email protected] Fix P3-to-sRGB color conversion to operate in linear light (flutter/flutter#181720)
2026-01-30 [email protected] chore: deflake Linux_mokey flutter_engine_group_performance (flutter/flutter#181624)
2026-01-30 [email protected] Roll Dart SDK from 2703fd9733ce to be3ffc51d407 (1 revision) (flutter/flutter#181729)
2026-01-30 [email protected] Ensure content-sizing resize is run on UI thread (flutter/flutter#181686)
2026-01-30 [email protected] [ Tool ] Cleanup `ResidentCompiler` initialization logic (flutter/flutter#181421)
2026-01-30 [email protected] [native assets] Split debug info into `.dsym` files (flutter/flutter#181533)
2026-01-30 [email protected] Roll Skia from 4745eb2fe837 to b62d43b59dd6 (1 revision) (flutter/flutter#181727)
2026-01-30 [email protected] add ccache support for custom toolchain (flutter/flutter#180737)
2026-01-30 [email protected] update GLFW to latest and use EGL context creation on linux (flutter/flutter#181259)
2026-01-30 [email protected] add stacktrace support when requested for host builds (flutter/flutter#181264)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
LongCatIsLooong pushed a commit to LongCatIsLooong/flutter that referenced this pull request Feb 6, 2026
Add ccache support when building the engine using a custom toolchain.

Fixes flutter#180736

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
flutter-zl pushed a commit to flutter-zl/flutter that referenced this pull request Feb 10, 2026
Add ccache support when building the engine using a custom toolchain.

Fixes flutter#180736

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
rickhohler pushed a commit to rickhohler/flutter that referenced this pull request Feb 19, 2026
Add ccache support when building the engine using a custom toolchain.

Fixes flutter#180736

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine flutter/engine related. See also e: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ccache is not supported when using custom toolchain

3 participants