Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
- 'DEPS'
workflow_dispatch:


jobs:
build:
runs-on: ubuntu-latest
Expand Down
42 changes: 38 additions & 4 deletions ci/docker/tizen/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM ghcr.io/flutter-tizen/tizen-tools:latest
#
# Stage for build-engine-base
#
FROM ghcr.io/flutter-tizen/tizen-tools:latest AS build-engine-base

RUN apt-get update && \
apt-get install -y git curl ca-certificates python python3 xz-utils pkg-config \
libncurses5 libfreetype6-dev && \
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update
RUN apt-get install -y git curl pkg-config ca-certificates xz-utils python python3 libncurses5 && \
apt-get clean

# Install depot tools.
Expand All @@ -13,3 +17,33 @@ RUN git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_t
# Add engine building tools.
ADD tools/* /engine/tools/
ENV PATH=$PATH:/engine/tools


#
# Stage for build-engine-with-efl
#
FROM build-engine-base AS build-engine-with-efl

# Install dependencies for building EFL.
RUN apt-get install -y build-essential check meson ninja-build && \
apt-get clean
RUN apt-get install -y libssl-dev libsystemd-dev libglib2.0-dev libudev-dev libmount-dev libdbus-1-dev libunwind-dev && \
apt-get clean
RUN apt-get install -y libjpeg-dev libopenjp2-7-dev libgif-dev libtiff5-dev librsvg2-dev libheif-dev libwebp-dev libraw-dev \
libpoppler-dev libpoppler-cpp-dev libspectre-dev libfreetype6-dev libfontconfig1-dev libharfbuzz-dev \
libpulse-dev libsndfile1-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
libibus-1.0-dev libscim-dev libfribidi-dev libinput-dev liblua5.2-dev libluajit-5.1-dev \
libx11-dev libxext-dev libxrender-dev libxcursor-dev libxcomposite-dev libxinerama-dev libxrandr-dev \
libxtst-dev libxss-dev libxdamage-dev libgl1-mesa-dev xvfb && \
Copy link
Member

Choose a reason for hiding this comment

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

Wow, now we can run test shell in docker?

Copy link
Author

@WonyoungChoi WonyoungChoi Sep 9, 2021

Choose a reason for hiding this comment

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

Actually, this docker image is for building the engine repository and *-unitests can be run after building the engine on this docker.

for example:

# docker run -it ghcr.io/flutter-tizen/build-engine /bin/bash
mkdir /workspace && cd /workspace
git clone --depth 1 https://github.com/flutter-tizen/engine src/flutter
gclient-prepare-sync.sh --reduce-deps --shallow-sync
gclient sync --no-history
build-engine.sh 
./src/out/host_debug/flutter-tizen-unittests 

But if the test shell you mentioned refers to the environment for testing the flutter widgets, we will need another docker environment.

apt-get clean

# Build and install EFL for host build.
RUN git clone --depth 1 https://git.enlightenment.org/core/efl.git -b efl-1.25 /tmp/efl && \
meson -Dbuild-examples=false -Dbuild-tests=false /tmp/efl /tmp/efl/build && \
ninja -C /tmp/efl/build && \
ninja -C /tmp/efl/build install && \
rm -fr /tmp/efl
RUN ldconfig

# Start dbus service when running this container.
ENTRYPOINT /etc/init.d/dbus start && /bin/bash
Copy link
Author

Choose a reason for hiding this comment

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

dbus service should be started to run flutter_tizen_unittests.

1 change: 0 additions & 1 deletion ci/docker/tizen/build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
IMAGE_NAME=ghcr.io/flutter-tizen/build-engine
IMAGE_TAG=latest

docker pull $IMAGE_NAME:$IMAGE_TAG
docker build --tag $IMAGE_NAME:$IMAGE_TAG .
86 changes: 59 additions & 27 deletions ci/docker/tizen/tools/build-engine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,35 @@

set -e

BUILD_MODE=$1
BUILD_ARCH=$2
BUILD_TRIPLE=$3
BUILD_MODE=debug
BUILD_OS=host

if [[ -z "$BUILD_MODE" || -z "$BUILD_ARCH" || -z "$BUILD_TRIPLE" ]]; then
echo "Usage: $(basename "$0") <mode> <arch> <triple>"
exit 1
fi
while [ $# -ne 0 ]; do
name=$1
case "$name" in
-a | --target-arch)
shift; BUILD_ARCH=$1
;;
-m | --runtime-mode)
shift; BUILD_MODE=$1
;;
-t | --target-triple)
shift; BUILD_TRIPLE=$1
;;
-o | --target-os)
shift; BUILD_OS=$1
;;
--build-target)
shift; BUILD_TARGET=$1
;;
*)
echo "Unknown argument \`$name\`"
exit 1
;;
esac

shift
done

if [[ -z "$TIZEN_TOOLS_PATH" ]]; then
TIZEN_TOOLS_PATH=/tizen_tools
Expand All @@ -22,23 +43,34 @@ if [ ! -d "$TIZEN_TOOLS_PATH" ]; then
exit 1
fi

# FIXME: Remove unsupported options in BUILD.gn.
sed -i 's/"-Wno-non-c-typedef-for-linkage",//g' src/build/config/compiler/BUILD.gn
sed -i 's/"-Wno-psabi",//g' src/build/config/compiler/BUILD.gn

# Run gn.
src/flutter/tools/gn \
--target-os linux \
--linux-cpu $BUILD_ARCH \
--no-goma \
--target-toolchain "$TIZEN_TOOLS_PATH"/toolchains \
--target-sysroot "$TIZEN_TOOLS_PATH"/sysroot/$BUILD_ARCH \
--target-triple $BUILD_TRIPLE \
--runtime-mode $BUILD_MODE \
--enable-fontconfig \
--embedder-for-target \
--disable-desktop-embeddings \
--build-tizen-shell

# Run ninja.
ninja -C src/out/linux_${BUILD_MODE}_${BUILD_ARCH}
if [[ "$BUILD_OS" == "host" ]]; then
src/flutter/tools/gn \
--no-goma \
--runtime-mode $BUILD_MODE \
--enable-fontconfig \
--build-tizen-shell
ninja -C src/out/${BUILD_OS}_${BUILD_MODE} ${BUILD_TARGET}
else
if [[ -z "$BUILD_ARCH" || -z "$BUILD_TRIPLE" ]]; then
echo "required arguments are missing."
exit 1
fi

# FIXME: Remove unsupported options of tizen toolchains from BUILD.gn.
sed -i 's/"-Wno-non-c-typedef-for-linkage",//g' src/build/config/compiler/BUILD.gn
sed -i 's/"-Wno-psabi",//g' src/build/config/compiler/BUILD.gn

src/flutter/tools/gn \
--target-os $BUILD_OS \
--linux-cpu $BUILD_ARCH \
--no-goma \
--target-toolchain "$TIZEN_TOOLS_PATH"/toolchains \
--target-sysroot "$TIZEN_TOOLS_PATH"/sysroot/$BUILD_ARCH \
--target-triple $BUILD_TRIPLE \
--runtime-mode $BUILD_MODE \
--enable-fontconfig \
--embedder-for-target \
--disable-desktop-embeddings \
--build-tizen-shell
ninja -C src/out/${BUILD_OS}_${BUILD_MODE}_${BUILD_ARCH} ${BUILD_TARGET}
fi