This reverts commit 9f7b6babe1.
Reason for revert: No longer appears needed as 1) number of diffs was greatly reduced via cc_default 2) build configs got simpler with switching to platform zlib. No recent conflicts introduced by build scripts
Original change's description:
> Add minimal setup for Go codegen in Android.bp.
>
> Based on Cody's http://ag/19603310.
>
> Only adds libEGL_angle_codegen to libEGL_angle and is a no-op.
>
> Tested in an aosp checkout. Hopefully this doesn't cause merge conflicts
> with internal master as all diffs are close to the top of the file.
>
> Android.bp diff: https://paste.googleplex.com/6626641357832192
>
> Bug: b/242929755
> Change-Id: I6d7ac9f3dd502074c41838bd1aa10075a8c99145
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3876890
> Commit-Queue: Roman Lavrov <romanl@google.com>
> Reviewed-by: Cody Northrop <cnorthrop@google.com>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Bug: b/242929755
Change-Id: Id4cbdf68e9704138396ee1bef7a4f1edef3f50cf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685320
Commit-Queue: Roman Lavrov <romanl@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Now that chromium/base has rolled and switched the android_ndk_root to
the new android_toolchain directory, remove the stale Android NDK. Fix
roller scripts to no longer roll Android NDK and Android blueprint
generation can remove references to the removed sources.
Bug: chromium:1448383
Test: Verified build of ANGLE.
Change-Id: Iba8bfd8be9fd6bfb4f75f5d3a273411bd11f6b5e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4585389
Auto-Submit: Prashanth Swaminathan <prashanthsw@google.com>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Add zlib to delete_only_deps, otherwise gclient seems to choke
on it https://crbug.com/skia/14155#c3
Also git add $root_add_dep instead of "$root_add_dep/*" as
the latter wouldn't add deleted directories
like third_party/zlib in this case.
We also need zlib in unsupported_third_party_deps so that it gets
deleted after gclient sync. When a file from a nested git repo was
already added to the tree previously, git no longer relies on .git
subdirectory detection and works as if .git wasn't there.
This is a reland of commit 39f0eaf809
Original change's description:
> Replace zlib from chrome by Android's zlib.
>
> Implements Elliott's https://r.android.com/2360448 in our codegen. The
> only diffs are ordering and third_party_android_ndk_cpu_features.
> We only seem to depend on cpufeatures for zlib.
>
> //third_party/zlib/google:compression_utils_portable is the root
> dependency, so cutting it makes other zlib libs disappear from
> Android.bp
>
> zlib_google_compression_utils_portable and libz_static
> that this CL depends on were added in https://r.android.com/2359720
>
> Tested by running roll_aosp.sh in Android tree and building.
> third_party/zlib got deleted locally so presumably it should
> get deleted by the roller
>
> Bug: b/262603863
> Change-Id: I2651cc21121d741526055fa2b0288d0dcfa5c62a
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4111891
> Reviewed-by: Cody Northrop <cnorthrop@google.com>
> Commit-Queue: Roman Lavrov <romanl@google.com>
Bug: b/262603863
Change-Id: I87226e294a3e293ed5fcdeb2f0cf52f55917c1f3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4300169
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Commit-Queue: Roman Lavrov <romanl@google.com>
This reverts commit 39f0eaf809.
Reason for revert: Broke roller https://crbug.com/skia/14155
Original change's description:
> Replace zlib from chrome by Android's zlib.
>
> Implements Elliott's https://r.android.com/2360448 in our codegen. The
> only diffs are ordering and third_party_android_ndk_cpu_features.
> We only seem to depend on cpufeatures for zlib.
>
> //third_party/zlib/google:compression_utils_portable is the root
> dependency, so cutting it makes other zlib libs disappear from
> Android.bp
>
> zlib_google_compression_utils_portable and libz_static
> that this CL depends on were added in https://r.android.com/2359720
>
> Tested by running roll_aosp.sh in Android tree and building.
> third_party/zlib got deleted locally so presumably it should
> get deleted by the roller
>
> Bug: b/262603863
> Change-Id: I2651cc21121d741526055fa2b0288d0dcfa5c62a
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4111891
> Reviewed-by: Cody Northrop <cnorthrop@google.com>
> Commit-Queue: Roman Lavrov <romanl@google.com>
Bug: b/262603863
Change-Id: Ie17cb5b63a2c86a7414230bf9b0e8ef16e8734bb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4298280
Commit-Queue: Roman Lavrov <romanl@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Implements Elliott's https://r.android.com/2360448 in our codegen. The
only diffs are ordering and third_party_android_ndk_cpu_features.
We only seem to depend on cpufeatures for zlib.
//third_party/zlib/google:compression_utils_portable is the root
dependency, so cutting it makes other zlib libs disappear from
Android.bp
zlib_google_compression_utils_portable and libz_static
that this CL depends on were added in https://r.android.com/2359720
Tested by running roll_aosp.sh in Android tree and building.
third_party/zlib got deleted locally so presumably it should
get deleted by the roller
Bug: b/262603863
Change-Id: I2651cc21121d741526055fa2b0288d0dcfa5c62a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4111891
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Roman Lavrov <romanl@google.com>
This is a reland of commit 61728827d2
Changes made on top of previous commit
1. In src/program_serialize_data_version.py,
fix the script error on Windows: anglebug.com/7918.
2. In BUILD.gn, replace the 'write_file' with
'response_file_content'. See
https://gn.googlesource.com/gn/+/main/docs/reference.md#var_response_file_contents
3. In scripts/generate_android.bp.py, add code to
handle the special GN build flag {{response_file_name}}.
The code writes the list defined in srcs
(identified by $(in) in Android blueprint) into a
temp file named 'gn_response_file', and replaces the
{{response_file_name}} with 'gn_response_file'.
Original change's description
> Changes made on top of original commit
> 1. Enable execution permission on python script
> program_serialize_data_version.py
> 2. Remove unused list in libGLESv2.gni
> 3. In angle/BUILD.gn, change file path from
> "relative to angle_root", to "relative to root_build_dir",
> so that inside the script program_serialize_data_version.py,
> we don't have to find the absolute path of the code files for
> hashing.
> Original change's description
> > This change introduces a new variable ANGLE_PROGRAM_VERSION
> > to track the version of ANGLE source files that affect shader
> > program serialization/deserialization. This change include more
> > source files than necessary, to serve the purpose of a conservative
> > jumping off point. We will narrow down the list of files for
> > ANGLE_PROGRAM_VERSION hash generation in the future.
> > Add a new script program_serialize_data_version.py that will
> > be triggered during the build when the related source files changed.
> > The script will generate a hash and the hash size from the related
> > source files. In program serialization/deserialization and cache
> > key generation, we will use this hash value instead of the entire
> > ANGLE git hash. When the hash value changed, we know that the
> > related source files changed, and we should invalidate the program
> > cache and re-generate the blob cache / program binary.
> > Bug: angleproject:4981
> > Change-Id: I2fb609416738d459d3289190c232c2d797ba58e3
> > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4072215
> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
> > Reviewed-by: Cody Northrop <cnorthrop@google.com>
> > Reviewed-by: Jamie Madill <jmadill@chromium.org>
> > Commit-Queue: Yuxin Hu <yuxinhu@google.com>
> Bug: angleproject:4981
> Change-Id: Iaa9eb0ab33439197bc30d03064fc245ea7ef1ea8
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4113445
> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
> Reviewed-by: Cody Northrop <cnorthrop@google.com>
> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Bug: angleproject:4981
Change-Id: Ib5bba199be6d08a1e19807026df0e7b747dbc8a9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4144078
Reviewed-by: Roman Lavrov <romanl@google.com>
Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
This simplifies the downstream "-fno-unwind-tables" diff as we'll have
it all in one place, and also avoids having it dependent on `arch`
(which adds complexity as described in b/242929755#comment6)
Android.bp diff (might take a while to render):
https://diff.googleplex.com/#key=2ssQav0Jzifk
Search for `third_party_zlib_zlib_arm_crc32` to see how it resolves the
`arch` issue.
Tested locally that it builds (arm64 and x64).
Bug: b/242929755
Change-Id: I46c71e50942dfe42075b7ffef722e6c009fbf316
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3923457
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Roman Lavrov <romanl@google.com>
`roll_aosp.sh --genAndroidBp` used to nuke out/Android. Move that out of
the function so that it's only nuked when ran without args. Add a
warning at the top of roll_aosp.sh.
Use explicit flags to avoid dependency on keeping ABI ordering in sync
between roll_aosp.sh, also makes it easier to understand when looking at
--help etc.
Use all caps for module-level constants, common in python.
Replace @cache with python3's @functools.cache.
Switched to python3 in https://crrev.com/c/3907879.
Bug: b/242929755
Change-Id: Ib3fcd46c283f00e3d2d573c1ac7bbb6f6c1231e9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3913627
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Roman Lavrov <romanl@google.com>
Recursive traversal results in visiting the same nodes many many times.
With this CL, timing goes from:
234.47s user 0.45s system 99% cpu 3:55.00 total
to:
0.24s user 0.04s system 99% cpu 0.281 total
without any diffs in the output file.
Bug: b/242929755
Change-Id: Id058f43859fc46bc416d8467ff4dca2fb8e46777
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3870659
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Roman Lavrov <romanl@google.com>
This reverts commit b43a004567.
Reason for revert: causing merge conflicts across Android branches
Original change's description:
> Sort items to avoid python2/3 diffs.
>
> python3.x made ordering of iteration of built-in dicts match insertion
> order which differs from python2.
>
> This will also make it easier to find things in .bp as keys will be in
> sorted order.
>
> Bug: b/242929755
> Change-Id: I9c204fd7f8500b55ee4b24cbace0cc474dc48266
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3863009
> Commit-Queue: Roman Lavrov <romanl@google.com>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Bug: b/242929755
Change-Id: I9c0f6fc8baa164b3256e93c4d1cfbd69c1797a4d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3863665
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Roman Lavrov <romanl@google.com>
python3.x made ordering of iteration of built-in dicts match insertion
order which differs from python2.
This will also make it easier to find things in .bp as keys will be in
sorted order.
Bug: b/242929755
Change-Id: I9c204fd7f8500b55ee4b24cbace0cc474dc48266
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3863009
Commit-Queue: Roman Lavrov <romanl@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Cuttlefish recently hit a clang compiler issue related to -Oz:
b/200617543
This is fixed by either disabling optimizations for ScopedExit or using
-Os.
This CL will switch ANGLE to using -Os.
When building CF in AOSP, the binary size is reduced with -Os vs -Oz:
-Oz: 16,383,489 bytes
-Os: 16,152,509 bytes
Bug: b/200617543
Change-Id: Ic920b0e0e4a61453d9657101a4560f74d90d5744
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3253128
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Tim Van Patten <timvp@google.com>
The ANGLE autoroller into AOSP is currently stuck due to a merge
conflict in third_party/glmark2. Specifically, this directory was
deleted in AOSP, but modified in upstream ANGLE.
The solution is to add back the third_party/ directories into AOSP, and
the ANGLE-owned files. The full contents will not be added back if
they are a git submodule.
Some third_party/ directories will continue to be deleted due to how
large they are:
third_party/jdk
third_party/llvm-build
third_party/android_build_tools
third_party/android_sdk
We can look into adding these back in the future if it becomes
necessary.
Additionally, the license information in the Android.bp is being updated
to reflect the newly added files.
Bug: angleproject:6635
Change-Id: I793e5b0797218963a4d06a0399b3be80edd43b37
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3251685
Commit-Queue: Tim Van Patten <timvp@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
The initial list of files speficied for license_text in
generate_android_bp.py included license files that aren't present after
issuing: git clean -f -x -d -f
While the list will build correctly when rolling ANGLE locally, since
roll_aosp.sh doesn't issue a 'git clean', it fails to build on the
Android presubmit bots.
Bug: b/191882454
Test: git clean -f -x -d -f ; m ANGLE -j50
Change-Id: I31efba1f5030b118838ba1a21501f32200c93db3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3046958
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Tim Van Patten <timvp@google.com>
In an effort to better satisfy the Android legal/license requirements:
1.) Cleanup the license data in the generated Android.bp.
2.) Remove unused Android.mk files.
Bug: b/191882454
Change-Id: Ia1937c1e2e822e688cca2a4d3ebc9a294f67ad69
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3021851
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Tim Van Patten <timvp@google.com>
The buildtools/ directory is not included in the AOSP version of ANGLE
and is unnecessary, so update generate_android_bp.py to filter out that
include directory.
Bug: b/187342779
Change-Id: I3a2d0506ac53f7d369597c797fffb211ffde41f1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2995382
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Tim Van Patten <timvp@google.com>
Add some flags to generate_android_bp.py to make the AOSP match the
ANGLE build flags, which makes the CQ testing more relevant and reduces
the ANGLE APK size. Additionally, disable various GN args that are no
longer required (GL, ESSL, HSSL). Together, this reduces the ANGLE APK
size in AOSP from 22.2MB to 16.7MB.
This CL also makes some fixes to roll_aosp.sh that are suggested by
"Shell Scipt".
Bug: b/189125396
Test: manual verification
Change-Id: Iea33de799a00ffff182cf028a6998e1ef01a00e1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2912933
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Tim Van Patten <timvp@google.com>
The recent CL to remove the Settings GUI from the Android-built APK went
a little too far removing Java code and emptying the
AndroidManifest.xml. This resulted in ANGLE being unable to be loaded
from the APK, since ANGLE was not able to respond to the intent
android.app.action.ANGLE_FOR_ANDROID which indicates it contains ANGLE
libraries.
The AndroidManifest.xml requires various flags like
android:forceQueryable="true" so the APK can be accessed by the
framework.
The assets/ directory was removed, which contains 'a4a_rules.json' and
is required by GraphicsEnvironment. This is added back.
Bug: b/187342779
Change-Id: Ic7b758c92ed12750972c7e313729276a13f76032
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2906632
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Tim Van Patten <timvp@google.com>
The Settings GUI is being removed from the AOSP build to turn the ANGLE
APK into essentially a container APK containing the necessary libraries.
This reduces the APK size and reduces the risk of users enabling ANGLE
by accident.
Additionally, ANGLE is being marked product-specific to remove it from
all AOSP builds.
Bug: b/187345862
Change-Id: I6e1acb9c6e07b419d40aee43d7260060027999ec
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2876213
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Tim Van Patten <timvp@google.com>
Remove dynamic year generation from generator scripts, as required by
the Chromium C++ style guide.
The dynamic year values were replaced by the current year at the time
the file was created according to git log. The code to dynamically
generate the year was removed.
This patch also refreshes generated files and hashes.
Bug: angleproject:5516
Change-Id: I735028bccb5c83217e92c380538f1abf0a906b2c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2690950
Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
... to support using ANGLE as a native GL driver.
Note: this will not affect devices installing the APK with
`PRODUCT_PACKAGES += ANGLE` and will *not* also install the
libs to vendor.
Bug: b/147316305
Bug: angleproject:5456
Test: ./scripts/roll_aosp.sh and build in AOSP
Change-Id: I98cab8d0735a4f66293ac063e0eef2ae7ddbee7b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2618529
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Tim Van Patten <timvp@google.com>
Add a --copy-to-vendor-partition optional argument to both roll_aosp.sh
and generate_android_bp.py. When specified the root targets will be
generated with vendor: true and a relative install path to egl folder,
so that we can use ANGLE as the Android OpenGLES driver when the system
starts up.
Test: run roll_aosp.sh --copy-to-vendor-partion, build the Android image
with m -j72, load the image with the Android emulator and find all ANGLE
related *.so's are under the /vendor/lib/egl folder.
Bug: angleproject:5456
Change-Id: I38c64e8ea3ad5f5d0cc0b8cd77856f49109b23c7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2568907
Commit-Queue: Tim Van Patten <timvp@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Android builds are failing due to .git/HEAD being listed in the
Android.bp, which generate_android_bp.py is supposed to remove. The
problem is that the blacklist contains '//third_party/angle/.git/HEAD'
rather than '//.git/HEAD', due to generating the GN files from
chromium/src/ rather than angle/. This CL cleans this up.
Bug: b/160727922
Test: Manual script execution and building in AOSP
Change-Id: Ia1682605097791d20b28686f3043ddc08d49ca52
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2310960
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Tim Van Patten <timvp@google.com>
With the introduction of ABI-specific build targets (zlib), the script
generate_android_bp.py needs to be updated to consume ABI-specific gn
descriptions and generate ABI-specific build rules for each target.
The roll_aosp.sh script was updated to generate ABI-specific gn
descriptions for each:
arm
arm64
x86
x64
Bug: b/160727922
Test: Manual script execution and building in AOSP
Change-Id: I459b388176f8fcc010f9f5668535d941b931cdd4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2285272
Commit-Queue: Tim Van Patten <timvp@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
generate_android_bp.py prepends "angle_" to target names to avoid
conflicts with other Android projects. This can sometimes generate
conflicts when there are two targets such as "angle_vulkan_headers"
and "vulkan_headers".
This patch turns the gn path+target into the blueprint target name.
BUG= b/155396154
Change-Id: I7a709013969ae8e312a781a2fd3c1ec530fca430
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2173833
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Per the Mainline requirement to setup coverage for APIs used by
modules, we need to add the plugin 'java_api_finder' to ANGLE's
Android.bp to enable the instrumentation.
Bug: b:148987998
Test: Generate Android.bp, verify GoogleANGLE can build in goog/master
Change-Id: Id3d82f18ecb9ff6a57cda4a60f14cd2464dff234
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2145236
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Tim Van Patten <timvp@google.com>
GoogleANGLE will be signed in a different part of Android so it needs to
be able to reference ANGLE's target and defaults to override certain
properties.
Update the manifests to request the needed permissions to use the
developer options.
Bug: b:142320172
Change-Id: Ia47815ab53f8de66332412efa2cc0fca3175e2cc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2096815
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Geoff Lang <geofflang@chromium.org>