ks32 / CrosswalkNative

Embedded Crosswalk 77 webview based sample project.
96 stars 43 forks source link

gn cannot stably produce consistent build content #36

Open nansenat16 opened 3 years ago

nansenat16 commented 3 years ago

When I use the following Dockerfile to build crosswalk 77, there is a high probability that the build fails, and gn cannot generate XWalkCookieManager_jni.h or cors_origin_pattern.mojom-forward.h compilation file not found

I don’t have much experience in using gclient and gn. Is this a problem caused by some source repo updates?

#
# Build Require: 8 Core CPU, 16GB Ram, 60GB Free Disk Space
#
FROM ubuntu:18.04@sha256:9bc830af2bef73276515a29aa896eedfa7bdf4bdbc5c1063b4c457a4bbb8cd79
WORKDIR /root

ENV XWALK_OS_ANDROID=1

RUN apt update -y && \
    apt install -y git curl wget python python3 && \
    mkdir chromium && \
    cd /root/chromium && \
    git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git && \
    export PATH="$PATH:/root/chromium/depot_tools" && \
    export && \
    gclient config --name="src/xwalk" https://github.com/ks32/crosswalk.git@origin/ks_chromium_77 && \
    echo "target_os = [\"android\", \"linux\"];" >> .gclient && \
    cat .gclient && \
    gclient sync -D --force --reset --with_branch_heads && \
    ls -la

RUN export DEBIAN_FRONTEND=noninteractive && \
    export TZ=Asia/Taipei && \
    apt install -y lsb-core sudo tzdata && \
    cd /root/chromium/src/build && \
    ./install-build-deps-android.sh

RUN cd /root/chromium && \
    cd /root/chromium/src/ && \
    rm -rf out/Default && \
    mkdir -p out/Default && \
    cd out/Default && \
    echo "import(\"//xwalk/build/android.gni\")" > args.gn && \
    echo "is_debug = false" >> args.gn && \
    echo "target_os = \"android\"" >> args.gn && \
    echo "ffmpeg_branding = \"Chrome\"" >> args.gn && \
    echo "target_cpu = \"arm\"" >> args.gn && \
    echo "disable_ftp_support = true" >> args.gn && \
    echo "disable_libfuzzer = true" >> args.gn && \
    echo "enable_plugins = false" >> args.gn && \
    echo "disable_bundled_extensions = true" >> args.gn && \
    echo "is_official_build = true" >> args.gn && \
    echo "enable_nacl = false" >> args.gn && \
    echo "symbol_level = 1" >> args.gn && \
    echo "use_aura = false" >> args.gn && \
    echo "use_ozone = false" >> args.gn && \
    echo "v8_use_snapshot = true" >> args.gn && \
    echo "v8_enable_i18n_support = false" >> args.gn && \
    echo "disable_ftp_support = true" >> args.gn && \
    echo "disable_libfuzzer = true" >> args.gn && \
    cat args.gn && \
    export PATH="$PATH:/root/chromium/depot_tools" && \
    cd /root/chromium/src/ && \
    ls -la ./services/network && \
    gn gen out/Default && \
    ninja -j6 -C out/Default/ -t clean && \
    ninja -j6 -C out/Default/ xwalk_core_library

RUN cd /root/chromium/src/out/Default && \
    sha1sum xwalk_core_library.aar