Skip to content

iOS: Change release artifacts to use xcframeworks#2217

Merged
jpsim merged 17 commits intomainfrom
jp-xcframework
May 10, 2022
Merged

iOS: Change release artifacts to use xcframeworks#2217
jpsim merged 17 commits intomainfrom
jp-xcframework

Conversation

@jpsim
Copy link
Contributor

@jpsim jpsim commented Apr 26, 2022

Fixes #2215 & #2216

See discussion on Slack.

Risk Level: Low to existing users since the previous frameworks don't appear to have really been working, or been in use
Testing: Validated on CI, locally with pod spec lint pointing to the new zip format, locally with SwiftPM, locally by dragging & dropping the xcframework into an Xcode project.
Docs Changes: None
Release Notes: Added

Signed-off-by: JP Simard jp@jpsim.com

Fixes #2215 & #2216

Signed-off-by: JP Simard <jp@jpsim.com>
@jpsim jpsim marked this pull request as ready for review April 26, 2022 20:29
@jpsim jpsim requested review from Augustyniak and keith April 26, 2022 20:29
@jpsim jpsim linked an issue Apr 26, 2022 that may be closed by this pull request
* main:
  Add new version history section (#2209)
  build: simplify jnilib copy (#2214)

Signed-off-by: JP Simard <jp@jpsim.com>
Signed-off-by: JP Simard <jp@jpsim.com>
@jpsim
Copy link
Contributor Author

jpsim commented Apr 27, 2022

I measured the final app size impact of integrating Envoy Mobile in an iOS app to be ~5MB when statically linked and ~9MB when dynamically linked.

We can optimize binary size further in the future, but for now I believe that moving to dynamic xcframeworks gives the best developer experience by resolving the issues described in #2215 & #2216.

@jpsim jpsim requested a review from keith April 27, 2022 16:42
jpsim added 2 commits April 27, 2022 16:02
Update rules_apple to have xcframework improvements

bazelbuild/rules_apple#1443

Signed-off-by: JP Simard <jp@jpsim.com>
Started a conversation in the Envoy Slack about adopting rolling bazel
releases in general: https://envoyproxy.slack.com/archives/C7E6C71QB/p1651089150478729

It would be nice to stay in sync with Envoy to avoid any
incompatibilities.

Signed-off-by: JP Simard <jp@jpsim.com>
@jpsim
Copy link
Contributor Author

jpsim commented Apr 27, 2022

I changed to use static xcframeworks in the last commits, since I got that working after pulling in bazelbuild/rules_apple#1443 and updating the bazel version to 6.0.0-pre.20220414.2.

I started a conversation in the Envoy Slack about adopting rolling bazel releases in general: https://envoyproxy.slack.com/archives/C7E6C71QB/p1651089150478729

It would be nice to stay in sync with Envoy to avoid any incompatibilities, but we used to have separate bazel versions prior to #1925 and I think if we get clear wins from updating sooner it should be considered.

@jpsim
Copy link
Contributor Author

jpsim commented Apr 27, 2022

Seems like our java runtime setup broke somewhere in bazelbuild/bazel@6.0.0-pre.20220208.2...6.0.0-pre.20220216.3

@keith
Copy link
Member

keith commented Apr 27, 2022

Yea I hit that locally when testing this as well, there are some flags in the .bazelrc, I think ideally we would be passing --java_runtime_version=remotejdk_11 --tool_java_runtime_version=remotejdk_11 but I haven't debugged more

jpsim added 3 commits April 27, 2022 16:54
Signed-off-by: JP Simard <jp@jpsim.com>
Signed-off-by: JP Simard <jp@jpsim.com>
* main:
  Cleanup: remove the unused stats sink metrics_service (#2220)
  bazel: move back to symbol mapping table files (#2218)

Signed-off-by: JP Simard <jp@jpsim.com>
@jpsim
Copy link
Contributor Author

jpsim commented Apr 28, 2022

Another benefit of moving to xcframeworks is that we get Swift Package Manager support for free.

.binaryTarget(
  name: "Envoy",
  url: "https://github.com/envoyproxy/envoy-mobile/releases/download/v0.4.6/Envoy.xcframework.zip",
  checksum: "..."
)

jpsim added 3 commits April 28, 2022 13:06
SwiftPM & CocoaPods expect different structures in the zip archive

* SwiftPM needs the framework to be at the top-level of the zip file
* CocoaPods needs the framework to be zipped in a folder including the
  license file

Signed-off-by: JP Simard <jp@jpsim.com>
Signed-off-by: JP Simard <jp@jpsim.com>
Signed-off-by: JP Simard <jp@jpsim.com>
@jpsim
Copy link
Contributor Author

jpsim commented Apr 28, 2022

Seems like our java runtime setup broke somewhere in bazelbuild/bazel@6.0.0-pre.20220208.2...6.0.0-pre.20220216.3

Bisected the failure to bazelbuild/bazel@d5559c1

I don't have any ideas to explore to resolve the issue. Passing --java_runtime_version=remotejdk_11 --tool_java_runtime_version=remotejdk_11 doesn't appear to help.

@keith
Copy link
Member

keith commented Apr 28, 2022

Thanks that was super helpful, I believe this fixes that issue: #2227

keith pushed a commit to envoyproxy/envoy that referenced this pull request Apr 29, 2022
https://github.com/bazelbuild/bazel/releases/tag/6.0.0-pre.20220414.2

As [discussed in Slack][slack], there are a number of disadvantages to
staying on LTS releases.

This can also help unblock Envoy Mobile's iOS releases:
envoyproxy/envoy-mobile#2217

[slack]: https://envoyproxy.slack.com/archives/C7E6C71QB/p1651089150478729

Signed-off-by: JP Simard <jp@jpsim.com>
jpsim added 3 commits May 2, 2022 15:18
* origin/main:
  Bump rules_apple to 0.34.2 (#2236)
  Bump Lyft Support Rotation (#2232)
  ci: add support for `/retest` command (#2219)
  format: add SwiftLint to check-format script (#2230)
  use 64 bit emulators for test (#2228)
  envoy: update to `d0befbb` & add `h2ExtendKeepaliveTimeout` (#2229)
  Add Ryan Hamilton to OWNERS.md (#2224)
  Android cert verifier: first import from chromium/net (#2222)

Signed-off-by: JP Simard <jp@jpsim.com>
Signed-off-by: JP Simard <jp@jpsim.com>
Signed-off-by: JP Simard <jp@jpsim.com>
@jpsim
Copy link
Contributor Author

jpsim commented May 2, 2022

/retest

* main:
  envoy: update to efbbb04 (#2258)
  Update rules_java, rules_detekt, rules_jvm_external (#2249)
  Upgrade rules_jvm_external from 4.1 -> 4.2 (#2254)
  CancelProofEnvoyStream (#2250)
  swift: add DrString tool & fix documentation comment issues (#2233)
  Fix `bump_lyft_support_rotation.sh` posting to Slack (#2234)
  jni: fix mismatched return value types (#2252)
  Remove bintray as a maven source (#2248)
  test: refine connection drain test (#2245)
  cleanup: remove comment in Http::Client that no longer applies (#2203)
  cleanup: fix test with inaccurate description (#2202)
  network: perform post-DNS connection drain on a per-host basis (#2240)
  network: add enableDrainPostDnsRefresh to iOS (#2242)
  envoy: update to em-cherry (#2241)
  network: support draining connections after triggered DNS refresh (#2225)

Signed-off-by: JP Simard <jp@jpsim.com>
@jpsim jpsim marked this pull request as draft May 6, 2022 18:03
@jpsim jpsim marked this pull request as ready for review May 6, 2022 19:08
@jpsim
Copy link
Contributor Author

jpsim commented May 6, 2022

With main now on bazel 6.x, this is ready for review without any egregious hacks.

keith
keith previously approved these changes May 9, 2022
Augustyniak
Augustyniak previously approved these changes May 9, 2022
@jpsim
Copy link
Contributor Author

jpsim commented May 9, 2022

I'm waiting on #2184 to merge this to not cause more work in that PR.

@jpsim jpsim dismissed stale reviews from Augustyniak and keith via ba0e987 May 10, 2022 21:06
@jpsim jpsim requested a review from keith May 10, 2022 21:06
* 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>
@jpsim jpsim force-pushed the jp-xcframework branch from ba0e987 to e2763aa Compare May 10, 2022 21:06
keith
keith previously approved these changes May 10, 2022
@jpsim
Copy link
Contributor Author

jpsim commented May 10, 2022

I didn't merge the release.yml GitHub Actions workflow properly. Updating.

Signed-off-by: JP Simard <jp@jpsim.com>
@jpsim jpsim merged commit 46d84f6 into main May 10, 2022
@jpsim jpsim deleted the jp-xcframework branch May 10, 2022 21:57
jpsim added a commit that referenced this pull request May 12, 2022
* 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>
ravenblackx pushed a commit to ravenblackx/envoy that referenced this pull request Jun 8, 2022
https://github.com/bazelbuild/bazel/releases/tag/6.0.0-pre.20220414.2

As [discussed in Slack][slack], there are a number of disadvantages to
staying on LTS releases.

This can also help unblock Envoy Mobile's iOS releases:
envoyproxy/envoy-mobile#2217

[slack]: https://envoyproxy.slack.com/archives/C7E6C71QB/p1651089150478729

Signed-off-by: JP Simard <jp@jpsim.com>
oschaaf pushed a commit to maistra/envoy that referenced this pull request Oct 26, 2022
https://github.com/bazelbuild/bazel/releases/tag/6.0.0-pre.20220414.2

As [discussed in Slack][slack], there are a number of disadvantages to
staying on LTS releases.

This can also help unblock Envoy Mobile's iOS releases:
envoyproxy/envoy-mobile#2217

[slack]: https://envoyproxy.slack.com/archives/C7E6C71QB/p1651089150478729

Signed-off-by: JP Simard <jp@jpsim.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CocoaPods 0.4.6 release does not compile iOS framework missing arm64 simulator slice

3 participants