Page MenuHomePhabricator

efl does not build on macOS anymore
Closed, ResolvedPublic


efl does not build from source anymore on macOS (two latest released versions, 10.14 and 10.15). The error is:

lib/ecore_cocoa/ecore_cocoa_app.m:48:5: error: use of undeclared identifier '_mainMenu'
   [_mainMenu update];
lib/ecore_cocoa/ecore_cocoa_app.m:79:4: error: use of undeclared identifier '_running'
   _running = 1;

This is true of efl 1.22.4 and later versions as well.

ProhtMeyhet added subscribers: jayji, ProhtMeyhet.

@jayji could you have a look? It's from your commit c03876d611fca41d02513fb07d3d275f64bcf0cd and also has a FIXME there:

46 - (void)internalUpdate
47 {
48    [_mainMenu update];
49    // FIXME Will not compile with GNUStep (member is named "_main_menu")
50 }
ProhtMeyhet edited projects, added efl; removed efl (efl-1.22).Jan 13 2020, 4:09 AM
  • I think [_mainMenu update] should be [[NSApp mainMenu] update].
  • _running = 1 is more problematic, since running is a read-only NSApplication property.
seeker added a subscriber: seeker.Mar 6 2020, 11:06 AM
  • Can confirm that [[self mainMenu] update] fixes [_mainMenu update]
  • _running = 1 can be replaced with [self setValue:[NSNumber numberWithShort:1] forKey:@"_running"]
    • Although _running is no longer declared in NSApplication.h it still exists in the implementation
    • See AppKit.tbd (Ctrl + F, NSApplication._running)

@seeker could you write us a patch? Either upload it here or create a diff here. Any other textform (email, paste) would probably also helpful, but less desirable.

Bo98 added a subscriber: Bo98.Mar 10 2020, 8:24 PM

Here's my patch. I tested compiles on the last three macOS SDK versions (10.15, 10.14 & 10.13).

Note however, while I thoroughly tested whether it compiled, I haven't thoroughly tested it at runtime. I think it works on my 10.14 machine, but there were a few changes in this area in 10.15 which I don't currently have a 10.15 install on hand to test on. Overriding NSApplication, like EFL does, can easily go wrong, and is poorly documented & supported by Apple.

Failing that, [self setValue:[NSNumber numberWithShort:1] forKey:@"_running"] is an alternative quick patch for the _running situation, but entirely relies on the naming of internal variables not changing and moves such insurances from compile time to runtime.

bu5hm4n added a subscriber: bu5hm4n.Apr 6 2020, 1:51 AM

This solves the problem with sweetness! :) Thank you a lot! I am not experienced at all with objective C or macos, i just have a maschine to test, but this seems to be working nice and correctly!

Bo98 added a comment.Apr 6 2020, 9:02 AM

Thanks for testing it out!

I guess we should land this patch, given it fixes a compile break and has been successfully tested by two people.

Thanks a lot for your contribution @Bo98 !

stefan_schmidt closed this task as Resolved.Apr 16 2020, 1:11 AM
stefan_schmidt claimed this task.