Skip to content

Commit

Permalink
Reapply "gh actions: silence missing tzdata warning on android build"
Browse files Browse the repository at this point in the history
This reverts commit 5c2b1ce.
  • Loading branch information
Chilledheart committed Oct 31, 2024
1 parent 5c2b1ce commit e7796b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/releases-android-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
with:
path: |
${{ env.SYSROOT }}
key: android-sysroot-${{ matrix.arch }}-v1
key: android-sysroot-${{ matrix.arch }}-v1-with-tzdata
- uses: actions/setup-go@v5
with:
go-version: '>=1.20.0'
Expand Down Expand Up @@ -194,19 +194,24 @@ jobs:
if: ${{ matrix.arch == 'x86' || matrix.arch == 'x64' }}
run: |
# android sysimg doesn't like resolv.conf
mkdir -p $SYSROOT/etc/ssl/certs $SYSROOT/dev $SYSROOT/proc $SYSROOT/data/local/tmp
mkdir -p $SYSROOT/sys $SYSROOT/etc/ssl/certs $SYSROOT/dev $SYSROOT/proc $SYSROOT/data/local/tmp
bwrap --die-with-parent --ro-bind $SYSROOT / \
--ro-bind /sys /sys \
--ro-bind /etc/ssl/certs /etc/ssl/certs \
--proc /proc --dev /dev \
--unshare-all --share-net \
--bind $PWD/build-android${{ matrix.apilevel }}-${{ matrix.arch }} /data/local/tmp \
--setenv ANDROID_DATA /data \
--setenv ANDROID_ROOT /system \
--setenv TMPDIR /data/local/tmp \
/data/local/tmp/yass_test
- name: Run tests (non x86, under qemu emulation)
if: ${{ matrix.arch != 'x86' && matrix.arch != 'x64' }}
run: |
# TMPDIR is required by leveldb unittests
qemu-${{ matrix.qemu_suffix }} -L $SYSROOT \
-E ANDROID_DATA=$SYSROOT/data \
-E ANDROID_ROOT=$SYSROOT/system \
-E TMPDIR=$PWD/build-android${{ matrix.apilevel }}-${{ matrix.arch }} \
$PWD/build-android${{ matrix.apilevel }}-${{ matrix.arch }}/yass_test
- name: Install the Release certificate
Expand Down
10 changes: 6 additions & 4 deletions scripts/get-android-sys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ if [ "$WITH_ANDROID_IMG" -a ! -d out/sysroot-build/android/"$WITH_ANDROID_IMG"/s
curl -O https://dl.google.com/android/repository/sys-img/android/$WITH_ANDROID_IMG.zip
mkdir -p $WITH_ANDROID_IMG/mount
unzip $WITH_ANDROID_IMG.zip '*/system.img' -d $WITH_ANDROID_IMG
sudo mount $WITH_ANDROID_IMG/*/system.img $WITH_ANDROID_IMG/mount
sudo mount -o ro $WITH_ANDROID_IMG/*/system.img $WITH_ANDROID_IMG/mount
mkdir -p $SYSROOT/system/bin $SYSROOT/system/etc
cp $WITH_ANDROID_IMG/mount/bin/linker* $SYSROOT/system/bin
cp $WITH_ANDROID_IMG/mount/etc/hosts $SYSROOT/system/etc
cp -r $WITH_ANDROID_IMG/mount/lib* $SYSROOT/system
cp -v $WITH_ANDROID_IMG/mount/bin/linker* $SYSROOT/system/bin
cp -v $WITH_ANDROID_IMG/mount/etc/hosts $SYSROOT/system/etc
cp -rv $WITH_ANDROID_IMG/mount/lib* $SYSROOT/system
mkdir -p $SYSROOT/system/usr/share
cp -rv $WITH_ANDROID_IMG/mount/usr/share/zoneinfo $SYSROOT/system/usr/share/
sudo umount $WITH_ANDROID_IMG/mount
rm -rf $WITH_ANDROID_IMG $WITH_ANDROID_IMG.zip
fi

0 comments on commit e7796b8

Please sign in to comment.