News for hackers. Stuff that matters.
Re:Announcing Rust 1.16 by conradev on Thursday March 16, 2017 @03:05PM (#13888038)
You can't use dynamic libraries on iOS because they fail iTunes Connect validation. The only dylibs it allows are the Swift standard library. You can, however, use clang to take a static library and throw it into anything you want (framework, dylib, executable).
Re:Announcing Rust 1.16 by mrsteveman1 on Thursday March 16, 2017 @03:38PM (#13888416)
It looks like you're right, Apple says you can't bundle dylibs outside of a Framework on iOS :\

What would be the difference though, why make the distinction?

> Dynamic libraries outside of a framework bundle, which typically have the file extension .dylib, are not supported on iOS, watchOS, or tvOS, except for the system Swift libraries provided by Xcode.

https://developer.apple.com/library/content/technotes/tn2435...

Re:Announcing Rust 1.16 by conradev on Thursday March 16, 2017 @04:26PM (#13888855)
From my understanding, the limitation is purely because of how Apple designed iTunes Connect validation, and not for technical reasons.
Re:Announcing Rust 1.16 by cbrauchli on Thursday March 16, 2017 @03:28PM (#13888299)
That's not true at all. You can use dynamic libraries; Swift modules produce .framework packages, which are dynamically linked.
Re:Announcing Rust 1.16 by conradev on Thursday March 16, 2017 @04:25PM (#13888844)
I meant dylib files. You can't ship those, but you can ship dynamically linked frameworks.
Re:Announcing Rust 1.16 by eridius on Thursday March 16, 2017 @04:48PM (#13889031)
AFAIK the only difference between a dylib and a framework is the folder structure (and I guess the install path of the library). So in theory you could produce a cdylib, create a framework folder structure for it, and then use install_name_tool to update the install name appropriately.
Re:Announcing Rust 1.16 by conradev on Thursday March 16, 2017 @06:59PM (#13889932)
That's what I thought, too, but I was reminded of the filetype field in the mach_header which has distinct MH_DYLIB and MH_BUNDLE values. fwiw, I don't think that difference means much for the loading process, but they are different.
Re:Announcing Rust 1.16 by eridius on Thursday March 16, 2017 @07:08PM (#13889968)
Hmm. I just ran `otool -hv /System/Library/Frameworks/Foundation.framework/Foundation` and it says the "filetype" header has the value "DYLIB". It looks like MH_BUNDLE is actually for plugin bundles, not for frameworks.
Re:Announcing Rust 1.16 by conradev on Thursday March 16, 2017 @08:15PM (#13890306)
Oh, I see! That makes sense. Preference bundles are type "BUNDLE" but frameworks are not. TIL.
Re:Announcing Rust 1.16 by cbrauchli on Thursday March 16, 2017 @04:46PM (#13889015)
Ah, I see. Thanks for the clarification.
Re:Announcing Rust 1.16 by mahyarm on Thursday March 16, 2017 @04:29PM (#13888872)
If you can avoid using a dylib on iOS, I would do it. It effects startup performance time. Just make a static version and compile it into the binary?