bazel: incompatible_objc_linking_info_migration
This flag is part of efforts to migrate ObjcProvider
linking info to CcLinkingContext
. It controls whether native Objective-C/C++ rules will use linking info from ObjcProvider
or CcInfo
(which contains the CcLinkingContext
). If the flag is false, bazel will get its linking info from ObjcProvider
(pre-migration behavior). If the flag is true, bazel will get its linking info from CcInfo
(post-migration behavior).
See #16939 for more details on the migration, and general migration guide.
The flag was implemented on 12/15/2022, and enabled by default on 1/25/2023. It is not in Bazel 6.0. The reason for flipping the flag relatively soon is to because there have already been cleanups to internal versions of rules_apple/rules_swift that require the flag flip, so we wanted to try to keep the repos relatively consistent.
Below is more information on what the bazel community may need to do for the migration:
-
The change should mostly impact rules maintainers, and is expected to be mostly transparent to end users.
-
For rules maintainers:
-
All internal versions of the language rules were migrated by 12/8. Affected rules were rules_apple and rules_kotlin. Note that no changes were required for rules_swift. There was one change required for rules_kotlin but I’m not clear on how it is maintained; for now I’ll provide info on rules_apple.
OSS maintainers of rules_apple need to update those rules. Here is a list of relevant changes if cherrypicking is required:
10/10: https://github.com/bazelbuild/rules_apple/commit/254a4bba620054e633bc7a82c01b02a8661bf07d 10/13: https://github.com/bazelbuild/rules_apple/commit/608ae263acfe1b517bc15a0bd8c1cea27cbd49d7 11/9: https://github.com/bazelbuild/rules_apple/commit/c13da60c1d896348b6432fa9edf4f5edbb94c19c 11/10: https://github.com/bazelbuild/rules_apple/commit/8e68a3ce1975b5a822562464b7f73bfab0e241c1 11/10: https://github.com/bazelbuild/rules_apple/commit/d8ab65d2efd9afe04687ad5df565a2305b39e96e
11/11: https://github.com/bazelbuild/rules_apple/commit/17f4ac463d98f118f1b492b1f9fd70f7c69a1b28 12/8: https://github.com/bazelbuild/rules_apple/commit/ed4e8c61efe9e120977f0a184f143c2554fb84e7
-
-
Migrating other rules:
-
Rules that generate linking info need to generate them in
CcInfo
. These are typically calls toapple_common.new_objc_provider()
. Only calls that produce linking info require migration. -
Rules that use linking info need use them from
CcInfo
. These are typically references to fields inObjcProviderApi
. -
Rules that produce
AppleDynamicFrameworkInfo
andAppleExecutableBinaryInfo
need to addCcInfo
s that provide the linking info to them. -
See #16939 for details. For examples for how to migrate, see (1) above links, (2) rules_swift which has lots of examples of how the same linking info is represented in
ObjcProvider
andCcInfo
.
-
-
End users need to make sure they are using compatible versions of Starlark rules. They may need to fix some build errors that were previously not reported, such as duplicate definition link errors.
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 15 (15 by maintainers)
Commits related to this issue
- Delete old linking implementation based on ObjcProvider https://github.com/bazelbuild/bazel/issues/17377 PiperOrigin-RevId: 548185001 Change-Id: Ibc44001666965845f2f5300ab1c507da179355e9 — committed to bazelbuild/bazel by googlewalt a year ago
- Delete --incompatible_objc_linking_info_migration flag https://github.com/bazelbuild/bazel/issues/17377 PiperOrigin-RevId: 548205363 Change-Id: I071cab13c549983627a303895775458d98af24f1 — committed to bazelbuild/bazel by googlewalt a year ago
@keith @brentleyjones FYI.