Conversation
jpsim
left a comment
There was a problem hiding this comment.
Great simplification, thanks!
| build --verbose_failures | ||
| build --workspace_status_command=envoy/bazel/get_workspace_status | ||
| build --xcode_version=13.2.1 | ||
| build --use_top_level_targets_for_symlinks |
There was a problem hiding this comment.
Yea so if you use bazel transitions, which the apple rules do, you get some path like bazel-out/foo/bar-RANDOMJUNK/path/to/artifact, with this flag it also creates the usual bazel-bin/path/to/artifact. It has one limitation that it doesn't work through alias targets bazelbuild/bazel#14602 so in some cases on CI I use the real target name. Locally this shouldn't matter much since folks will just copy paste, but on CI it makes it stable
goaway
left a comment
There was a problem hiding this comment.
Thanks @keith, appreciate you work to explore alternatives here. As it stands, I'm not totally sold on the current set of proposed changes in this PR.
The dist/ setup was part of a deliberate decision we made early on to ensure the example apps did not utilize Bazel targets and did leverage the artifacts we expect most users of the library to consume - the .aar and the .framework.
While I agree that having the non-hermetic dist/ directory runs counter to general bazel philosphy - and this is unfortunate - I still feel that having the example apps rely on internal targets makes them less generally helpful for the average potential user, since we're no longer demonstrating how the distributable packages can be used.
Arguably, we could set up the examples as even more traditional Android and iOS projects that don't rely on Bazel at all, as most folks are likely not using Bazel to build their app.
Would also be interested in discussing other possibilities.
|
The other piece to this, that is perhaps even more significant, is that having the test apps depend on the distributable packages allows us to actually test the viability of the packages in CI. We'd miss that coverage if we switched exclusively to internal bazel targets for tests. |
This is exactly the point I was going to make, we can and should have validation on CI for all our supported installation methods, I'm happy to spend time setting up that infra. Keeping the bazel parts hermetic is a big win. |
5ca56af to
d59739f
Compare
|
I pushed an update which allows us to import the framework directly just as before with the help of a small rule. This should negate any concerns about this behavior being different than dist/ before |
|
Thanks @keith, your update definitely helps to allay my concern about the CI coverage aspect. Out of curiosity, if we were to move in the direction of setting up example apps specifically as more traditional Xcode/Android Studio projects (i.e. without Bazel, necessarily), do you have any ideas for what that might look like with this setup? |
A vanilla Xcode project could refer to the |
8d23ad5 to
d511f49
Compare
Previously the dist/ contained archives built for either platform, that were then included by other targets to be used in the example apps. This had the benefit of demonstrating how the targets could be used in a bazel setup. The downside with this approach is that it was required to be non-hermetic, and made builds a 2 step process that you had to go through if you wanted to test framework changes. This is now removed and replaced with a more standard bazel setup where the example targets reference other targets in the build, removing the need for 2 steps. This also eliminates issues caused by manually editing the files in the dist/ directory, which bazel wouldn't pick up since it was non-hermetic. For android this is a no-op because we still continue to include the aar directly, for iOS this isn't currently possible because the `apple_static_framework_import` rule requires a list of files, which isn't possible to compute from the zip file produced by the `ios_static_framework` rule that is only meant for distribution. Instead the examples now depend on the `swift_library` directly, which is slightly different, but shouldn't be different enough to cause significant issues. Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
d511f49 to
b9cc4cb
Compare
Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
b9cc4cb to
b1857cd
Compare
Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
jpsim
left a comment
There was a problem hiding this comment.
+1
Some notes:
-
This reorganizes the Android/iOS example apps CI jobs from being an initial step to build Envoy Mobile, uploading the release artifact as a GitHub Actions artifact, the spawning multiple jobs for each example app that downloads the built Envoy Mobile. The new format builds and runs all example apps in parallel, which will shorten overall CI time, but won't benefit from reusing a single cached built artifact, but with bazel's reproducibility and caching features, this shouldn't really be a problem.
-
We should invest in a validation suite that integrates Envoy Mobile in all our supported installation methods the same way a user would integrate it. The
framework_imports_extractoris an impressive trick to get close to that on the iOS front, but does not really reflect how our users would integrate the framework in Xcode without bazel, and doesn't validate our other supported installation methods.
| # or in the upstream checker. | ||
| ENVOY_BAZEL_PREFIX=@envoy envoy/tools/code_format/check_format.py \ | ||
| --add-excluded-prefixes ./envoy/ ./envoy_build_config/extensions_build_config.bzl ./WORKSPACE ./dist/Envoy.framework/ ./library/common/config_template.cc ./bazel/envoy_mobile_swift_bazel_support.bzl ./bazel/envoy_mobile_repositories.bzl \ | ||
| --add-excluded-prefixes ./envoy/ ./envoy_build_config/extensions_build_config.bzl ./WORKSPACE ./dist/ ./library/common/config_template.cc ./bazel/envoy_mobile_swift_bazel_support.bzl ./bazel/envoy_mobile_repositories.bzl \ |
There was a problem hiding this comment.
Can remove dist completely:
| --add-excluded-prefixes ./envoy/ ./envoy_build_config/extensions_build_config.bzl ./WORKSPACE ./dist/ ./library/common/config_template.cc ./bazel/envoy_mobile_swift_bazel_support.bzl ./bazel/envoy_mobile_repositories.bzl \ | |
| --add-excluded-prefixes ./envoy/ ./envoy_build_config/extensions_build_config.bzl ./WORKSPACE ./library/common/config_template.cc ./bazel/envoy_mobile_swift_bazel_support.bzl ./bazel/envoy_mobile_repositories.bzl \ |
Same with the line a bit further down.
There was a problem hiding this comment.
I was worried about removing this while folks still have this ignored directory locally. maybe we wait and delete in the future?
This was actually substantial performance improvement O(hours) to CI at least prior to having RBE. The app tests are somewhat more prone to flakiness due to network faults and the like, and previously having to rebuild the entire library to rerun them was extremely painful. Do we have RBE caching effectively across runs?
This was the essence of my question above - I feel the example apps are if anything moving away from being representative of an "example" of how to use Envoy Mobile from an average user's perspective. To your response @jpsim, are the .framework and .aar output to stable directories inside bazel-bin? |
Yes, the RBE cache should be pretty effective, and in fact probably even more now that we've removed the non-cached, non-hermetic artifacts in As a point of comparison,
Yes, the |
With this change, the app code still runs on top of the real distributable artifact, but what you shared offline is something slightly different, and still valuable, which is the ability to more easily build the framework and the app with different build settings. As it stands now, with building the app also building the framework, those build settings propagate unless you go add explicit setting overrides to where the targets are defined. I think the building an installation method validation suite I've suggested here would achieve that. |
* main: build: remove dist/ (#2184) Fix Envoy Mobile bug where writing prevents the read loop from running, (#2221) Add comments to CronetBidirectionalStream (#2266) CronetBidirectionalStream (#2164) ci: update build image (#2261) Bump Lyft Support Rotation (#2260) Signed-off-by: JP Simard <jp@jpsim.com>
* main: build: remove dist/ (#2184) Fix Envoy Mobile bug where writing prevents the read loop from running, (#2221) Add comments to CronetBidirectionalStream (#2266) CronetBidirectionalStream (#2164) ci: update build image (#2261) Bump Lyft Support Rotation (#2260) Signed-off-by: JP Simard <jp@jpsim.com>
* main: Add assert when failing to get_env (#2253) Update Kotlin standard libraries to 1.6.21 (#2256) iOS: Change release artifacts to use xcframeworks (#2217) build: remove dist/ (#2184) Fix Envoy Mobile bug where writing prevents the read loop from running, (#2221) Add comments to CronetBidirectionalStream (#2266) CronetBidirectionalStream (#2164) Signed-off-by: JP Simard <jp@jpsim.com>
`android_dist_ci` was a superset of `android_dist` and `android_dist` stopped working in #2184. Signed-off-by: JP Simard <jp@jpsim.com>
`android_dist_ci` was a superset of `android_dist` and `android_dist` stopped working in #2184. Signed-off-by: JP Simard <jp@jpsim.com>
Description: Per our documentation, the following should be true "While breaking on a C++ function, Android Studio should present the source file and highlight the line where the breakpoint hit with all scope information". That feature did not work - I didn't confirm this but it's possible that the functionality was broken when #2184 was merged. Anyway, the issue was that https://github.com/envoyproxy/envoy-mobile/blob/581ba40f2f8597243efccb2bdccade8193ff4559/.bazelrc#L44 config setting was not applied when Envoy Mobile was built for the runs of example apps. This has been fixed by making run configurations that are used by Envoy Mobile example apps specify `--config=dbg` setting explicitly. Risk Level: None Testing: Confirmed that Android Studio opens the right file (and highlights the right line) when EnvoyMobile breakpoint is hit. Docs Changes: N/A Release Notes: N/A Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com>
Description: Per our documentation, the following should be true "While breaking on a C++ function, Android Studio should present the source file and highlight the line where the breakpoint hit with all scope information". That feature did not work - I didn't confirm this but it's possible that the functionality was broken when envoyproxy/envoy-mobile#2184 was merged. Anyway, the issue was that https://github.com/envoyproxy/envoy-mobile/blob/d8cd0d96bbd38c4fe4133b3b4322f6a8095e0a68/.bazelrc#L44 config setting was not applied when Envoy Mobile was built for the runs of example apps. This has been fixed by making run configurations that are used by Envoy Mobile example apps specify `--config=dbg` setting explicitly. Risk Level: None Testing: Confirmed that Android Studio opens the right file (and highlights the right line) when EnvoyMobile breakpoint is hit. Docs Changes: N/A Release Notes: N/A Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com> Signed-off-by: JP Simard <jp@jpsim.com>
Previously the dist/ contained archives built for either platform, that
were then included by other targets to be used in the example apps. This
had the benefit of demonstrating how the targets could be used in a
bazel setup. The downside with this approach is that it was required to
be non-hermetic, and made builds a 2 step process that you had to go
through if you wanted to test framework changes. This is now removed and
replaced with a more standard bazel setup where the example targets
reference other targets in the build, removing the need for 2 steps.
This also eliminates issues caused by manually editing the files in the
dist/ directory, which bazel wouldn't pick up since it was non-hermetic.
For android this is a no-op because we still continue to include the aar
directly, for iOS this isn't currently possible because the
apple_static_framework_importrule requires a list of files, whichisn't possible to compute from the zip file produced by the
ios_static_frameworkrule that is only meant for distribution. Insteadthe examples now depend on the
swift_librarydirectly, which isslightly different, but shouldn't be different enough to cause
significant issues.
Signed-off-by: Keith Smiley keithbsmiley@gmail.com