Skip to content

Keep the link directory of a dynamic framework per target - #3154

Open
iamgirya wants to merge 1 commit into
bazelbuild:mainfrom
iamgirya:fix/framework-dir-per-target
Open

iamgirya wants to merge 1 commit into
bazelbuild:mainfrom
iamgirya:fix/framework-dir-per-target

Conversation

@iamgirya

Copy link
Copy Markdown

Two dynamic frameworks with the same bundle name can't be built in one package. We build the same framework for several app flavors there, every flavor ships App.framework, and building two of them fails:

ERROR: file 'frameworks/App.framework/App' is generated by these conflicting actions:
Label: //:app_framework_paid, //:app_framework_free

framework_provider_partial symlinks the framework binary to frameworks/<bundle name>.framework/<bundle name> in the target's package, so the path depends only on the bundle name. This change puts it under frameworks/<target name>/<bundle name>.framework/, like #3127 did for Core Data models. Only framework_dirs and framework_files of AppleDynamicFrameworkInfo change; the bundled framework stays the same.

Repro: https://github.com/iamgirya/bazel-rules-repros/tree/main/rules_apple/framework_same_bundle_name

Tested:

  • New ios_framework_shared_bundle_name_{a,b}_test: two apps in one package, each with its own framework named shared_bundle_name_fmwk. On main the build fails with the conflicting actions error; with this change both apps contain the framework and load @rpath/shared_bundle_name_fmwk.framework/shared_bundle_name_fmwk.
  • bazel test //test/starlark_tests/... --config=ci for the framework, dynamic framework, iOS application, iOS extension and xcarchive suites: 311 of 312 pass; the remaining one needs a watchOS simulator runtime I don't have installed.

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.

1 participant