Skip to content

Commit 2b6dbbf

Browse files
yamsergeyclaude
andauthored
V3.38.7 (#9)
* Update to 3.38.3 * Update to 3.38.7 - Update Flutter tag to 3.38.7 - Update NDK to 27.2.12479018 - Add Dockerfile for containerized builds - Add .dockerignore - Fix engine.patch for NDK 27 compatibility: - Add -Wno-deprecated-this-capture for spirv-cross - Enable -Wno-implicit-int-float-conversion for termux - Add --jobs parameter to build.py for parallelism control Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6fdbda3 commit 2b6dbbf

File tree

5 files changed

+251
-18
lines changed

5 files changed

+251
-18
lines changed

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Exclude flutter source directory - let container clone fresh
2+
flutter/
3+
4+
# Exclude sysroot - downloaded during build
5+
sysroot/
6+
7+
# Exclude build artifacts
8+
*.deb
9+
10+
# Git
11+
.git/

Dockerfile

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Dockerfile to replicate GitHub Actions ubuntu-latest environment
2+
# for debugging Flutter-Termux build issues
3+
4+
FROM ubuntu:24.04
5+
6+
# Avoid interactive prompts during package installation
7+
ENV DEBIAN_FRONTEND=noninteractive
8+
9+
# Install system dependencies (matching GitHub Actions workflow)
10+
RUN apt-get update && apt-get install -y \
11+
libfreetype-dev \
12+
ninja-build \
13+
git \
14+
curl \
15+
python3 \
16+
python3-pip \
17+
python3-venv \
18+
xz-utils \
19+
pkg-config \
20+
build-essential \
21+
clang \
22+
lld \
23+
unzip \
24+
openjdk-17-jdk \
25+
&& rm -rf /var/lib/apt/lists/*
26+
27+
# Setup depot_tools (matching newkdev/setup-depot-tools@v1.0.1)
28+
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /opt/depot_tools
29+
ENV PATH="/opt/depot_tools:${PATH}"
30+
31+
# Install Android SDK Command Line Tools and NDK (matching GitHub Actions environment)
32+
ENV ANDROID_HOME=/usr/local/lib/android/sdk
33+
ENV ANDROID_SDK_ROOT=${ANDROID_HOME}
34+
RUN mkdir -p ${ANDROID_HOME}/cmdline-tools && \
35+
curl -o /tmp/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip && \
36+
unzip /tmp/cmdline-tools.zip -d ${ANDROID_HOME}/cmdline-tools && \
37+
mv ${ANDROID_HOME}/cmdline-tools/cmdline-tools ${ANDROID_HOME}/cmdline-tools/latest && \
38+
rm /tmp/cmdline-tools.zip
39+
40+
ENV PATH="${ANDROID_HOME}/cmdline-tools/latest/bin:${PATH}"
41+
42+
# Install NDK version 27.2.12479018 (latest stable from Google)
43+
RUN yes | sdkmanager --licenses && \
44+
sdkmanager "ndk;27.2.12479018"
45+
46+
ENV ANDROID_NDK=${ANDROID_HOME}/ndk/27.2.12479018
47+
ENV ANDROID_NDK_HOME=${ANDROID_NDK}
48+
49+
# Create working directory
50+
WORKDIR /build
51+
52+
# Copy project files
53+
COPY . .
54+
55+
# Install Python requirements (ignore-installed to avoid conflicts with system packages)
56+
RUN pip3 install --break-system-packages --ignore-installed -r requirements.txt
57+
58+
# Set environment to avoid interactive git prompts
59+
ENV GIT_TERMINAL_PROMPT=0
60+
61+
# Default command - start interactive shell for debugging
62+
CMD ["/bin/bash"]

build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def output(self, arch: str):
198198
return self.release
199199

200200
# TODO: check gclient and ninja existence
201-
def __call__(self):
201+
def __call__(self, jobs: int = None):
202202
self.config()
203203
self.clone()
204204
self.sync()
@@ -207,7 +207,7 @@ def __call__(self):
207207
self.sysroot(arch=arch)
208208
for mode in self.mode:
209209
self.configure(arch=arch, mode=mode)
210-
self.build(arch=arch, mode=mode)
210+
self.build(arch=arch, mode=mode, jobs=jobs)
211211
self.debuild(arch=arch, output=self.output(arch))
212212

213213

build.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flutter]
2-
tag = '3.35.7'
2+
tag = '3.38.7'
33
repo = 'https://github.com/flutter/flutter'
44
path = './flutter'
55

patches/engine.patch

Lines changed: 175 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/engine/src/build/config/BUILDCONFIG.gn b/engine/src/build/config/BUILDCONFIG.gn
2-
index b74b2e2..b181c74 100644
2+
index 596fd4fef78..84ae714527c 100644
33
--- a/engine/src/build/config/BUILDCONFIG.gn
44
+++ b/engine/src/build/config/BUILDCONFIG.gn
5-
@@ -343,13 +343,13 @@ if (is_msan && !is_linux) {
5+
@@ -372,13 +372,13 @@ if (is_msan && !is_linux) {
66
# duplication in each target below.
77
_native_compiler_configs = [
88
"//build/config:feature_flags",
@@ -16,12 +16,12 @@ index b74b2e2..b181c74 100644
1616
- "//build/config/compiler:runtime_library",
1717
+ "//build/config/termux:runtime_library",
1818
]
19-
19+
2020
if (use_flutter_cxx) {
21-
@@ -377,7 +377,11 @@ if (is_posix) {
21+
@@ -406,7 +406,11 @@ if (is_posix) {
2222
]
2323
}
24-
24+
2525
-if (is_linux) {
2626
+import("//build/config/termux/termux.gni")
2727
+
@@ -31,7 +31,7 @@ index b74b2e2..b181c74 100644
3131
_native_compiler_configs += [ "//build/config/linux:sdk" ]
3232
} else if (is_mac) {
3333
_native_compiler_configs += [ "//build/config/mac:sdk" ]
34-
@@ -457,7 +461,7 @@ if (is_win) {
34+
@@ -486,7 +490,7 @@ if (is_win) {
3535
"//build/config/mac:mac_executable_flags",
3636
]
3737
} else if (is_linux || is_android) {
@@ -40,10 +40,10 @@ index b74b2e2..b181c74 100644
4040
if (is_android) {
4141
_executable_configs += [ "//build/config/android:executable_config" ]
4242
}
43-
@@ -521,7 +525,10 @@ import("//build/toolchain/custom/custom.gni")
43+
@@ -550,7 +554,10 @@ import("//build/toolchain/custom/custom.gni")
4444
# shlib_toolchain is a Fuchsia-specific symbol and not used by Flutter.
4545
shlib_toolchain = false
46-
46+
4747
-if (custom_toolchain != "") {
4848
+if (is_termux) {
4949
+ host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
@@ -52,22 +52,131 @@ index b74b2e2..b181c74 100644
5252
assert(custom_sysroot != "")
5353
assert(custom_target_triple != "")
5454
host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
55-
@@ -597,6 +604,9 @@ if (custom_toolchain != "") {
55+
@@ -629,6 +636,9 @@ if (custom_toolchain != "") {
5656
} else {
5757
assert(false, "Toolchain not set because of unknown platform.")
5858
}
5959
+if (is_termux_host) {
6060
+ host_toolchain = "//build/toolchain/termux:$host_cpu"
6161
+}
62-
62+
6363
# Sets default dependencies for executable and shared_library targets.
6464
#
65+
diff --git a/engine/src/build/config/compiler/BUILD.gn b/engine/src/build/config/compiler/BUILD.gn
66+
index 50f1b60eab1..cd1d7bcca5f 100644
67+
--- a/engine/src/build/config/compiler/BUILD.gn
68+
+++ b/engine/src/build/config/compiler/BUILD.gn
69+
@@ -19,6 +19,7 @@ import("//build/config/profiler.gni")
70+
import("//build/config/sanitizers/sanitizers.gni")
71+
import("//build/toolchain/ccache.gni")
72+
import("//build/toolchain/clang.gni")
73+
+import("//build/config/termux/termux.gni")
74+
import("//build/toolchain/toolchain.gni")
75+
import("//build/toolchain/wasm.gni")
76+
77+
@@ -228,7 +229,7 @@ config("compiler") {
78+
} else if (current_cpu == "x86") {
79+
cflags += [ "-m32" ]
80+
ldflags += [ "-m32" ]
81+
- if (is_clang) {
82+
+ if (is_clang && !is_termux) {
83+
cflags += [
84+
# Align the stack on 16-byte boundaries, http://crbug.com/418554.
85+
"-mstack-alignment=16",
86+
@@ -271,7 +272,7 @@ config("compiler") {
87+
]
88+
}
89+
} else if (is_win) {
90+
- if (is_clang) {
91+
+ if (is_clang && !is_termux) {
92+
if (current_cpu == "x86") {
93+
cflags += [ "-m32" ]
94+
} else if (current_cpu == "x64") {
95+
@@ -406,7 +407,7 @@ config("compiler") {
96+
97+
# Clang-specific compiler flags setup.
98+
# ------------------------------------
99+
- if (is_clang) {
100+
+ if (is_clang && !is_termux) {
101+
cflags += [ "-fcolor-diagnostics" ]
102+
}
103+
104+
@@ -514,7 +515,7 @@ config("cxx_version_default") {
105+
# a newer version. Targets that have explicitly opted into the newer version
106+
# must fix the errors they run into.
107+
108+
- if (is_clang) {
109+
+ if (is_clang && !is_termux) {
110+
extra_warning_flags_cc = [
111+
# TODO(174665): Third-party dependency (Angle) needs to patched to work
112+
# around this.
113+
@@ -714,7 +715,7 @@ if (is_win) {
114+
"-Wno-nonportable-system-include-path",
115+
]
116+
}
117+
- if (is_clang) {
118+
+ if (is_clang && !is_termux) {
119+
default_warning_flags += [
120+
# No support for #pragma optimize. https://crbug.com/505314#c13
121+
"-Wno-ignored-pragma-optimize",
122+
@@ -767,21 +768,21 @@ if (is_win) {
123+
"-Wno-psabi",
124+
]
125+
126+
- if (is_clang) {
127+
+ if (is_clang) {
128+
default_warning_flags += [
129+
"-Wno-implicit-int-float-conversion",
130+
"-Wno-deprecated-copy",
131+
]
132+
}
133+
134+
- if (!is_android && is_clang) {
135+
+ if (!is_android && is_clang && !is_termux) {
136+
default_warning_flags += [
137+
# Needed for nlohmann/json.
138+
"-Wno-deprecated-literal-operator",
139+
]
140+
}
141+
142+
- if (!is_wasm && is_clang) {
143+
+ if (!is_wasm && is_clang && !is_termux) {
144+
default_warning_flags += [
145+
# Unqualified std::move is pretty common.
146+
"-Wno-unqualified-std-cast-call",
147+
@@ -867,7 +868,7 @@ config("no_chromium_code") {
148+
cflags += [ "-Wno-deprecated-non-prototype" ]
149+
}
150+
151+
- if (is_clang) {
152+
+ if (is_clang && !is_termux) {
153+
cflags += [
154+
"-Wno-newline-eof",
155+
"-Wno-typedef-redefinition",
156+
@@ -902,7 +903,7 @@ config("enable_exceptions") {
157+
if (is_win) {
158+
cflags_cc = [ "/EHsc" ]
159+
defines = [ "_HAS_EXCEPTIONS=1" ]
160+
- } else if (is_clang) {
161+
+ } else if (is_clang && !is_termux) {
162+
cflags_cc = [ "-fexceptions" ]
163+
}
164+
}
165+
@@ -1143,7 +1144,7 @@ config("no_symbols") {
166+
# To enable in a GN target, use:
167+
# configs += [ "//build/config/compiler:prevent_unsafe_narrowing" ]
168+
config("prevent_unsafe_narrowing") {
169+
- if (is_clang) {
170+
+ if (is_clang && !is_termux) {
171+
cflags = [
172+
"-Wshorten-64-to-32",
173+
"-Wimplicit-int-conversion",
65174
diff --git a/engine/src/build/config/sysroot.gni b/engine/src/build/config/sysroot.gni
66-
index 5f7e48a..0f9c2e3 100644
175+
index 12c8df99f44..5e87f79075c 100644
67176
--- a/engine/src/build/config/sysroot.gni
68177
+++ b/engine/src/build/config/sysroot.gni
69178
@@ -17,6 +17,8 @@ declare_args() {
70-
179+
71180
if (current_toolchain == default_toolchain && target_sysroot != "") {
72181
sysroot = target_sysroot
73182
+} else if (is_termux && custom_sysroot != "") {
@@ -226,7 +335,7 @@ index 0000000..8208b13
226335
+ "-stdlib=libstdc++",
227336
+ "-Wl,--warn-shared-textrel"
228337
+ ]
229-
+ lib_dirs = [ "$custom_toolchain/lib/clang/19/lib/linux/" ]
338+
+ lib_dirs = [ "$custom_toolchain/lib/clang/18/lib/linux/" ]
230339
+ include_dirs = [
231340
+ "//flutter/third_party/libcxx/include",
232341
+ "//flutter/third_party/libcxxabi/include",
@@ -322,7 +431,7 @@ index 0000000..564c582
322431
+ toolchain_cpu = "x86"
323432
+}
324433
diff --git a/engine/src/flutter/shell/testing/BUILD.gn b/engine/src/flutter/shell/testing/BUILD.gn
325-
index 28a19c7..5c3992b 100644
434+
index 28a19c75d1b..5c3992b31f8 100644
326435
--- a/engine/src/flutter/shell/testing/BUILD.gn
327436
+++ b/engine/src/flutter/shell/testing/BUILD.gn
328437
@@ -56,6 +56,10 @@ executable("testing") {
@@ -334,5 +443,56 @@ index 28a19c7..5c3992b 100644
334443
+ deps -= [ "//flutter/third_party/swiftshader/src/Vulkan:swiftshader_libvulkan_static" ]
335444
+ }
336445
}
337-
446+
338447
metadata = {
448+
diff --git a/engine/src/flutter/build/secondary/third_party/inja/BUILD.gn b/engine/src/flutter/build/secondary/third_party/inja/BUILD.gn
449+
--- a/engine/src/flutter/build/secondary/third_party/inja/BUILD.gn
450+
+++ b/engine/src/flutter/build/secondary/third_party/inja/BUILD.gn
451+
@@ -11,6 +11,7 @@ config("inja_public_config") {
452+
if (is_clang) {
453+
cflags_cc = [
454+
"-Wno-unused-variable",
455+
"-Wno-newline-eof",
456+
+ "-Wno-deprecated-literal-operator",
457+
]
458+
}
459+
460+
diff --git a/engine/src/flutter/third_party/vulkan-deps/spirv-cross/src/gn/BUILD.gn b/engine/src/flutter/third_party/vulkan-deps/spirv-cross/src/gn/BUILD.gn
461+
--- a/engine/src/flutter/third_party/vulkan-deps/spirv-cross/src/gn/BUILD.gn
462+
+++ b/engine/src/flutter/third_party/vulkan-deps/spirv-cross/src/gn/BUILD.gn
463+
@@ -63,6 +63,7 @@ source_set("spirv_cross_sources") {
464+
"-Wno-newline-eof",
465+
"-Wno-sign-compare",
466+
"-Wno-unused-variable",
467+
+ "-Wno-deprecated-this-capture",
468+
]
469+
}
470+
}
471+
diff --git a/engine/src/flutter/build/secondary/third_party/spirv_cross_flutter/BUILD.gn b/engine/src/flutter/build/secondary/third_party/spirv_cross_flutter/BUILD.gn
472+
--- a/engine/src/flutter/build/secondary/third_party/spirv_cross_flutter/BUILD.gn
473+
+++ b/engine/src/flutter/build/secondary/third_party/spirv_cross_flutter/BUILD.gn
474+
@@ -13,5 +13,23 @@
475+
source_set("spirv_cross_flutter") {
476+
public_configs = [ ":spirv_cross_public" ]
477+
478+
+ if (!is_win) {
479+
+ cflags = [ "-fno-exceptions" ]
480+
+ }
481+
+
482+
+ if (is_clang) {
483+
+ cflags_cc = [
484+
+ "-Wno-extra-semi",
485+
+ "-Wno-ignored-qualifiers",
486+
+ "-Wno-implicit-fallthrough",
487+
+ "-Wno-inconsistent-missing-override",
488+
+ "-Wno-missing-field-initializers",
489+
+ "-Wno-newline-eof",
490+
+ "-Wno-sign-compare",
491+
+ "-Wno-unused-variable",
492+
+ "-Wno-deprecated-this-capture",
493+
+ ]
494+
+ }
495+
+
496+
sources = [
497+
"$source_root/GLSL.std.450.h",
498+

0 commit comments

Comments
 (0)