The future of rules_ios #952
Replies: 1 comment
|
Thanks for sharing, i think we can make a PR with all the learnings here ? Expand notesBazel-Migration of rules_iosMost of the rules inside rules To migrate from
Third party dependencies compiled using
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Square is migrating away from
rules_iosin favor of using a thinner layer of custom rules and macros on top ofrules_appleandrules_swift. We plan on ceasing to actively contribute torules_ios.Background
rules_ioswas created to make migration from anxcodebuild-based build to Bazel as simple as possible. Asrules_appleandrules_swifthave gained functionality and we've leaned further into using Bazel and diverged from the standardxcodebuildtoolchain,rules_iosis serving less of a purpose, and adds unnecessary complexity to our build.Migration path
rules_ioscontains a few different features you may be relying on. Here's what we suggest for a migration path:rules_swiftnow has a mixed_language_library macro and rule that works similarly torules_ios'sapple_framework. The biggest difference is that the target created byrules_swift's macro is not a "packaging target" with a transition attached to build the library for a particular platform. If you want to build a mixed-source library in isolation, you'll need to use anios_build_testtarget.rules_swiftpublished by Google, there is initial work on a rule to support mixed-language libraries. We plan on eventually migrating to that.#import "Header.h" or #import "Module/Header.h"), instead of using their actual path under Bazel's execroot (#import "some/path/to/Module/some/path/to/header/Header.h").mixed_language_libraryorobjc_library. We are still iterating on the best way to use this rule, and may simply migrate towards using fully-qualified imports.precompiled_apple_resource_bundlerules_iosused the same macro for frameworks containing static and dynamic libraries, with alink_dynamicparameter to switch between the linking behavior. We recommend migrating torules_apple'sios_frameworkfor dynamic frameworks, as described in the documentation.rules_iostakes a best-effort approach to converting Xcode's build settings into equivalentclang/swiftccompiler options or Bazel features when possible. We recommend getting rid of Xcode build settings in favor of using Bazel's configuration options directly.expand_templateas described in this issue or this blog post.If you have any questions, feel free to ask them here or reach out in the #rules_ios channel in the Bazel Slack workspace.
All reactions