Skip to content

Commit

Permalink
Move ANGLE to flutter/third_party (#51270)
Browse files Browse the repository at this point in the history
This moves Flutter out of the buildroot's third_party directory and into
//flutter/third_party and updates all BUILD and gni files.

Issue: flutter/flutter#144786
Part of: flutter/flutter#67373

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] The odds of this passing on its first CI run is 0%, because
there's no way the licence script isn't going to have a fit over it, at
which point I promise on my honour that I will dutifully fix all the
things it complains about and re-run, probably more than once.
- [X] This PR fulfils the minimum [Canadian
Content](https://www.youtube.com/watch?v=h9NMnPm5kXc&list=PLJ7QPuvv91JuoPWrLhqX0zDFUoLdynMEk&index=3)
regulations mandated by the CRTC.
- [X] I signed the [CLA].
- [X] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
  • Loading branch information
cbracken committed Mar 8, 2024
1 parent 9a2367f commit bbb1ed0
Show file tree
Hide file tree
Showing 13 changed files with 5,722 additions and 5,888 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ deps = {
'src/flutter/third_party/swiftshader':
Var('swiftshader_git') + '/SwiftShader.git' + '@' + '2fa7e9b99ae4e70ea5ae2cc9c8d3afb43391384f',

'src/third_party/angle':
'src/flutter/third_party/angle':
Var('chromium_git') + '/angle/angle.git' + '@' + '6a09e41ce6ea8c93524faae1a925eb01562f53b1',

'src/third_party/vulkan_memory_allocator':
Expand Down
2 changes: 1 addition & 1 deletion build_overrides/angle.gni
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import("//build/toolchain/toolchain.gni")

# The ANGLE build requires this file to point to the location of third-party
# dependencies.
angle_root = "//third_party/angle"
angle_root = "//flutter/third_party/angle"

angle_vma_version = 30000001

Expand Down
2 changes: 1 addition & 1 deletion ci/licenses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function verify_licenses() (

local actualLicenseCount
actualLicenseCount="$(tail -n 1 flutter/ci/licenses_golden/licenses_flutter | tr -dc '0-9')"
local expectedLicenseCount=843 # When changing this number: Update the error message below as well describing the newly expected license types.
local expectedLicenseCount=878 # When changing this number: Update the error message below as well describing the newly expected license types.

if [[ $actualLicenseCount -ne $expectedLicenseCount ]]; then
echo "=============================== ERROR ==============================="
Expand Down
290 changes: 145 additions & 145 deletions ci/licenses_golden/excluded_files

Large diffs are not rendered by default.

5,435 changes: 5,434 additions & 1 deletion ci/licenses_golden/licenses_flutter

Large diffs are not rendered by default.

5,817 changes: 109 additions & 5,708 deletions ci/licenses_golden/licenses_third_party

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ci/licenses_golden/tool_signature
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Signature: 6869bf83ae9a2e71a9302f51626429a0
Signature: 3d3a0db1d0e7f5b2fe1f3739e50795f8

4 changes: 2 additions & 2 deletions impeller/golden_tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ if (is_mac) {
"//flutter/impeller/aiks",
"//flutter/impeller/aiks:aiks_unittests_golden",
"//flutter/impeller/fixtures",
"//flutter/third_party/angle:libEGL",
"//flutter/third_party/angle:libGLESv2",
"//flutter/third_party/googletest:gtest",
"//flutter/third_party/swiftshader",
"//third_party/angle:libEGL",
"//third_party/angle:libGLESv2",
]
}
}
6 changes: 3 additions & 3 deletions impeller/renderer/backend/gles/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import("../../../tools/impeller.gni")
config("gles_config") {
# Generic GL/GLES/EGL/Vulkan headers. Any will do. We just pick one from Angle
# because they are there.
include_dirs = [ "//third_party/angle/include" ]
include_dirs = [ "//flutter/third_party/angle/include" ]
}

impeller_component("gles_unittests") {
Expand Down Expand Up @@ -85,11 +85,11 @@ impeller_component("gles") {
if (!is_android && !is_fuchsia) {
public_configs = [ ":gles_config" ]
sources += [
"//third_party/angle/include/GLES2/gl2ext.h",
"//flutter/third_party/angle/include/GLES2/gl2ext.h",

# The GLES3 API is a superset of GLES2. Although we target GLES2, we use
# some GLES3 features if the driver supports them.
"//third_party/angle/include/GLES3/gl3.h",
"//flutter/third_party/angle/include/GLES3/gl3.h",
]
}

Expand Down
4 changes: 2 additions & 2 deletions shell/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,9 @@ if (enable_unittests) {

if (shell_enable_gl) {
deps += [
"//flutter/third_party/angle:libEGL_static",
"//flutter/third_party/angle:libGLESv2_static",
"//flutter/third_party/swiftshader",
"//third_party/angle:libEGL_static",
"//third_party/angle:libGLESv2_static",
]
}
}
Expand Down
16 changes: 8 additions & 8 deletions shell/platform/windows/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ _public_headers = [ "public/flutter_windows.h" ]
_internal_headers = [ "flutter_windows_internal.h" ]

config("relative_angle_headers") {
include_dirs = [ "//third_party/angle/include" ]
include_dirs = [ "//flutter/third_party/angle/include" ]
}

# Any files that are built by clients (client_wrapper code, library headers for
Expand Down Expand Up @@ -138,7 +138,7 @@ source_set("flutter_windows_source") {

configs += [
"//flutter/shell/platform/common:desktop_library_implementation",
"//third_party/angle:gl_prototypes",
"//flutter/third_party/angle:gl_prototypes",
]

public_configs = [ ":relative_angle_headers" ]
Expand All @@ -161,13 +161,13 @@ source_set("flutter_windows_source") {
"//flutter/shell/platform/common/client_wrapper:client_wrapper",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
"//flutter/shell/platform/windows/client_wrapper:client_wrapper_windows",

# libEGL_static MUST be ordered before libGLESv2_static in this list. If
# reversed, a linker error will occur, reporting DllMain already defined in
# LIBCMTD.lib
"//flutter/third_party/angle:libEGL_static",
"//flutter/third_party/angle:libGLESv2_static",
"//flutter/third_party/rapidjson",
"//third_party/angle:libEGL_static", # the order of libEGL_static and
# libGLESv2_static is important.. if
# reversed, will cause a linker error
# DllMain already defined in
# LIBCMTD.lib
"//third_party/angle:libGLESv2_static",
]
}

Expand Down
6 changes: 3 additions & 3 deletions testing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,13 @@ if (use_swiftshader) {

configs -= [ "//build/config/clang:extra_warnings" ]
configs += [
"//third_party/angle:gl_prototypes",
"//flutter/third_party/angle:gl_prototypes",
"//flutter/third_party/swiftshader:swiftshader_config",
]
deps += [
"//flutter/third_party/angle:libEGL_static",
"//flutter/third_party/angle:libGLESv2_static",
"//flutter/third_party/swiftshader",
"//third_party/angle:libEGL_static",
"//third_party/angle:libGLESv2_static",
]
}
}
24 changes: 12 additions & 12 deletions tools/licenses/lib/paths.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ final Set<String> skippedPaths = <String>{
r'flutter/lib/web_ui/dev', // these are build tools; they do not end up in Engine artifacts
r'flutter/prebuilts',
r'flutter/sky/packages/sky_engine/LICENSE',
r'flutter/third_party/angle/android',
r'flutter/third_party/angle/doc',
r'flutter/third_party/angle/extensions',
r'flutter/third_party/angle/infra',
r'flutter/third_party/angle/scripts',
r'flutter/third_party/angle/src/libANGLE/renderer/metal/doc',
r'flutter/third_party/angle/src/libANGLE/renderer/vulkan/doc',
r'flutter/third_party/angle/src/third_party/volk', // We don't use Vulkan in our ANGLE build.
r'flutter/third_party/angle/third_party', // Unused by Flutter: BUILD files with forwarding targets (but no code).
r'flutter/third_party/angle/tools', // These are build-time tools, and aren't shipped.
r'flutter/third_party/angle/util',
r'flutter/third_party/benchmark', // only used by tests
r'flutter/third_party/boringssl/src/crypto/err/err_data_generate.go',
r'flutter/third_party/boringssl/src/fuzz', // testing tools, not shipped
Expand Down Expand Up @@ -161,17 +172,6 @@ final Set<String> skippedPaths = <String>{
r'out', // output of build
r'third_party/android_embedding_dependencies', // Not shipped. Used only for the build-time classpath, and for the in-tree testing framework for Android
r'third_party/android_tools', // excluded on advice
r'third_party/angle/android',
r'third_party/angle/doc',
r'third_party/angle/extensions',
r'third_party/angle/infra',
r'third_party/angle/scripts',
r'third_party/angle/src/libANGLE/renderer/metal/doc',
r'third_party/angle/src/libANGLE/renderer/vulkan/doc',
r'third_party/angle/src/third_party/volk', // We don't use Vulkan in our ANGLE build.
r'third_party/angle/third_party', // Unused by Flutter: BUILD files with forwarding targets (but no code).
r'third_party/angle/tools', // These are build-time tools, and aren't shipped.
r'third_party/angle/util',
r'third_party/dart/benchmarks', // not shipped in binary
r'third_party/dart/build', // not shipped in binary
r'third_party/dart/docs', // not shipped in binary
Expand Down Expand Up @@ -461,11 +461,11 @@ final List<Pattern> skippedFilePatterns = <Pattern>[
RegExp(r'^flutter/lib/web_ui/lib/assets/ahem\.ttf$', expectNoMatch: true), // this gitignored file exists only for testing purposes
RegExp(r'^flutter/sky/packages/sky_engine/LICENSE$'), // that is the output of this script
RegExp(r'^flutter/third_party/abseil-cpp/(?:.+/)*[^/]+_test\.[^/]+$'),
RegExp(r'^flutter/third_party/angle/(?:.+/)*[^/]+_unittest\.[^/]+$'),
RegExp(r'^flutter/third_party/boringssl/(?:.+/)*[^/]+_test\.[^/]+$'),
RegExp(r'^flutter/third_party/boringssl/src/crypto/fipsmodule/bn/[^/]+.go$'),
RegExp(r'^flutter/third_party/boringssl/src/crypto/fipsmodule/ec/[^/]+.go$'),
RegExp(r'^flutter/third_party/freetype2/docs/(?!FTL\.TXT$).+'), // ignore all documentation except the license
RegExp(r'^third_party/angle/(?:.+/)*[^/]+_unittest\.[^/]+$'),
RegExp(r'^third_party/dart/(?:.+/)*[^/]+_test\.[^/]+$'),
RegExp(r'^third_party/zlib/(?:.+/)*[^/]+_unittest\.[^/]+$'),
];

0 comments on commit bbb1ed0

Please sign in to comment.