-
Re: Sharing swift runtime libraries
eskimo Nov 15, 2016 2:12 AM (in response to granada29)It’s completely normal for embedded Swift code to use the Swift runtime from the app it’s embedded in. Indeed, this happens by default if you’re creating an app extension (
.appex
). To make this work you need to:Set Always Embed Swift Standard Libraries (
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES
) on the app.Clear Always Embed Swift Standard Libraries on the helper.
Set Runpath Search Paths (
LD_RUNPATH_SEARCH_PATHS
) on the helper to reference the location of the Swift standard libraries within the app.For a sandboxed login item within a Mac app, I think you’ll want
@executable_path/../../../../Frameworks
, but I may have counted the double dots wrong (I’m basing this on some recent experience with app extensions).
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardwarelet myEmail = "eskimo" + "1" + "@apple.com"
-
Re: Sharing swift runtime libraries
granada29 Nov 15, 2016 2:10 PM (in response to eskimo)I got the @executable_path working OK, but Always Embed Swift Standard Libraries is being ignored. It is defaulted to NO and setting/resetting it on the targets makes no difference - both targets are receiving a copy of the libraries.
In the build log for LaunchHelper (Always Embed is now set to NO) I see:
CopySwiftLibs /Users/bryan/Library/Developer/Xcode/DerivedData/MyApp-ahjuzftwvdgvyrazjorwycvnzxoz/Build/Products/Debug/LaunchHelper.app
Any clues as to what other switch(es) may be causing CopySwiftLibs to be triggered?
I'm running Xcode 8.1 on Sierra 10.12.1 and the application is being built for macOS.
Thanks
Bryan
-
Re: Sharing swift runtime libraries
eskimo Nov 16, 2016 3:12 AM (in response to granada29)Bummer. Thinking about this more, I’m pretty sure that Always Embed Swift Standard Libraries is the wrong option here. Sorry about the bum steer.
Any clues as to what other switch(es) may be causing CopySwiftLibs to be triggered?
No. My best guess at this point is that Xcode understands the difference between an app target and an extension target, and thus includes the Swift libraries in one but not the other. That’s pretty much what QA1881 says.
At this point I’m going to admit that I’m out of my depth )-: I recommend you open a DTS tech support incident and one of our Tools Guys™ can look into this.
If you do open a TSI for this please email me the follow-up number so that I can add my comments to the incident. My email address is in my signature.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardwarelet myEmail = "eskimo" + "1" + "@apple.com"
-
Re: Sharing swift runtime libraries
granada29 Nov 16, 2016 11:02 AM (in response to eskimo)TSI submitted and I have emailed the details to you
Thanks
Bryan
-
Re: Sharing swift runtime libraries
granada29 Nov 29, 2016 2:37 PM (in response to eskimo)Any resolution to this pending? It's not really a show-stopper except my app is 50% bigger than it need be.
Bryan
-
Re: Sharing swift runtime libraries
eskimo Nov 29, 2016 3:51 PM (in response to granada29)Any resolution to this pending?
I don’t comment about official DTS business here on DevForums but feel free to drop me a line at my individual email address (in my signature).
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardwarelet myEmail = "eskimo" + "1" + "@apple.com"
-
-
-