mdimporter fails to load in 10.14, signature issue?

My unsigned application has an mdimporter. In 10.14, it has stopped working, and the error messages suggest a code signature issue (see below). I have not found any documentation on the impact of code signatures on mdimporters. Is this a macOS bug, or am I supposed to change something?


A similar problem has been reported for EverNote.

https://discussion.evernote.com/topic/116651-en-752-spotlight-not-working-errors-w-mdimporter/


The logged error messages:

code signature in ... not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)

Cannot find function pointer MetadataImporterPluginFactory for factory C8BC68DA-C20C-4742-9BE6-D438C0D48ED2 in CFBundle/CFPlugIn 0x7fb2e2d076c0 <...> (bundle, not loaded)

Replies

I’m not sure exactly what’s going on here but I need to ask you why your app is unsigned. Shipping an unsigned app these days puts you far off the beaten path.

Also, if you sign your app does this problem go away?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

The app is still under development.

Evernote has publically posted their bug report 44973640. I'm sure their app is signed!

My application mdimporter now works after signing it, at least on new documents (old documents I tested earlier apparently suffer from being cached). I gather the signing restriction on mdimporters has been around for a while, but I did not see it in release notes.


However, it remains the case that mdimport fails. I have tested mdimport not only on my own application documents, but also on a QuarkExpress document that appears as expected in a Spotlight search. The log messages (as above) all indicate that mdimport is using Library Vallidation. As you explained in an earlier post, that means mdimport is unable to load any third party mdimporter, even if the mdimporter is properly signed.


mdimport was the recommended way to test mdimporters. Is there a new way?

The app is still under development.

You still want to sign your code, even during development. As I mentioned before, unsigned code puts you way off the beaten path, and this can manifest itself in all sorts of oddities. For example, the keychain uses your app’s code signature to track the ownership of keychain items. If you don’t sign your code this tracking doesn’t work as expected, and you’ll find that keychain items the app creates in debug session N are inaccessible to it in debug session N+1.

I want to stress that the keychain is just one example of this. In recent years more and more subsystems within the OS have started to track code identity, and they all get confused by unsigned code.

bug report 44973640

Thanks for the reference.

mdimport
was the recommended way to test mdimporters. Is there a new way?

No.

Does your importer fail when used by Spotlight proper? Or just in when you’re testing it with

mdimport
? If it’s only the latter then you could work around this bug by temporarily disabling SIP while your testing your importer.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"