Skip to content

Commit d6f9eab

Browse files
committed
[Tizen] Add CI related files
1 parent 57b232f commit d6f9eab

File tree

7 files changed

+578
-0
lines changed

7 files changed

+578
-0
lines changed

.github/workflows/build-docker.yml

Lines changed: 21 additions & 0 deletions
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

Lines changed: 311 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,311 @@
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/jsuya/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/jsuya/flutter
146+
cat .gclient | %{$_ -replace "'flutter'","'.'"}
147+
gclient setdep --var=download_dart_sdk=False --var=download_android_deps=False --var=download_fuchsia_deps=False --deps-file=DEPS
148+
gclient sync -v --no-history --shallow
149+
150+
- name: Build
151+
working-directory: C:\workspace\flutter\engine\src
152+
run: |
153+
python3 .\flutter\tools\gn `
154+
--linux `
155+
--linux-cpu=${{ matrix.arch }} `
156+
--runtime-mode=${{ matrix.mode }} `
157+
--no-goma `
158+
--target-dir build
159+
# TODO(jsuya) : https://github.com/flutter/flutter/issues/163487
160+
C:\workspace\flutter\engine\src\flutter/third_party/ninja/ninja -C .\out\build gen_snapshot
161+
162+
- uses: actions/upload-artifact@v4
163+
with:
164+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_windows-x64
165+
path: C:\workspace\flutter\engine\src\out\build\gen_snapshot.exe
166+
if-no-files-found: error
167+
168+
macos-build:
169+
runs-on: macos-latest
170+
171+
strategy:
172+
matrix:
173+
arch: [arm, arm64]
174+
mode: [release, profile]
175+
176+
steps:
177+
- uses: actions/checkout@v4
178+
with:
179+
path: flutter
180+
fetch-depth: 1
181+
182+
- uses: actions/setup-python@v5
183+
with:
184+
python-version: "3.11"
185+
186+
- name: Install depot_tools
187+
run: |
188+
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
189+
echo "$PWD/depot_tools" >> $GITHUB_PATH
190+
191+
- name: Run gclient sync
192+
run: |
193+
cd flutter
194+
gclient config --unmanaged https://github.com/jsuya/flutter
195+
sed -i '' "s/'flutter'/'.'/g" .gclient
196+
gclient setdep --var=download_dart_sdk=False --var=download_android_deps=False --var=download_fuchsia_deps=False --deps-file=DEPS
197+
gclient sync -v --no-history --shallow
198+
199+
- name: Build
200+
run: |
201+
cd flutter
202+
# Change host_toolchain to mac/clang_arm64.
203+
sed -i "" "s|//build/toolchain/linux:clang_$host_cpu|//build/toolchain/mac:clang_$host_cpu|g" engine/src/build/config/BUILDCONFIG.gn
204+
205+
# Pass dummy values to prevent using the default (Linux) toolchain.
206+
engine/src/flutter/tools/gn \
207+
--linux \
208+
--linux-cpu=${{ matrix.arch }} \
209+
--no-goma \
210+
--target-toolchain _ \
211+
--target-sysroot _ \
212+
--target-triple _ \
213+
--runtime-mode=${{ matrix.mode }} \
214+
--disable-desktop-embeddings \
215+
--target-dir build
216+
cd engine/src
217+
# TODO(jsuya) : https://github.com/flutter/flutter/issues/163487
218+
flutter/third_party/ninja/ninja -C out/build clang_arm64/gen_snapshot
219+
220+
- uses: actions/upload-artifact@v4
221+
with:
222+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_darwin-arm64
223+
path: flutter/engine/src/out/build/clang_arm64/gen_snapshot
224+
if-no-files-found: error
225+
226+
macos-intel-build:
227+
runs-on: macos-13
228+
229+
strategy:
230+
matrix:
231+
arch: [arm, arm64]
232+
mode: [release, profile]
233+
234+
steps:
235+
- uses: actions/checkout@v4
236+
with:
237+
path: flutter
238+
fetch-depth: 1
239+
240+
- uses: actions/setup-python@v5
241+
with:
242+
python-version: "3.11"
243+
244+
- name: Install depot_tools
245+
run: |
246+
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
247+
echo "$PWD/depot_tools" >> $GITHUB_PATH
248+
249+
- name: Run gclient sync
250+
run: |
251+
cd flutter
252+
gclient config --unmanaged https://github.com/jsuya/flutter
253+
sed -i '' "s/'flutter'/'.'/g" .gclient
254+
gclient setdep --var=download_dart_sdk=False --var=download_android_deps=False --var=download_fuchsia_deps=False --deps-file=DEPS
255+
gclient sync -v --no-history --shallow
256+
257+
- name: Build
258+
run: |
259+
cd flutter
260+
# Change host_toolchain to mac/clang_x64.
261+
sed -i "" "s|//build/toolchain/linux:clang_$host_cpu|//build/toolchain/mac:clang_$host_cpu|g" engine/src/build/config/BUILDCONFIG.gn
262+
263+
# Pass dummy values to prevent using the default (Linux) toolchain.
264+
engine/src/flutter/tools/gn \
265+
--linux \
266+
--linux-cpu=${{ matrix.arch }} \
267+
--no-goma \
268+
--target-toolchain _ \
269+
--target-sysroot _ \
270+
--target-triple _ \
271+
--runtime-mode=${{ matrix.mode }} \
272+
--disable-desktop-embeddings \
273+
--target-dir build
274+
cd engine/src
275+
# TODO(jsuya) : https://github.com/flutter/flutter/issues/163487
276+
flutter/third_party/ninja/ninja -C out/build clang_x64/gen_snapshot
277+
278+
- uses: actions/upload-artifact@v4
279+
with:
280+
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_darwin-x64
281+
path: flutter/engine/src/out/build/clang_x64/gen_snapshot
282+
if-no-files-found: error
283+
284+
release:
285+
needs: [build]
286+
if: ${{ github.event_name == 'push' }}
287+
runs-on: ubuntu-latest
288+
289+
steps:
290+
- uses: actions/checkout@v4
291+
292+
- uses: actions/download-artifact@v4
293+
294+
- name: Create archives
295+
run: |
296+
for name in tizen-*; do
297+
7z a $name.zip ./$name/*
298+
done
299+
300+
- name: Set variables
301+
run: |
302+
echo "SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV
303+
echo "VERSION=$(echo "${{ github.ref_name }}" | cut -d'-' -f2)" >> $GITHUB_ENV
304+
305+
- uses: softprops/action-gh-release@v2
306+
with:
307+
name: ${{ env.VERSION }} (${{ env.SHORT_SHA }})
308+
tag_name: ${{ env.SHORT_SHA }}
309+
target_commitish: ${{ github.sha }}
310+
files: tizen-*.zip
311+
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/llvm-project*/
2+
/toolchains*/
3+
/sysroot/
Lines changed: 32 additions & 0 deletions
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/
Lines changed: 15 additions & 0 deletions
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)