Many proyects that appear to be cross-platform crash on Linux because they use some function that returns NSUnimplemented outside of Darwin. I’m currently fishing for these kinds of bugs in two libraries that I’m porting to Linux and so far they are kind of a pain to find.
Could the compiler show some kind of warning when compiling against these components in a platform where they aren’t implemented?
I was thinking of @harlanhaskins’s #warning and #error primitives, but I think those would only appear if Foundation were to be compiled alongside the project. If you’re using binaries of the library, those would’ve been read and deleted already before you needed the warnings to help you.
What can be done about this? Currently I’m just grep-ing the heck out of my files looking for culprits
My position on this has evolved over time, with continued improvements to the maturity of the library.
If we have entire chunks of functionality that are entirely NSUnimplemented, we should likely consider either removing it or annotating it. If we have a corner case of one method that is not available, we have to decide if we want to disallow all usage of it, or allow it but make the corner case assert. There are valid arguments in both directions.
Can you let us know what functionality these libraries needed that is missing?
It may seem strange, but we actually have very little visibility into what projects need what functionality. If we can gather some data I can prioritize which work will have the most impact.
I know it isn't Foundation-related, but it's a similar kind of issue. I know you probably have other priorities to work on, but I bet you'd probably still like to hear about this :)