Browse Source

Add artifact upload; Add command line options to build script; Add jumbo_file_merge_limit=50

master
wchen342 2 years ago
parent
commit
6d01292481
Signed by untrusted user: wchen342 GPG Key ID: 720B70365E800508
  1. 50
      .github/workflows/build-chrome-arm64.yml
  2. 105
      .github/workflows/build-monochrome-arm.yml
  3. 2
      android_flags.gn
  4. 77
      build.sh

50
.github/workflows/build.yml → .github/workflows/build-chrome-arm64.yml

@ -1,4 +1,4 @@
name: Ungoogled-chromium-android build test
name: Ungoogled-chromium-android ChromePublic arm64 build
on: [push, pull_request, repository_dispatch]
jobs:
@ -6,17 +6,24 @@ jobs:
env:
container_name: archlinuxlatest_47dabf
XHYVE_CPU_COUNT: 4
XHYVE_MEMORY_SIZE: 10240
XHYVE_DISK_SIZE: 40000
name: Build Chromium
XHYVE_MEMORY_SIZE: 11264
XHYVE_DISK_SIZE: 30000
name: Build Chromium Android
runs-on: macos-latest
steps:
- name: Check Environment
run: |
pwd
mkdir -p /Users/runner/work/_actions /Users/runner/work/_temp/_github_home
uname -r
system_profiler SPHardwareDataType
- name: Checkout repository
uses: actions/[email protected]
- name: Checkout submodules
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Install Docker
run: |
brew install docker docker-compose docker-machine xhyve docker-machine-driver-xhyve
@ -30,6 +37,9 @@ jobs:
mkdir -p ~/.docker/machine/cache
curl -Lo ~/.docker/machine/cache/boot2docker.iso https://github.com/boot2docker/boot2docker/releases/download/v19.03.5/boot2docker.iso
docker-machine create --driver xhyve default
docker-machine ssh default pwd
docker-machine ssh default id -un
docker-machine ssh default mkdir -p /home/docker/work/_temp /home/docker/work/_actions /home/docker/work/_temp/_github_home /home/docker/work/_temp/_github_workflow
- name: Start Docker
run: |
docker-machine env default
@ -41,7 +51,7 @@ jobs:
docker network create --label 488dfb github_network_28ec84219b9a42c98a67ea807a1d376e
docker pull archlinux:latest
docker volume create --name ${container_name}_local_volume
docker create --name ${container_name} --cap-add SYS_MODULE --cap-add SYS_ADMIN --device /dev/fuse --label 488dfb --workdir /__w/ungoogled-chromium-android/ungoogled-chromium-android --network github_network_28ec84219b9a42c98a67ea807a1d376e -e "HOME=/github/home" -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/lib/modules":"/lib/modules" -v "${container_name}_local_volume":"/__w" -v "/Users/runner/work/_temp":"/__w/_temp" -v "/Users/runner/work/_actions":"/__w/_actions" -v "/Users/runner/work/_temp/_github_home":"/github/home" -v "/Users/runner/work/_temp/_github_workflow":"/github/workflow" --entrypoint "tail" archlinux:latest "-f" "/dev/null"
docker create --name ${container_name} --cap-add SYS_MODULE --cap-add SYS_ADMIN --device /dev/fuse --label 488dfb --workdir /__w/ungoogled-chromium-android/ungoogled-chromium-android --network github_network_28ec84219b9a42c98a67ea807a1d376e -e "HOME=/github/home" -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/lib/modules":"/lib/modules" -v "${container_name}_local_volume":"/__w" -v "/home/docker/work/_temp":"/__w/_temp" -v "/home/docker/work/_actions":"/__w/_actions" -v "/home/docker/work/_temp/_github_home":"/github/home" -v "/home/docker/work/_temp/_github_workflow":"/github/workflow" --entrypoint "tail" archlinux:latest "-f" "/dev/null"
docker ps --all
docker inspect --format "{{range .Config.Env}}{{println .}}{{end}}" ${container_name}
docker start ${container_name}
@ -49,17 +59,18 @@ jobs:
run: |
docker-machine env default
eval "$(docker-machine env default)"
docker exec ${container_name} bash -c 'sed -i "$(($(grep -n "\[multilib\]" /etc/pacman.conf | cut -f1 -d:) + 1))s/^#//g" /etc/pacman.conf'
docker exec ${container_name} bash -c 'sed -i "$(($(grep -n "\[multilib\]" /etc/pacman.conf | cut -f1 -d:) + 1))s/^#//g" /etc/pacman.conf' # Seems to be enabled by deafult in arch docker image?
docker exec ${container_name} pacman -Sy --noconfirm
docker exec ${container_name} pacman -S --noconfirm lib32-glibc multilib-devel
docker exec ${container_name} pacman -S --noconfirm gnu-free-fonts jdk8-openjdk
docker exec ${container_name} pacman -S --noconfirm --needed base base-devel json-glib libva protobuf jsoncpp python python2 gperf wget rsync tar unzip curl gnupg maven yasm mesa npm ninja git clang lld gn llvm quilt
docker exec ${container_name} bash -c 'yes | pacman -Scc'
- name: Clone repository
- name: Move repository
run: |
docker-machine env default
eval "$(docker-machine env default)"
docker exec ${container_name} git clone "https://github.com/wchen342/ungoogled-chromium-android" --recurse-submodules --single-branch --branch workflow
docker-machine scp -r ../ungoogled-chromium-android [email protected]:/home/docker/work/_temp/_github_home
docker exec ${container_name} bash -c 'cp -r ${HOME}/ungoogled-chromium-android .'
- name: Install python environment
run: |
docker-machine env default
@ -73,5 +84,22 @@ jobs:
run: |
docker-machine env default
eval "$(docker-machine env default)"
docker exec ${container_name} bash -c 'source ~/.bashrc && conda activate py2 && cd ungoogled-chromium-android && ./build.sh'
docker exec ${container_name} bash -c 'cd ungoogled-chromium-android && ls src/out/Default/apks'
docker exec ${container_name} bash -c 'source ~/.bashrc && conda activate py2 && cd ungoogled-chromium-android && ./build.sh -a arm64 -t chrome_public_apk'
docker exec ${container_name} bash -c 'ls ungoogled-chromium-android/src/out/Default/apks'
- name: Move artifact
env:
SUMS: checksums.txt
run: |
docker-machine env default
eval "$(docker-machine env default)"
docker exec ${container_name} bash -c 'mkdir ${HOME}/artifact && cp ungoogled-chromium-android/src/out/Default/apks/*.apk ${HOME}/artifact'
docker-machine scp -r [email protected]:/home/docker/work/_temp/_github_home/artifact ..
ls -la ..
cd ../artifact
openssl sha256 *.apk > $SUMS
cat $SUMS
- uses: actions/[email protected]
name: Upload artifact
with:
name: Ungoogled-chromium-android
path: ../artifact/

105
.github/workflows/build-monochrome-arm.yml

@ -0,0 +1,105 @@
name: Ungoogled-chromium-android MonoChromePublic arm build
on: [push, pull_request, repository_dispatch]
jobs:
build:
env:
container_name: archlinuxlatest_47dabf
XHYVE_CPU_COUNT: 4
XHYVE_MEMORY_SIZE: 11264
XHYVE_DISK_SIZE: 30000
name: Build Chromium Android
runs-on: macos-latest
steps:
- name: Check Environment
run: |
pwd
uname -r
system_profiler SPHardwareDataType
- name: Checkout repository
uses: actions/[email protected]
- name: Checkout submodules
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Install Docker
run: |
brew install docker docker-compose docker-machine xhyve docker-machine-driver-xhyve
# brew cask install virtualbox
sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
brew services start docker-machine
brew cleanup -s && rm -rf $(brew --cache)
- name: Create Docker Machine
run: |
mkdir -p ~/.docker/machine/cache
curl -Lo ~/.docker/machine/cache/boot2docker.iso https://github.com/boot2docker/boot2docker/releases/download/v19.03.5/boot2docker.iso
docker-machine create --driver xhyve default
docker-machine ssh default pwd
docker-machine ssh default id -un
docker-machine ssh default mkdir -p /home/docker/work/_temp /home/docker/work/_actions /home/docker/work/_temp/_github_home /home/docker/work/_temp/_github_workflow
- name: Start Docker
run: |
docker-machine env default
eval "$(docker-machine env default)"
docker version --format '{{.Server.APIVersion}}'
docker version --format '{{.Client.APIVersion}}'
docker ps --all --quiet --no-trunc --filter "label=488dfb"
docker network prune --force --filter "label=488dfb"
docker network create --label 488dfb github_network_28ec84219b9a42c98a67ea807a1d376e
docker pull archlinux:latest
docker volume create --name ${container_name}_local_volume
docker create --name ${container_name} --cap-add SYS_MODULE --cap-add SYS_ADMIN --device /dev/fuse --label 488dfb --workdir /__w/ungoogled-chromium-android/ungoogled-chromium-android --network github_network_28ec84219b9a42c98a67ea807a1d376e -e "HOME=/github/home" -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/lib/modules":"/lib/modules" -v "${container_name}_local_volume":"/__w" -v "/home/docker/work/_temp":"/__w/_temp" -v "/home/docker/work/_actions":"/__w/_actions" -v "/home/docker/work/_temp/_github_home":"/github/home" -v "/home/docker/work/_temp/_github_workflow":"/github/workflow" --entrypoint "tail" archlinux:latest "-f" "/dev/null"
docker ps --all
docker inspect --format "{{range .Config.Env}}{{println .}}{{end}}" ${container_name}
docker start ${container_name}
- name: Install dependencies
run: |
docker-machine env default
eval "$(docker-machine env default)"
docker exec ${container_name} bash -c 'sed -i "$(($(grep -n "\[multilib\]" /etc/pacman.conf | cut -f1 -d:) + 1))s/^#//g" /etc/pacman.conf' # Seems to be enabled by deafult in arch docker image?
docker exec ${container_name} pacman -Sy --noconfirm
docker exec ${container_name} pacman -S --noconfirm lib32-glibc multilib-devel
docker exec ${container_name} pacman -S --noconfirm gnu-free-fonts jdk8-openjdk
docker exec ${container_name} pacman -S --noconfirm --needed base base-devel json-glib libva protobuf jsoncpp python python2 gperf wget rsync tar unzip curl gnupg maven yasm mesa npm ninja git clang lld gn llvm quilt
docker exec ${container_name} bash -c 'yes | pacman -Scc'
- name: Move repository
run: |
docker-machine env default
eval "$(docker-machine env default)"
docker-machine scp -r ../ungoogled-chromium-android [email protected]:/home/docker/work/_temp/_github_home
docker exec ${container_name} bash -c 'cp -r ${HOME}/ungoogled-chromium-android .'
- name: Install python environment
run: |
docker-machine env default
eval "$(docker-machine env default)"
docker exec ${container_name} wget "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"
docker exec ${container_name} bash -c 'echo "bfe34e1fa28d6d75a7ad05fd02fa5472275673d5f5621b77380898dee1be15d2 Miniconda3-latest-Linux-x86_64.sh" | sha256sum --check --status'
docker exec ${container_name} chmod +x Miniconda3-latest-Linux-x86_64.sh
docker exec ${container_name} bash -c './Miniconda3-latest-Linux-x86_64.sh -b -p ~/anaconda && rm -rf Miniconda3-latest-Linux-x86_64.sh'
docker exec ${container_name} bash -c 'source ~/anaconda/bin/activate && conda init && conda create -y --name py2 python=2 && conda activate py2 && pip install six'
- name: Build
run: |
docker-machine env default
eval "$(docker-machine env default)"
docker exec ${container_name} bash -c 'source ~/.bashrc && conda activate py2 && cd ungoogled-chromium-android && ./build.sh -a arm -t monochrome_public_apk'
docker exec ${container_name} bash -c 'ls ungoogled-chromium-android/src/out/Default/apks'
- name: Move artifact
env:
SUMS: checksums.txt
run: |
docker-machine env default
eval "$(docker-machine env default)"
docker exec ${container_name} bash -c 'mkdir ${HOME}/artifact && cp ungoogled-chromium-android/src/out/Default/apks/*.apk ${HOME}/artifact'
docker-machine scp -r [email protected]:/home/docker/work/_temp/_github_home/artifact ..
ls -la ..
cd ../artifact
openssl sha256 *.apk > $SUMS
cat $SUMS
- uses: actions/[email protected]
name: Upload artifact
with:
name: Ungoogled-chromium-android
path: ../artifact/

2
android_flags.gn

@ -12,9 +12,9 @@ enable_resource_whitelist_generation=false
ffmpeg_branding="Chrome"
is_clang=true
is_component_build=false
jumbo_file_merge_limit=50
rtc_build_examples=false
target_os="android"
target_cpu="arm64"
use_jumbo_build=true
use_lld=true
use_sysroot=false

77
build.sh

@ -1,14 +1,76 @@
#!/usr/bin/env bash
set -eux -o pipefail
chromium_version=79.0.3945.117
ungoogled_chromium_revision=1
chrome_target=chrome_public_apk
monochrome_target=monochrome_public_apk
mono_target=monochrome_public_apk
webview_target=system_webview_apk
# Required tools: python2, python3, ninja, git, clang, lld, llvm, curl, wget, npm
# Assuming default python to be python2. This is true on most Linux distributions.
chromium_version=79.0.3945.117
ungoogled_chromium_revision=1
# Argument parser from https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash/29754866#29754866
# -allow a command to fail with !’s side effect on errexit
# -use return value from ${PIPESTATUS[0]}, because ! hosed $?
! getopt --test > /dev/null
if [[ ${PIPESTATUS[0]} -ne 4 ]]; then
echo 'I’m sorry, `getopt --test` failed in this environment.'
exit 1
fi
OPTIONS=a:t:
LONGOPTS=arch:,target:
# -regarding ! and PIPESTATUS see above
# -temporarily store output to be able to check for errors
# -activate quoting/enhanced mode (e.g. by writing out “--options”)
# -pass arguments only via -- "[email protected]" to separate them correctly
! PARSED=$(getopt --options=$OPTIONS --longoptions=$LONGOPTS --name "$0" -- "[email protected]")
if [[ ${PIPESTATUS[0]} -ne 0 ]]; then
# e.g. return value is 1
# then getopt has complained about wrong arguments to stdout
exit 2
fi
# read getopt’s output this way to handle the quoting right:
eval set -- "$PARSED"
ARCH=- TARGET=-
# now enjoy the options in order and nicely split until we see --
while true; do
case "$1" in
-a|--arch)
ARCH="$2"
shift 2
;;
-t|--target)
TARGET="$2"
shift 2
;;
--)
shift
break
;;
*)
echo "Programming error"
exit 3
;;
esac
done
if [[ "$ARCH" != "arm64" ]] && [[ "$ARCH" != "arm" ]] && [[ "$ARCH" != "x86" ]]; then
echo "Wrong architecture"
exit 4
fi
if [[ "$TARGET" != "$chrome_target" ]] && [[ "$TARGET" != "$mono_target" ]] && [[ "$TARGET" != "$webview_target" ]]; then
echo "Wrong target"
exit 5
fi
echo "arch: $ARCH, target: $TARGET"
# Required tools: protobuf python python2 gperf wget rsync tar unzip curl gnupg maven yasm npm ninja git clang lld gn llvm openjdk lib32-glibc multilib-devel
# Assuming default python to be python2.
## Clone ungoogled-chromium repo
git clone https://github.com/Eloston/ungoogled-chromium.git -b ${chromium_version}-${ungoogled_chromium_revision}
@ -213,6 +275,7 @@ popd
pushd src
mkdir -p out/Default
cat ../ungoogled-chromium/flags.gn ../android_flags.gn ../android_flags.release.gn > out/Default/args.gn
printf '\ntarget_cpu="'"$ARCH"'"' >> out/Default/args.gn
tools/gn/out/gn gen out/Default --fail-on-unused-args
popd
@ -228,7 +291,5 @@ patch -p1 --ignore-whitespace -i patches/ignore-aidl-assertion-error.patch --no-
## Build
pushd src
/usr/bin/ninja -C out/Default ${chrome_target}
#/usr/bin/ninja -C out/Default ${monochrome_target}
/usr/bin/ninja -C out/Default ${webview_target}
/usr/bin/ninja -C out/Default $TARGET
popd

Loading…
Cancel
Save