Browse Source

Add debug build

master
wchen342 3 years ago
parent
commit
47b100ead7
Signed by untrusted user: wchen342 GPG Key ID: 720B70365E800508
  1. 24
      .github/workflows/build.yml
  2. 1
      android_flags.debug.gn
  3. 2
      android_flags.gn
  4. 18
      build.sh

24
.github/workflows/build.yml

@ -15,6 +15,7 @@ jobs:
matrix:
arch: [arm, arm64]
target: [chrome_public_apk, monochrome_public_apk]
debug: [release, debug]
steps:
- name: Check Environment
@ -22,7 +23,7 @@ jobs:
pwd
uname -r
system_profiler SPHardwareDataType
sleep $((10 + RANDOM % 20))
sleep $((5 + RANDOM % 10))
- name: Checkout repository
uses: actions/[email protected]
- name: Checkout submodules
@ -31,6 +32,7 @@ jobs:
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Install Docker
if: (matrix.debug == 'release' && (matrix.arch != 'arm64' || matrix.target != 'monochrome_public_apk')) || (matrix.debug == 'debug' && ((matrix.arch == 'arm' && matrix.target == 'monochrome_public_apk') || (matrix.arch == 'arm64' && matrix.target == 'chrome_public_apk')))
run: |
brew install docker docker-compose docker-machine xhyve docker-machine-driver-xhyve
sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
@ -39,6 +41,7 @@ jobs:
- name: Create Docker Machine
env:
machine_config_path: /Users/runner/.docker/machine/machines/default
if: (matrix.debug == 'release' && (matrix.arch != 'arm64' || matrix.target != 'monochrome_public_apk')) || (matrix.debug == 'debug' && ((matrix.arch == 'arm' && matrix.target == 'monochrome_public_apk') || (matrix.arch == 'arm64' && matrix.target == 'chrome_public_apk')))
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
@ -47,6 +50,7 @@ jobs:
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
if: (matrix.debug == 'release' && (matrix.arch != 'arm64' || matrix.target != 'monochrome_public_apk')) || (matrix.debug == 'debug' && ((matrix.arch == 'arm' && matrix.target == 'monochrome_public_apk') || (matrix.arch == 'arm64' && matrix.target == 'chrome_public_apk')))
run: |
docker-machine env default
eval "$(docker-machine env default)"
@ -62,6 +66,7 @@ jobs:
docker inspect --format "{{range .Config.Env}}{{println .}}{{end}}" ${container_name}
docker start ${container_name}
- name: Install dependencies
if: (matrix.debug == 'release' && (matrix.arch != 'arm64' || matrix.target != 'monochrome_public_apk')) || (matrix.debug == 'debug' && ((matrix.arch == 'arm' && matrix.target == 'monochrome_public_apk') || (matrix.arch == 'arm64' && matrix.target == 'chrome_public_apk')))
run: |
docker-machine env default
eval "$(docker-machine env default)"
@ -72,12 +77,14 @@ jobs:
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
if: (matrix.debug == 'release' && (matrix.arch != 'arm64' || matrix.target != 'monochrome_public_apk')) || (matrix.debug == 'debug' && ((matrix.arch == 'arm' && matrix.target == 'monochrome_public_apk') || (matrix.arch == 'arm64' && matrix.target == 'chrome_public_apk')))
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
if: (matrix.debug == 'release' && (matrix.arch != 'arm64' || matrix.target != 'monochrome_public_apk')) || (matrix.debug == 'debug' && ((matrix.arch == 'arm' && matrix.target == 'monochrome_public_apk') || (matrix.arch == 'arm64' && matrix.target == 'chrome_public_apk')))
run: |
docker-machine env default
eval "$(docker-machine env default)"
@ -87,16 +94,23 @@ jobs:
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
if: matrix.arch != 'arm64' || matrix.target != 'monochrome_public_apk'
if: matrix.debug == 'release' && (matrix.arch != 'arm64' || matrix.target != 'monochrome_public_apk')
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 ${{ matrix.arch }} -t ${{ matrix.target }}'
docker exec ${container_name} bash -c 'ls ungoogled-chromium-android/src/out/Default/apks'
- name: Build Debug
if: matrix.debug == 'debug' && ((matrix.arch == 'arm' && matrix.target == 'monochrome_public_apk') || (matrix.arch == 'arm64' && matrix.target == 'chrome_public_apk'))
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 -d -a ${{ matrix.arch }} -t ${{ matrix.target }}'
docker exec ${container_name} bash -c 'ls ungoogled-chromium-android/src/out/Default/apks'
- name: Move artifact
env:
SUMS: checksums.txt
if: matrix.arch != 'arm64' || matrix.target != 'monochrome_public_apk'
if: (matrix.debug == 'release' && (matrix.arch != 'arm64' || matrix.target != 'monochrome_public_apk')) || (matrix.debug == 'debug' && ((matrix.arch == 'arm' && matrix.target == 'monochrome_public_apk') || (matrix.arch == 'arm64' && matrix.target == 'chrome_public_apk')))
run: |
docker-machine env default
eval "$(docker-machine env default)"
@ -108,7 +122,7 @@ jobs:
cat $SUMS
- uses: actions/[email protected]
name: Upload artifact
if: matrix.arch != 'arm64' || matrix.target != 'monochrome_public_apk'
if: (matrix.debug == 'release' && (matrix.arch != 'arm64' || matrix.target != 'monochrome_public_apk')) || (matrix.debug == 'debug' && ((matrix.arch == 'arm' && matrix.target == 'monochrome_public_apk') || (matrix.arch == 'arm64' && matrix.target == 'chrome_public_apk')))
with:
name: ${{ matrix.target }}-${{ matrix.arch }}
name: ${{ matrix.target }}-${{ matrix.arch }}-${{ matrix.debug }}
path: ../artifact/

1
android_flags.debug.gn

@ -25,6 +25,7 @@ google_default_client_secret=""
is_debug=true
is_official_build=false
optimize_webui=false
proprietary_codecs=true
safe_browsing_mode=0
symbol_level=1
treat_warnings_as_errors=false

2
android_flags.gn

@ -12,7 +12,7 @@ enable_resource_whitelist_generation=false
ffmpeg_branding="Chrome"
is_clang=true
is_component_build=false
jumbo_file_merge_limit=50
jumbo_file_merge_limit=40
rtc_build_examples=false
target_os="android"
use_jumbo_build=true

18
build.sh

@ -17,8 +17,8 @@ if [[ ${PIPESTATUS[0]} -ne 4 ]]; then
exit 1
fi
OPTIONS=a:t:
LONGOPTS=arch:,target:
OPTIONS=da:t:
LONGOPTS=debug,arch:,target:
# -regarding ! and PIPESTATUS see above
# -temporarily store output to be able to check for errors
@ -33,11 +33,15 @@ fi
# read getopt’s output this way to handle the quoting right:
eval set -- "$PARSED"
ARCH=- TARGET=-
ARCH=- TARGET=- DEBUG=n
# now enjoy the options in order and nicely split until we see --
while true; do
case "$1" in
-d|--debug)
DEBUG=y
shift
;;
-a|--arch)
ARCH="$2"
shift 2
@ -67,7 +71,7 @@ if [[ "$TARGET" != "$chrome_target" ]] && [[ "$TARGET" != "$mono_target" ]] && [
exit 5
fi
echo "arch: $ARCH, target: $TARGET"
echo "arch: $ARCH, target: $TARGET, debug: $DEBUG"
# 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.
@ -278,7 +282,11 @@ popd
## Configure output folder
pushd src
mkdir -p out/Default
cat ../ungoogled-chromium/flags.gn ../android_flags.gn ../android_flags.release.gn > out/Default/args.gn
if [ "$DEBUG" = n ] ; then
cat ../ungoogled-chromium/flags.gn ../android_flags.gn ../android_flags.release.gn > out/Default/args.gn
else
cat ../android_flags.gn ../android_flags.debug.gn > out/Default/args.gn
fi
printf '\ntarget_cpu="'"$ARCH"'"' >> out/Default/args.gn
tools/gn/out/gn gen out/Default --fail-on-unused-args
popd

Loading…
Cancel
Save