@@ -64,7 +64,6 @@ main() {
6464 python \
6565 python3 \
6666 xz-utils
67- purge_list+=(default-jre)
6867
6968 curl --retry 3 -sSfL https://storage.googleapis.com/git-repo-downloads/repo -O
7069 chmod +x repo
@@ -128,30 +127,40 @@ main() {
128127 popd
129128
130129 rm -rf " ${td} "
130+ rm -rf " ${PYTHON_TMPDIR} "
131131 rm " ${0} "
132132}
133133
134+ # java isn't required for the build, but the build expects to
135+ # find a java compiler. the supported android versions are:
136+ # https://source.android.com/docs/setup/start/older-versions
137+ # Android 7: OpenJDK-8
134138fake_java () {
139+ local java_type=
135140 local java_version=
136- local icedtea_version=
141+ local jre_info=
142+ local build_info=
143+
137144 case " ${MAJOR_VERSION} " in
138145 5|6)
146+ java_type=java
139147 java_version=1.7.0
140- icedtea_version=2.6.9
148+ jre_info=" IcedTea 2.6.9"
149+ build_info=" build 24.131-b00, mixed mode"
141150 ;;
142151 * )
143- java_version=1.8.0
144- icedtea_version=2.6.9
152+ java_type=openjdk
153+ java_version=1.8.0_342
154+ jre_info=" build 1.8.0_342-8u342-b07-0ubuntu1~20.04-b07"
155+ build_info=" build 25.342-b07, mixed mode"
145156 ;;
146157 esac
147158
148- # fake java and javac, it is not necessary for what we build, but the build
149- # script asks for it
150159 cat << EOF > /usr/bin/java
151160#!/usr/bin/env bash
152- echo "java version \"${java_version} \""
153- echo "OpenJDK Runtime Environment (IcedTea ${icedtea_version } )"
154- echo "OpenJDK 64-Bit Server VM (build 24.131-b00, mixed mode )"
161+ echo "${java_type} version \"${java_version} \""
162+ echo "OpenJDK Runtime Environment (${jre_info } )"
163+ echo "OpenJDK 64-Bit Server VM (${build_info} )"
155164EOF
156165
157166 cat << EOF > /usr/bin/javac
164173
165174 # more faking
166175 export ANDROID_JAVA_HOME=/tmp
167- mkdir /tmp/lib/
176+ mkdir -p /tmp/lib/
168177 touch /tmp/lib/tools.jar
169178}
170179
@@ -225,6 +234,7 @@ android_repo_v5() {
225234 sync external/libselinux
226235 sync external/mksh
227236 sync external/openssl
237+ sync external/pcre
228238 sync external/stlport
229239 sync prebuilts/clang/linux-x86/host/3.5
230240 sync system/core
@@ -262,9 +272,11 @@ android_repo_v6() {
262272 sync external/compiler-rt
263273 sync external/libcxx
264274 sync external/libcxxabi
275+ sync external/libselinux
265276 sync external/elfutils
266277 sync external/jemalloc
267278 sync external/mksh
279+ sync external/pcre
268280 sync external/safe-iop
269281 sync external/zlib
270282 sync libnativehelper
@@ -300,6 +312,7 @@ android_repo_v6() {
300312
301313# tested on 7.0.0_r36 (SDK 24)
302314# tested on 7.1.2_r39 (SDK 25, not supported)
315+ # API level 25, requires for Android 7.1, is not provided in NDKs
303316android_repo_v7 () {
304317 sync bionic
305318 sync build
@@ -321,6 +334,7 @@ android_repo_v7() {
321334 sync prebuilts/clang/host/linux-x86
322335 sync prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8
323336 sync prebuilts/misc
337+ sync prebuilts/ndk
324338 sync prebuilts/ninja/linux-x86
325339 sync system/core
326340
@@ -349,12 +363,26 @@ android_repo_v7() {
349363 # the unittests from it is a bit of work.
350364 rm bionic/tools/relocation_packer/Android.mk
351365
352- ANDROID_MAJOR=7 python3 /remove_android_tests.py
366+ remove_tests
353367}
354368
355369# TODO: tested on 8.0.0_r51 (SDK 26)
356- # TODO: tested on 8.1.0_r81 (SDK 2278.0.0_r516)
370+ # Currently failing due to libLLVM/libclang issues
371+ # TODO: tested on 8.1.0_r81 (SDK 27)
357372android_repo_v8 () {
373+ # external/compiler-rt/lib/sanitizer_common/tests/Android.bp:37:1
374+ # name: "san_test-Nolibc"
375+ #
376+ # libnativehelper/Android.bp
377+ # subdirs = ["tests"]
378+ #
379+ # system/core/bootstat/Android.bp
380+ # whole_static_libs: ["libgtest_prod"],
381+ #
382+ # external/compiler-rt/lib/asan/Android.bp
383+ # name: "libasan_noinst_test",
384+ #
385+
358386 sync bionic
359387 sync build
360388 sync build/make
@@ -363,34 +391,42 @@ android_repo_v8() {
363391 sync external/boringssl
364392 sync external/clang
365393 sync external/compiler-rt
394+ sync external/elfutils
366395 sync external/jemalloc
367396 sync external/libcxx
368397 sync external/libcxxabi
369- sync external/libnl
398+ # TODO(ahuszagh) Remove?
399+ # sync external/libnl
400+ sync external/libevent
370401 sync external/libunwind
371402 sync external/libunwind_llvm
372403 sync external/llvm
373404 sync external/lzma
374405 sync external/mksh
375406 sync external/pcre
407+ sync external/safe-iop
376408 sync external/selinux
377409 sync external/zlib
378- sync hardware/interfaces
379- sync hardware/libhardware
380- sync frameworks/native
410+ # TODO(ahuszagh) Remove?
411+ # sync hardware/interfaces
412+ # sync hardware/libhardware
413+ # sync frameworks/native
381414 sync libnativehelper
382415 sync prebuilts/build-tools
383416 sync prebuilts/clang/host/linux-x86
417+ # TODO(ahuszagh) clang-tools isn't available till 9.0
384418 sync prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8
385419 sync prebuilts/go/linux-x86
386- # needed for libnativehelper_compat_libc++
387420 sync prebuilts/ndk
388421 sync system/core
389- sync system/libfmq
390- sync system/libhidl
391- sync system/libhwbinder
392- sync system/media
393- sync system/tools/hidl
422+ sync toolchain/binutils
423+
424+ # TODO(ahuszagh) See if I can remove all of these
425+ # sync system/libfmq
426+ # sync system/libhidl
427+ # sync system/libhwbinder
428+ # sync system/media
429+ # sync system/tools/hidl
394430 # TODO(ahuszagh) Android 8 is a mess
395431
396432 # avoid build tests
@@ -399,26 +435,21 @@ android_repo_v8() {
399435 rm bionic/tests/Android.bp
400436 rm bionic/benchmarks/Android.bp
401437 rm bionic/tests/libs/Android.bp
402- rm hardware/interfaces/tests/Android.bp
403- rm system/tools/hidl/test/Android.bp
438+ # TODO(ahuszagh) Can probably remove this
439+ # rm hardware/interfaces/tests/Android.bp
440+ # rm system/tools/hidl/test/Android.bp
404441 # we don't need the relocation packer, and removing
405442 # the unittests from it is a bit of work.
406443 rm bionic/tools/relocation_packer/Android.bp
407444 rm bionic/tools/relocation_packer/Android.mk
445+ rm system/core/libgrallocusage/Android.bp
446+ rm system/core/libmemtrack/Android.bp
447+ rm system/core/libsysutils/Android.bp
448+
449+ # avoid java dependencies
450+ rm external/lzma/Java/Tukaani/Android.mk
408451
409- # extra utilities we don't need
410- rm frameworks/native/libs/vr/Android.bp
411- rm frameworks/native/services/Android.bp
412- rm frameworks/native/services/* /Android.bp
413- rm hardware/interfaces/automotive/Android.bp
414- rm hardware/interfaces/camera/Android.bp
415- rm system/libhidl/transport/Android.bp
416- rm system/media/alsa_utils/Android.bp
417- rm system/media/audio_route/Android.bp
418- rm system/media/audio_utils/tests/Android.bp
419- # TODO(ahuszagh) Need to remove the tests here
420-
421- ANDROID_MAJOR=8 python3 /remove_android_tests.py
452+ remove_tests
422453}
423454
424455# tested on 9.0.0_r1 (SDK 28)
@@ -482,7 +513,7 @@ android_repo_v9() {
482513 rm bionic/tests/headers/Android.bp
483514 rm bionic/tests/headers/posix/Android.bp
484515
485- ANDROID_MAJOR=9 python3 /remove_android_tests.py
516+ remove_tests
486517}
487518
488519# tested on 10.0.0_r47 (SDK 29)
@@ -553,7 +584,19 @@ android_repo_v10() {
553584 rm bionic/tests/headers/Android.bp
554585 rm bionic/tests/headers/posix/Android.bp
555586
556- ANDROID_MAJOR=10 python3 /remove_android_tests.py
587+ remove_tests
588+ }
589+
590+ remove_tests () {
591+ install_packages python3-pip
592+
593+ export PYTHONPATH=" ${PYTHON_TMPDIR} /lib/python3.8/site-packages/" :" ${PYTHONPATH} "
594+ mkdir -p " ${PYTHON_TMPDIR} "
595+ python3 -m pip install sly==0.4.0 --prefix " ${PYTHON_TMPDIR} "
596+
597+ # TODO(ahuszagh) Need to change this
598+ # Need a custom entrypoint
599+ ANDROID_MAJOR=" ${MAJOR_VERSION} " python3 " ${PYTHON_TMPDIR} /remove_tests.py"
557600}
558601
559602sync () {
0 commit comments