diff --git a/scripts/generate_android_bp.py b/scripts/generate_android_bp.py index e496cb696..154895a7c 100644 --- a/scripts/generate_android_bp.py +++ b/scripts/generate_android_bp.py @@ -196,19 +196,22 @@ def gn_sources_to_blueprint_sources(sources): target_blockist = [ '//build/config:shared_library_deps', '//third_party/vulkan-validation-layers/src:vulkan_clean_old_validation_layer_objects', + '//third_party/zlib:zlib', + '//third_party/zlib/google:compression_utils_portable', ] third_party_target_allowlist = [ '//third_party/abseil-cpp', '//third_party/vulkan-deps', '//third_party/vulkan_memory_allocator', - '//third_party/zlib', ] include_blocklist = [ '//buildtools/third_party/libc++/', '//out/Android/gen/third_party/vulkan-deps/glslang/src/include/', '//third_party/android_ndk/sources/android/cpufeatures/', + '//third_party/zlib/', + '//third_party/zlib/google/', ] @@ -255,13 +258,10 @@ def gn_deps_to_blueprint_deps(abi, target, build_info): # target depends on another's genrule, it wont find the outputs. Propogate generated # headers up the dependency stack. generated_headers += child_generated_headers - elif dep == '//third_party/android_ndk:cpu_features': - # chrome_zlib needs cpufeatures from the Android NDK. Rather than including the - # entire NDK is a dep in the ANGLE checkout, use the library that's already part - # of Android. - dep_info = build_info[abi][dep] - blueprint_dep_name = gn_target_to_blueprint_target(dep, dep_info) - static_libs.append('cpufeatures') + elif dep == '//third_party/zlib/google:compression_utils_portable': + # Replace zlib by Android's zlib, compression_utils_portable is the root dependency + static_libs.extend( + ['zlib_google_compression_utils_portable', 'libz_static', 'cpufeatures']) return static_libs, shared_libs, defaults, generated_headers, header_libs @@ -660,7 +660,6 @@ def main(): 'third_party/vulkan-deps/vulkan-headers/LICENSE.txt', 'third_party/vulkan-deps/vulkan-headers/src/LICENSE.txt', 'third_party/vulkan_memory_allocator/LICENSE.txt', - 'third_party/zlib/LICENSE', 'tools/flex-bison/third_party/m4sugar/LICENSE', 'tools/flex-bison/third_party/skeletons/LICENSE', 'util/windows/third_party/StackWalker/LICENSE', diff --git a/scripts/roll_aosp.sh b/scripts/roll_aosp.sh index 48becfa35..ee1000b3f 100755 --- a/scripts/roll_aosp.sh +++ b/scripts/roll_aosp.sh @@ -119,7 +119,6 @@ third_party_deps=( "third_party/vulkan-deps/spirv-tools/src" "third_party/vulkan-deps/vulkan-headers/src" "third_party/vulkan_memory_allocator" - "third_party/zlib" ) root_add_deps=( @@ -130,6 +129,7 @@ root_add_deps=( # Only add the parts of NDK and vulkan-deps that are required by ANGLE. The entire dep is too large. delete_only_deps=( "third_party/vulkan-deps" + "third_party/zlib" # Replaced by Android's zlib; delete for gclient to work https://crbug.com/skia/14155#c3 ) # Delete dep directories so that gclient can check them out @@ -156,6 +156,7 @@ unsupported_third_party_deps=( "third_party/llvm-build" "third_party/android_build_tools" "third_party/android_sdk" + "third_party/zlib" # Replaced by Android's zlib ) for unsupported_third_party_dep in "${unsupported_third_party_deps[@]}"; do rm -rf "$unsupported_third_party_dep" @@ -187,9 +188,9 @@ for removal_file in "${extra_removal_files[@]}"; do rm -rf "$removal_file" done -# Add all changes to third_party/ so we delete everything not explicitly allowed. +# Add all changes under $root_add_deps so we delete everything not explicitly allowed. for root_add_dep in "${root_add_deps[@]}"; do -git add -f "$root_add_dep/*" + git add -f $root_add_dep done # Done with depot_tools