Importing macOS prebuilt dynamic framework error.
Hello!
I am trying to import CouchbaseLite/Swift macOS framework to no avail.
carthage BUILD
load("@build_bazel_rules_apple//apple:apple.bzl",
"apple_dynamic_framework_import",
"apple_static_framework_import")
apple_dynamic_framework_import(
name = "CouchbaseLiteSwift",
framework_imports = glob(["Build/Mac/CouchbaseLiteSwift.framework/**"]),
visibility = ["//visibility:public"]
)
macapp BUILD
swift_library(
name = "MYAPPmacOSLib",
module_name = "MYAPPmacOSLib",
srcs = glob(["**/*.swift"]),
copts = swift_library_compiler_flags(),
data = glob([
"**/*.storyboard",
"**/*.xib",
"**/*.xcassets/**",
"**/*.plist",
"**/*.json",
]) + ["//Fonts"],
deps = [
"//Carthage:CouchbaseLiteSwift",
],
)
macos_application(
name = "MYAPPmacOS",
bundle_id = "com.muiz.idn.MYAPP.mac",
entitlements = "MYAPPmacOS.entitlements",
app_icons = [":AppIcon"],
resources = [":Assets"],
minimum_os_version = "10.14",
infoplists = [
"Plist_Info.plist",
"Plist_Keychain.plist"
],
visibility = ["//visibility:public"],
provisioning_profile = mac_provisioning_profile(),
deps = [
":MYAPPmacOSLib",
],
)
Error
/usr/bin/codesign -v --sign AAC104FA2D53A5AF92BBF4556539B752E50D9B4F --force bazel-out/darwin_x86_64-dbg/bin/MYAPP/MYAPPmacOS/MYAPPmacOS-intermediates/_imported_frameworks/CouchbaseLiteSwift.framework
bazel-out/darwin_x86_64-dbg/bin/MYAPP/MYAPPmacOS/MYAPPmacOS-intermediates/_imported_frameworks/CouchbaseLiteSwift.framework: bundle format is ambiguous (could be app or framework)
Success
/usr/bin/codesign -v --sign AAC104FA2D53A5AF92BBF4556539B752E50D9B4F --force bazel-out/darwin_x86_64-dbg/bin/MYAPP/MYAPPmacOS/MYAPPmacOS-intermediates/_imported_frameworks/CouchbaseLiteSwift.framework/Versions/A/
bazel-out/darwin_x86_64-dbg/bin/MYAPP/MYAPPmacOS/MYAPPmacOS-intermediates/_imported_frameworks/CouchbaseLiteSwift.framework/Versions/A/: signed bundle with Mach-O thin (x86_64) [com.couchbase.CouchbaseLiteSwift]
Note that the success one point to Versions/A rather than root framework directory
Specifically what issues are you seeing?
@keith ah, sorry, just updated/edited the issue. Wrongly sent before finish. Thank you!
Interesting, looks like this was reported before as well https://github.com/bazelbuild/rules_apple/issues/737
To be sure does the framework's plist specify FMWK as the type? (based on some other cases I found of this error on the internet it sounds like it might still be broken even with that, but I'm curious)
Yes it correctly specifies FMWK as in CouchbaseLiteSwift.framework/Resources/Info.plist
<key>CFBundleName</key>
<string>CouchbaseLiteSwift</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.8.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
looks like that project is a bit too old for me to build in Xcode 12. Do you think you could provide a minimized repro case?
@keith Hope this help to enable issue reproduction https://github.com/muizidn/github.com-bazelbuild-rules_apple-issues-1040
https://github.com/bazelbuild/rules_apple/blob/master/doc/frameworks.md
This is still an issue right? Just no one has had a chance to investigate yet?
Yes, this is still an issue. About the documentation, am I misunderstand that macOS framework doesn't supported yet?
Ah that's what you were referring to. I think those docs are a bit outdated, but the framework import rules are supposed to work with macOS either way. For example here's 1 in a test on macOS:
https://github.com/bazelbuild/rules_apple/blob/8562971108c11931618a220731c335e9fab9fb49/test/starlark_tests/targets_under_test/macos/BUILD#L210-L214
Ah, okay. Didn't see that. Thank you. I'll reopen this issue.
can we skip internal code sign, and pass custom path here codesign_inputs ? could it solve this issue?