allows to supply gn args that do not have their cli switches (yet), like this:
```sh
python3 ./tools/gn --gn-args 'use_default_linux_sysroot=false'
```
*List which issues are fixed by this PR. You must list at least one issue.*
https://github.com/flutter/flutter/issues/126197
*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
See skbug.com/12083, skbug.com/12303.
SkCanvas::saveLayer() calls with an SkColorFilter that affects transparent black will now fill out to the bounds of the clip before the layer, which prevents leaking internal layer allocation decisions in the final rendering.
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This fixes https://github.com/flutter/flutter/issues/85793
The script that generates the font fallback data also rolls a package to CIPD with these files and updates the DEPS to download those files from CIPD. This makes sure that these tests are hermetic.
This PR fixes font-subset to check to see if a font is a variable font
with variable font axes before additionally dropping the GSUB/GPOS/GDEF
tables. These tables were being forced dropped in all cases (even though
harfbuzz had been modified to always keep them). I made the change only
drop the tables for variable fonts to preserve the previous behavior in
the most possible cases.
This PR fixes
[#125704](https://github.com/flutter/flutter/issues/125704).
To see the bug (or verify it is fixed) in the live web examples below
you must select the font variations Fill->1 and Weight->100.
(See issue [#125704](https://github.com/flutter/flutter/issues/125704)
for more details).
The issue [#125704](https://github.com/flutter/flutter/issues/125704)
includes examples of the font-subset being used (and breaking) the
variable fonts, as well as example of the `--no-tree-shake-icons` being
used where the fonts do not break.
Additionally, I have created an additional [live
example](https://timmaffett.github.io/material_symbols_icons_showing_tree_shake_fixed/)
where this PR has been applied to font-subset and icon tree shaking is
still taking place.
(Example w/ icon tree-shaking using the broken font-subset for icon tree
shaking is found
[here](https://timmaffett.github.io/material_symbols_icons_showing_tree_shake_bug/)
).
In the example build output below note that the non-variable fonts
"CupertinoIcons.ttf" and "MaterialIcons-Regular.otf" have the same size
savings as before the change, but the variable fonts
"MaterialSymbolsSharp[FILL,GRAD,opsz,wght].ttf",
"MaterialSymbolsOutlined[FILL,GRAD,opsz,wght].ttf", and
"MaterialSymbolsRounded[FILL,GRAD,opsz,wght].ttf" now have a much more
reasonable saving of ~2% because every icon in the font is included in
the example. The previous extra ~30% savings was from having the GSUB
table removed. The 30% size savings for a tree-shaking for a case where
*every* icon is used in the example probably should have been suspect..
lol.
Output of build using fixed font-subset.exe [live fix
example](https://timmaffett.github.io/material_symbols_icons_showing_tree_shake_fixed/)
:
```console
flutter build web --release --web-renderer canvaskit --base-href "/material_symbols_icons_showing_tree_shake_fixed/"
Font asset "CupertinoIcons.ttf" was tree-shaken, reducing it from 283452 to 1236 bytes (99.6% reduction). Tree-shaking can be disabled by providing the
--no-tree-shake-icons flag when building your app.
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 10808 bytes (99.3% reduction). Tree-shaking can be disabled by providing the
--no-tree-shake-icons flag when building your app.
Font asset "MaterialSymbolsSharp[FILL,GRAD,opsz,wght].ttf" was tree-shaken, reducing it from 5848492 to 5683212 bytes (2.8% reduction). Tree-shaking can be disabled by
providing the --no-tree-shake-icons flag when building your app.
Font asset "MaterialSymbolsOutlined[FILL,GRAD,opsz,wght].ttf" was tree-shaken, reducing it from 6944756 to 6779476 bytes (2.4% reduction). Tree-shaking can be disabled
by providing the --no-tree-shake-icons flag when building your app.
Font asset "MaterialSymbolsRounded[FILL,GRAD,opsz,wght].ttf" was tree-shaken, reducing it from 9361824 to 9196544 bytes (1.8% reduction). Tree-shaking can be disabled
by providing the --no-tree-shake-icons flag when building your app.
Compiling lib\main.dart for the Web... 79.5s
```
BEFORE font-subset fix [live bug example
here](https://timmaffett.github.io/material_symbols_icons_showing_tree_shake_bug/):
```console
flutter build web --release --web-renderer canvaskit --base-href "/material_symbols_icons_showing_tree_shake_bug/"
Font asset "CupertinoIcons.ttf" was tree-shaken, reducing it from 283452 to 1236 bytes (99.6% reduction). Tree-shaking
can be disabled by providing the --no-tree-shake-icons flag when building your app.
Font asset "MaterialSymbolsSharp[FILL,GRAD,opsz,wght].ttf" was tree-shaken, reducing it from 5848492 to 4079548 bytes
(30.2% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Font asset "MaterialSymbolsOutlined[FILL,GRAD,opsz,wght].ttf" was tree-shaken, reducing it from 6944756 to 4781576 bytes(31.1% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 10808 bytes (99.3% reduction).
Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Font asset "MaterialSymbolsRounded[FILL,GRAD,opsz,wght].ttf" was tree-shaken, reducing it from 9361824 to 6397020 bytes
(31.7% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Compiling lib\main.dart for the Web... 63.8s
```
In https://github.com/flutter/flutter/issues/125361 we discovered that a
new version of clang can require updating goma in order for goma to work
properly. This PR adds a dependency on CIPD goma to the DEPS file so
that we can update it for use in local builds when needed. Since CI does
its own management of the goma client and the compiler proxy, and since
goma can only be used by Googlers, the DEPS file download is guarded
behind the `use_cipd_goma` gclient var. To use it one would update the
engine `.gclient` file to be something like:
```
~/flutter/engine/src $ cat ../.gclient
solutions = [
{
"managed": False,
"name": "src/flutter",
"url": "git@github.com:zanderso/engine.git",
"custom_deps": {},
"custom_vars": {
"use_cipd_goma": True,
},
"deps_file": "DEPS",
"safesync_url": "",
},
]
```
I'll update the wiki with these instructions after this PR lands.
Changes since last dart roll
```
1f224df52be Version 3.1.0-15.0.dev
3c284a0c95c Revert "Reland "[VM] Begin supporting Perfetto file recorder""
754aca00499 Bump github/codeql-action from 2.2.11 to 2.2.12
7c8e61104f6 Bump actions/checkout from 3.5.0 to 3.5.2
f9f1030959d (origin/base) [infra] DEPS and test dart-lang/native packages
b04b0844067 [vm/win7] Dynamically load functions for unwinding instructions.
a6ebd6fa8e9 Bump tools to 545d7e1c73ce21b8c91f638021f9d487d324a501
c4795a75508 [vm, compiler] Don't do safepoint transitions in generated code under TSAN.
2fcf9754032 Version 3.1.0-14.0.dev
393b1016292 Version 3.1.0-13.0.dev
39fc15a0b4c (origin/lkgr) [analysis_server] Add missing declaration semantic token modifier on classes/constructors
609db33dc7a Issue 51985. Quick fix to add missing pattern case to switch expression/pattern.
8fa08ae80b6 Add 'Convert to if-case statement' quick assist.
17d92f90d0b offer wildcard suggestions for destructured record fields
3149f813bbf [dartdev] Update --enable-analytics to re-enable unified analytics
eee509140dd Add dependency overrides for pkg/analyzer
3069c4f3e2b [analysis_server] Add missing "constructor" semantic token modifiers on constructor declarations
9834f87c542 [dart2js] Fix noSuchMethod override handling.
639a6f06ef9 Simplify several non-terminals to use regex-like grammar operators
f88e3bd77c5 Issue 51903. Test fixes for ParserErrorCode.VAR_AND_TYPE
f4d42303ad2 [analysis_server] Handle completion in whitespace after string values
70762f0de0e [ANTLR] Transform recursive definition of onParts to use iteration ...
453647022f6 [analysis_server] Don't fail on invalid/complex setters in LSP code completion
a565638b910 Issue 51689. Report when 'super' is used as a standalone expression, not as a receiver of an invocation.
b78d89ce0c7 Fix DynamicTypeImpl to InterfaceTypeImpl cast exception in AddTypeAnnotation, when ambiguous SetOrMapLiteral.
bd9c7a46e2b Roll zlib to 14dd4c4455602c9b71a1a89b5cafd1f4030d2e3f
18b5ecdfc99 [vm] Cleanup dead code around TypeArgumentClassFinder
9d4d48949c0 Add a top-level variable strict-inference test case
8df1b888771 [VM/Service] Create JSONBase64String class
b4aa83b0b7f [VM/Service] Rename JSONStream::AppendSerializedObject to JSONStream::AppendBytes
4cd9c9c6666 Reland "[VM] Begin supporting Perfetto file recorder"
fa3a72fa7e5 [cfe/ffi] Error on compound constructors
```
This adds a gn flag (--backtrace, --no-backtrace) that defaults to
enabling backtraces, which drives a gn variable `enable_backtrace` which
is defaulted true for debug builds.
Backtrace collection is supported on Windows, and on POSIX-like
operating systems via execinfo.h. execinfo support exists in Android,
macOS/iOS, and in glibc and uclibc on Linux. musl libc notably does not
include execinfo support, so this provides an escape hatch to build with
backtrace_stub.cc for situations in which compile time support doesn't
exist.
Proposed as an alternative to
https://github.com/flutter/engine/pull/40958 by @selfisekai.
Issue: https://github.com/flutter/flutter/issues/124285
Previously reverted in #40104, this should now be safe to reland as
the last dependency has been deleted internally.
This reverts commit 9369c1ed1f33cfdad25ebe9cb809d6b5d6941159.