Skip to content

Integrate rules_xcodeproj#2263

Merged
jpsim merged 3 commits intomainfrom
rules_xcodeproj
May 12, 2022
Merged

Integrate rules_xcodeproj#2263
jpsim merged 3 commits intomainfrom
rules_xcodeproj

Conversation

@jpsim
Copy link
Contributor

@jpsim jpsim commented May 10, 2022

  • Add rules_xcodeproj to envoy_mobile_repositories.bzl
  • Update rules_apple
  • Add a top-level :xcodeproj target
  • Add ios_local docs similar to the existing android_local docs
  • Update iOS example apps to use //library/swift:ios_lib for an improved development experience
  • Define apple.experimental.tree_artifact_outputs=1 in .bazelrc, which rules_xcodeproj requires
  • Make example/test apps visible to the xcodeproj target

Risk Level: Low, only affects local development.
Testing: Using Xcode features in local development.
Docs Changes: Added ios_local docs similar to the existing android_local docs
Release Notes: N/A, internal only

Xcode Instruments

@jpsim jpsim force-pushed the rules_xcodeproj branch from c358e95 to a354893 Compare May 10, 2022 02:29
* Add rules_xcodeproj to `envoy_mobile_repositories.bzl`
* Update rules_apple
* Add a top-level `:xcodeproj` target
* Add `ios_local` docs similar to the existing `android_local` docs
* Update iOS example apps to use `//library/swift:ios_lib` for an
  improved development experience
* Define `apple.experimental.tree_artifact_outputs=1` in `.bazelrc`,
  which rules_xcodeproj requires
* Make example/test apps visible to the `xcodeproj` target

Signed-off-by: JP Simard <jp@jpsim.com>
@jpsim jpsim force-pushed the rules_xcodeproj branch from a354893 to d5b16f3 Compare May 10, 2022 02:50
@jpsim jpsim marked this pull request as ready for review May 10, 2022 03:07
@jpsim jpsim requested a review from keith May 10, 2022 17:30
.bazelrc Outdated
build --verbose_failures
build --workspace_status_command=envoy/bazel/get_workspace_status
build --xcode_version=13.2.1
build --define=apple.experimental.tree_artifact_outputs=1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably won't want this globally otherwise you'll have to manually zip the artifacts for distribution.

Copy link
Contributor Author

@jpsim jpsim May 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This didn't seem to affect the distribution (see CI run), but it did break the framework_imports_extractor rule, which is breaking the Objective-C Hello World example app.

I could use your help to update that if you have the time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make rules_xcodeproj pass this as needed instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we can otherwise read this in the rule, and branch on that to just re-propagate the same files in that rule tho, but in general i think the zip is normally preferred just for ease of moving it around

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in theory rules_xcodeproj can be configured to unarchive the files itself if this flag is off: https://github.com/buildbuddy-io/rules_xcodeproj/blob/06854652458c21da467ddff4fd4129c29ff137b1/xcodeproj/internal/top_level_targets.bzl#L74-L76

However, there may be a bug in its implementation for this because when I try to do that I get this error:

Framework with file path "FilePath(type: generator.FilePath.PathType.generated, path: ios-sim_arm64-min12.0-applebin_ios-ios_sim_arm64-dbg-ST-aa7db8051c58/bin/Envoy.framework, isFolder: false)" not found in `files`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to remove this and get around that archived_bundles_allowed issue by removing the Objective-C app from the Xcode project. I'll follow up on fixing that in rules_xcodeproj.

name: 'Short-circuit'
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./bazelw build --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //examples/swift/hello_world:app
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be easiest to drop this file changes to avoid conflicts with the dist change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'll update this PR once the dist changes merge.

jpsim added 2 commits May 12, 2022 08:41
* 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>
By setting `archived_bundles_allowed = True` in the xcodeproj setup and
excluding the Objective-C example app from the generated Xcode project.

Signed-off-by: JP Simard <jp@jpsim.com>
@jpsim jpsim merged commit 3ebdacc into main May 12, 2022
@jpsim jpsim deleted the rules_xcodeproj branch May 12, 2022 18:56
jpsim added a commit that referenced this pull request May 17, 2022
* origin/main: (97 commits)
  docs: update python packages to work with Python 3.10 (#2286)
  test: adding a cancel test, cleaning up copy-paste code (#2283)
  envoy: update to d88f31b (#2279)
  api: disallow setting 'host' header directly (#2275)
  android: add support for registering a platform KV store (#2134)
  Bump Lyft Support Rotation (#2278)
  tools: Enable the VSCode completion db to use bazelisk if available (#2277)
  Release v0.4.6.20220513-4
  Fix android_release_deploy
  Release v0.4.6.20220513-3
  Release v0.4.6.20220513-2
  net: enable happy eyeballs by default (#2272)
  git: avoid merge conflicts when adding changelog entries (#2273)
  docs: fix sphinx reference mismatch warning (#2274)
  tests: add -Xcheck:jni to kotlin integration tests by default (#2269)
  configuration: enable h2 ping by default (#2270)
  Add version history entries for user-facing changes (#2271)
  configuration: filter unroutable addresses on Android by default (#2267)
  Integrate rules_xcodeproj (#2263)
  Add assert when failing to get_env (#2253)
  ...

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.

2 participants