Skip to content

Commit 730b297

Browse files
committed
[Tizen] Add CI related files
1 parent eab820c commit 730b297

File tree

7 files changed

+580
-0
lines changed

7 files changed

+580
-0
lines changed

.github/workflows/build-docker.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build Docker
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
builder:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: docker/setup-buildx-action@v3
11+
- uses: docker/login-action@v3
12+
with:
13+
registry: ghcr.io
14+
username: ${{ github.repository_owner }}
15+
password: ${{ secrets.GITHUB_TOKEN }}
16+
- uses: docker/build-push-action@v5
17+
with:
18+
context: ci/tizen
19+
file: ci/tizen/Dockerfile
20+
push: true
21+
tags: ghcr.io/${{ github.repository_owner }}/build-engine:latest

.github/workflows/build.yml

+313
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,313 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
container:
8+
image: ghcr.io/flutter-tizen/build-engine:latest
9+
credentials:
10+
username: ${{ github.repository_owner }}
11+
password: ${{ secrets.GITHUB_TOKEN }}
12+
13+
strategy:
14+
matrix:
15+
arch: [arm, arm64, x86]
16+
mode: [debug, release, profile]
17+
include:
18+
- arch: arm
19+
triple: arm-linux-gnueabi
20+
- arch: arm64
21+
triple: aarch64-linux-gnu
22+
- arch: x86
23+
triple: i686-linux-gnu
24+
exclude:
25+
- arch: x86
26+
mode: release
27+
- arch: x86
28+
mode: profile
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
path: flutter
34+
fetch-depth: 1
35+
36+
- uses: actions/cache@v4
37+
with:
38+
path: /tizen_tools/sysroot
39+
key: sysroot
40+
41+
- name: Install depot_tools
42+
run: |
43+
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
44+
echo "$PWD/depot_tools" >> $GITHUB_PATH
45+
export PATH="$PWD/depot_tools:$PATH"
46+
# Install ninja
47+
apt install ninja-build
48+
49+
- name: Run gclient sync
50+
run: |
51+
cd flutter
52+
gclient config --unmanaged https://github.com/flutter-tizen/flutter
53+
sed -i "s/'flutter'/'.'/g" ./.gclient
54+
gclient setdep --var=download_dart_sdk=False --var=download_android_deps=False --var=download_fuchsia_deps=False --deps-file=DEPS
55+
gclient sync -v --no-history --shallow
56+
57+
- name: Generate sysroot
58+
run: flutter/engine/src/flutter/ci/tizen/generate_sysroot.py --out /tizen_tools/sysroot
59+
60+
- name: Build
61+
run: |
62+
cd flutter
63+
# Ignore unsupported linker option.
64+
sed -i "/-Wl,--undefined-version/d" engine/src/build/config/compiler/BUILD.gn
65+
66+
engine/src/flutter/tools/gn \
67+
--target-os linux \
68+
--linux-cpu ${{ matrix.arch }} \
69+
--no-goma \
70+
--target-toolchain /tizen_tools/toolchains \
71+
--target-sysroot /tizen_tools/sysroot/${{ matrix.arch }} \
72+
--target-triple ${{ matrix.triple }} \
73+
--runtime-mode ${{ matrix.mode }} \
74+
--enable-fontconfig \
75+
--disable-desktop-embeddings \
76+
--target-dir build
77+
cd engine/src
78+
ninja -C out/build flutter_engine_library
79+
cp -f flutter/third_party/icu/flutter/icudtl.dat out/build
80+
81+
- name: Build gen_snapshot
82+
if: ${{ matrix.mode != 'debug' }}
83+
run: |
84+
cd flutter
85+
ninja -C engine/src/out/build clang_x64/gen_snapshot
86+
87+
- uses: actions/upload-artifact@v4
88+
with:
89+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}
90+
path: |
91+
flutter/engine/src/out/build/libflutter_engine.so
92+
flutter/engine/src/out/build/icudtl.dat
93+
if-no-files-found: error
94+
95+
- uses: actions/upload-artifact@v4
96+
if: ${{ github.event_name == 'push' }}
97+
with:
98+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_symbols
99+
path: flutter/engine/src/out/build/so.unstripped/libflutter_engine.so
100+
if-no-files-found: error
101+
102+
- uses: actions/upload-artifact@v4
103+
if: ${{ matrix.mode != 'debug' }}
104+
with:
105+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_linux-x64
106+
path: flutter/engine/src/out/build/clang_x64/gen_snapshot
107+
if-no-files-found: error
108+
109+
windows-build:
110+
runs-on: windows-latest
111+
112+
strategy:
113+
matrix:
114+
arch: [arm, arm64]
115+
mode: [release, profile]
116+
117+
steps:
118+
- name: Run git checkout
119+
run: |
120+
mkdir C:\workspace\flutter
121+
cd C:\workspace\flutter
122+
git config --global core.autocrlf true
123+
git init --quiet
124+
git remote add origin https://github.com/${{ github.repository }}
125+
git fetch --depth 1 origin ${{ github.sha }}
126+
git checkout FETCH_HEAD
127+
128+
- name: Environment setup
129+
run: |
130+
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -Force
131+
echo "DEPOT_TOOLS_WIN_TOOLCHAIN=0" >> $Env:GITHUB_ENV
132+
echo "GYP_MSVS_OVERRIDE_PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise" >> $Env:GITHUB_ENV
133+
echo "WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10" >> $Env:GITHUB_ENV
134+
135+
- name: Install depot_tools
136+
run: |
137+
Invoke-WebRequest -Uri https://storage.googleapis.com/chrome-infra/depot_tools.zip -OutFile depot_tools.zip
138+
7z x -y -o"C:\workspace\depot_tools" .\depot_tools.zip
139+
echo "C:\workspace\depot_tools" >> $Env:GITHUB_PATH
140+
141+
- name: Run gclient sync
142+
working-directory: C:\workspace\flutter
143+
shell: powershell
144+
run: |
145+
gclient config --unmanaged https://github.com/flutter-tizen/flutter
146+
(Get-Content ".gclient") | ForEach-Object { $_ -replace "'flutter'","'.'" } | Set-Content ".gclient"
147+
# TODO(jsuya) : pipes deprecated in python 3.13. (https://dart-review.googlesource.com/c/sdk/+/307620)
148+
(Get-Content "engine/src/build/vs_toolchain.py") | ForEach-Object { $_ -replace 'import pipes','' } | Set-Content "engine/src/build/vs_toolchain.py"
149+
gclient setdep --var=download_dart_sdk=False --var=download_android_deps=False --var=download_fuchsia_deps=False --deps-file=DEPS
150+
gclient sync -v --no-history --shallow
151+
152+
- name: Build
153+
working-directory: C:\workspace\flutter\engine\src
154+
run: |
155+
python3 .\flutter\tools\gn `
156+
--linux `
157+
--linux-cpu=${{ matrix.arch }} `
158+
--runtime-mode=${{ matrix.mode }} `
159+
--no-goma `
160+
--target-dir build
161+
# TODO(jsuya) : https://github.com/flutter/flutter/issues/163487
162+
C:\workspace\flutter\engine\src\flutter/third_party/ninja/ninja -C .\out\build gen_snapshot
163+
164+
- uses: actions/upload-artifact@v4
165+
with:
166+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_windows-x64
167+
path: C:\workspace\flutter\engine\src\out\build\gen_snapshot.exe
168+
if-no-files-found: error
169+
170+
macos-build:
171+
runs-on: macos-latest
172+
173+
strategy:
174+
matrix:
175+
arch: [arm, arm64]
176+
mode: [release, profile]
177+
178+
steps:
179+
- uses: actions/checkout@v4
180+
with:
181+
path: flutter
182+
fetch-depth: 1
183+
184+
- uses: actions/setup-python@v5
185+
with:
186+
python-version: "3.11"
187+
188+
- name: Install depot_tools
189+
run: |
190+
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
191+
echo "$PWD/depot_tools" >> $GITHUB_PATH
192+
193+
- name: Run gclient sync
194+
run: |
195+
cd flutter
196+
gclient config --unmanaged https://github.com/flutter-tizen/flutter
197+
sed -i '' "s/'flutter'/'.'/g" .gclient
198+
gclient setdep --var=download_dart_sdk=False --var=download_android_deps=False --var=download_fuchsia_deps=False --deps-file=DEPS
199+
gclient sync -v --no-history --shallow
200+
201+
- name: Build
202+
run: |
203+
cd flutter
204+
# Change host_toolchain to mac/clang_arm64.
205+
sed -i "" "s|//build/toolchain/linux:clang_$host_cpu|//build/toolchain/mac:clang_$host_cpu|g" engine/src/build/config/BUILDCONFIG.gn
206+
207+
# Pass dummy values to prevent using the default (Linux) toolchain.
208+
engine/src/flutter/tools/gn \
209+
--linux \
210+
--linux-cpu=${{ matrix.arch }} \
211+
--no-goma \
212+
--target-toolchain _ \
213+
--target-sysroot _ \
214+
--target-triple _ \
215+
--runtime-mode=${{ matrix.mode }} \
216+
--disable-desktop-embeddings \
217+
--target-dir build
218+
cd engine/src
219+
# TODO(jsuya) : https://github.com/flutter/flutter/issues/163487
220+
flutter/third_party/ninja/ninja -C out/build clang_arm64/gen_snapshot
221+
222+
- uses: actions/upload-artifact@v4
223+
with:
224+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_darwin-arm64
225+
path: flutter/engine/src/out/build/clang_arm64/gen_snapshot
226+
if-no-files-found: error
227+
228+
macos-intel-build:
229+
runs-on: macos-13
230+
231+
strategy:
232+
matrix:
233+
arch: [arm, arm64]
234+
mode: [release, profile]
235+
236+
steps:
237+
- uses: actions/checkout@v4
238+
with:
239+
path: flutter
240+
fetch-depth: 1
241+
242+
- uses: actions/setup-python@v5
243+
with:
244+
python-version: "3.11"
245+
246+
- name: Install depot_tools
247+
run: |
248+
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
249+
echo "$PWD/depot_tools" >> $GITHUB_PATH
250+
251+
- name: Run gclient sync
252+
run: |
253+
cd flutter
254+
gclient config --unmanaged https://github.com/flutter-tizen/flutter
255+
sed -i '' "s/'flutter'/'.'/g" .gclient
256+
gclient setdep --var=download_dart_sdk=False --var=download_android_deps=False --var=download_fuchsia_deps=False --deps-file=DEPS
257+
gclient sync -v --no-history --shallow
258+
259+
- name: Build
260+
run: |
261+
cd flutter
262+
# Change host_toolchain to mac/clang_x64.
263+
sed -i "" "s|//build/toolchain/linux:clang_$host_cpu|//build/toolchain/mac:clang_$host_cpu|g" engine/src/build/config/BUILDCONFIG.gn
264+
265+
# Pass dummy values to prevent using the default (Linux) toolchain.
266+
engine/src/flutter/tools/gn \
267+
--linux \
268+
--linux-cpu=${{ matrix.arch }} \
269+
--no-goma \
270+
--target-toolchain _ \
271+
--target-sysroot _ \
272+
--target-triple _ \
273+
--runtime-mode=${{ matrix.mode }} \
274+
--disable-desktop-embeddings \
275+
--target-dir build
276+
cd engine/src
277+
# TODO(jsuya) : https://github.com/flutter/flutter/issues/163487
278+
flutter/third_party/ninja/ninja -C out/build clang_x64/gen_snapshot
279+
280+
- uses: actions/upload-artifact@v4
281+
with:
282+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_darwin-x64
283+
path: flutter/engine/src/out/build/clang_x64/gen_snapshot
284+
if-no-files-found: error
285+
286+
release:
287+
needs: [build]
288+
if: ${{ github.event_name == 'push' }}
289+
runs-on: ubuntu-latest
290+
291+
steps:
292+
- uses: actions/checkout@v4
293+
294+
- uses: actions/download-artifact@v4
295+
296+
- name: Create archives
297+
run: |
298+
for name in tizen-*; do
299+
7z a $name.zip ./$name/*
300+
done
301+
302+
- name: Set variables
303+
run: |
304+
echo "SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV
305+
echo "VERSION=$(echo "${{ github.ref_name }}" | cut -d'-' -f2)" >> $GITHUB_ENV
306+
307+
- uses: softprops/action-gh-release@v2
308+
with:
309+
name: ${{ env.VERSION }} (${{ env.SHORT_SHA }})
310+
tag_name: ${{ env.SHORT_SHA }}
311+
target_commitish: ${{ github.sha }}
312+
files: tizen-*.zip
313+
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/llvm-project*/
2+
/toolchains*/
3+
/sysroot/
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
###############################
2+
### Stage for building LLVM ###
3+
###############################
4+
5+
FROM ubuntu:22.04 AS llvm
6+
7+
ENV DEBIAN_FRONTEND=noninteractive
8+
9+
RUN apt-get update && \
10+
apt-get install -y git zip build-essential cmake ninja-build clang-11 && \
11+
apt-get clean
12+
13+
COPY build_llvm.sh .
14+
15+
RUN /build_llvm.sh
16+
17+
18+
##############################
19+
### Create a release image ###
20+
##############################
21+
22+
FROM ubuntu:22.04
23+
24+
ENV DEBIAN_FRONTEND=noninteractive
25+
26+
RUN apt-get update && \
27+
apt-get install -y binutils-arm-linux-gnueabi binutils-aarch64-linux-gnu binutils-i686-linux-gnu && \
28+
apt-get install -y git curl pkg-config ca-certificates python3 python3-pip rpm2cpio cpio && \
29+
apt-get clean
30+
31+
# Copy build artifacts from the previous stage.
32+
COPY --from=llvm /toolchains/ /tizen_tools/toolchains/

engine/src/flutter/ci/tizen/arm.patch

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/usr/include/asm-arm/hwcap.h b/usr/include/asm-arm/hwcap.h
2+
index da85060..adaf619 100644
3+
--- a/usr/include/asm-arm/hwcap.h
4+
+++ b/usr/include/asm-arm/hwcap.h
5+
@@ -26,5 +26,10 @@
6+
#define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */
7+
#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
8+
9+
+#define HWCAP2_AES (1 << 0)
10+
+#define HWCAP2_PMULL (1 << 1)
11+
+#define HWCAP2_SHA1 (1 << 2)
12+
+#define HWCAP2_SHA2 (1 << 3)
13+
+#define HWCAP2_CRC32 (1 << 4)
14+
15+
#endif /* __ASMARM_HWCAP_H */

0 commit comments

Comments
 (0)