Extender server + iOS 13 + OSX 10.15 + Clang 9

#1

What?

We are updating the extender server with a new C/C++ compiler, Clang 9 (previously Clang 6).

The Apple sdk’s are updated to iOS(Simulator) 13.0 and MacOS 10.15.

When?

Although the 1.2.163 release was scheduled for this last monday, we now aim for a release on Monday 7 of October.

What does this mean for me?

If you are an “end user” (i.e. not an extension developer) then hopefully, no changes should be needed.

Your iOS apps will use the latest SDK which is usually good when submitting apps.

Most extensions already work out of the box, but there might be some extensions that need some urgent care to make them work with the new server.

We expect no runtime issues for your apps.

Why did you do this change?

When updating to the latest iOS/OSX sdks, we also had to do a little restructuring on our servers.
We had originally planned this for later, but we opted to do this now instead.

And while we usually try to have two setups (old + new) running at the same time, in this instance it failed.

We apologize for the short heads up!
Ideally, we’d at least give one or two sprints notice.

Extension Developers

You need to verify that your extensions work with the latest update of the server.
We use this Clang installation to build iOS/OSX and Win32.

NOTE Don’t update that Editor, since it will then get another Engine SHA.

E.g. known compiler errors

C++11 narrowing

error: non-constant-expression cannot be narrowed from type 'LONG' (aka 'long') to 'float' in initializer list [-Wc++11-narrowing]

Fix this by either fixing your code, or disable the warning by adding the flag to

flags: ['-Wno-c++11-narrowing]']
8 Likes

Defold 1.2.163 has been released
pinned globally #2
0 Likes

#3

Internally we have tests that help us test existing extensions.
And here’s the current list:

WORKING extensions:

  https://github.com/defold/extension-webview/archive/master.zip
  https://github.com/defold/extension-iac/archive/master.zip
  https://github.com/defold/extension-iap/archive/master.zip
  https://github.com/defold/extension-fbinstant/archive/master.zip
  https://github.com/defold/extension-html5/archive/master.zip
  https://github.com/defold/extension-facebook/archive/master.zip
  https://github.com/defold/extension-push/archive/master.zip
  https://github.com/defold/extension-firebase-core/archive/master.zip
  https://github.com/defold/extension-gpgs/archive/master.zip
  https://github.com/defold/extension-firebase-analytics/archive/master.zip
  https://github.com/defold/extension-videoplayer-native/archive/master.zip
  https://github.com/defold/extension-adinfo/archive/master.zip
  https://github.com/britzl/defold-screenshot/archive/master.zip
  https://github.com/britzl/defold-luasec/archive/master.zip
  https://github.com/britzl/defold-sharing/archive/master.zip
  https://github.com/dapetcu21/defold-fmod/archive/master.zip
  https://github.com/Lerg/extension-admob/archive/master.zip
  https://github.com/Lerg/extension-directories/archive/master.zip
  https://github.com/AGulev/DefVideoAds/archive/master.zip
  https://github.com/GameAnalytics/GA-SDK-DEFOLD/archive/master.zip

Known issues:

  https://github.com/subsoap/defos/archive/master.zip (Win32 only)
5 Likes

#4

GameAnalytics update their sdk to 2.3.0. It can’t compiled with Editor 1.6.2 - Alpha.
More info is here: https://github.com/GameAnalytics/GA-SDK-DEFOLD/issues/24
They build their lib with XCode 11.

2 Likes

#5

Do you mean the regular Editor 1.2.162?
That one defaults to https://build.defold.com, which is the live server.

This test is about using the beta release and editor, and the beta extender server.

0 Likes

#6

I know, this is why I share this here. If they compiled it with XCode 11, new sdk should build successfully with beta server, right?

Edit: Yes, it is. It works with 1.2.163 + https://build-stage.defold.com

0 Likes

#7

Yes, if you try the new beta editor and beta server, it should work yes.

0 Likes

#8

Thank you. I did and It worked with 1.2.163 + https://build-stage.defold.com
It is not going to work with current versions until Monday than.

4 Likes

#9

DefOS should work now

4 Likes

#10

The GameAnalytics SDK extension builds fine with 1.2.163 for OSX builds but when I run it I get this crash error:

dyld: lazy symbol binding failed: Symbol not found: _objc_opt_respondsToSelector
Referenced from: /Users/mts/dev/github/gameanalytics/GA-SDK-DEFOLD-DEV/build/x86_64-osx/dmengine
Expected in: /usr/lib/libobjc.A.dylib

Any idea if there is something we need to do to fix it? Or what could be causing this?

0 Likes

#11

I’m afraid this is a new error, and I suspect it’s related to the new clang 9 compilation.

My local libobjc.A.dylib looks like this:

mathiaswesterdahl ~/work/defold (editor-dev)  
$ nm /usr/lib/libobjc.A.dylib | grep respondsToSelector
000000000000c483 t +[NSObject respondsToSelector:]
000000000000b4c4 t -[NSObject respondsToSelector:]
000000000000ba20 T _class_respondsToSelector
000000000000b4fc t _class_respondsToSelector_inst

mathiaswesterdahl ~/work/defold (editor-dev)  
$ ls -la /usr/lib/libobjc.A.dylib
-rwxr-xr-x  1 root  wheel  28112240 May  4 08:48 /usr/lib/libobjc.A.dylib

mathiaswesterdahl ~/work/defold (editor-dev)  
$ file /usr/lib/libobjc.A.dylib
/usr/lib/libobjc.A.dylib: Mach-O universal binary with 3 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [x86_64h]
/usr/lib/libobjc.A.dylib (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64
/usr/lib/libobjc.A.dylib (for architecture i386):	Mach-O dynamically linked shared library i386
/usr/lib/libobjc.A.dylib (for architecture x86_64h):	Mach-O 64-bit dynamically linked shared library x86_64h

Not sure how to resolve it yet though. I’ll happily test ideas.

EDIT: @gameanalytics Does it work for iOS?

1 Like

#12

The code is specific to the C++ OSX library to get the version of the OSX when using the SDK on OSX platform:

#import "GADeviceOSX.h"
#import <Foundation/Foundation.h>
#import <CoreServices/CoreServices.h>

typedef struct {
    NSInteger majorVersion;
    NSInteger minorVersion;
    NSInteger patchVersion;
} MyOperatingSystemVersion;

const char* getOSXVersion()
{
    if([[NSProcessInfo processInfo] respondsToSelector:@selector(operatingSystemVersion)])
    {
        MyOperatingSystemVersion version;
        NSMethodSignature* methodSignature = [[NSProcessInfo processInfo] methodSignatureForSelector:@selector(operatingSystemVersion)];
        NSInvocation* inv = [NSInvocation invocationWithMethodSignature:methodSignature];
        inv.selector = @selector(operatingSystemVersion);
        [inv invokeWithTarget:[NSProcessInfo processInfo]];
        [inv getReturnValue:&version];
        
        NSString* v = [NSString stringWithFormat:@"%ld.%ld.%ld", version.majorVersion, version.minorVersion, (long)version.patchVersion];
        return [v UTF8String];
    }
    else
    {
        SInt32 majorVersion,minorVersion,bugFixVersion;
        
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
        Gestalt(gestaltSystemVersionMajor, &majorVersion);
        Gestalt(gestaltSystemVersionMinor, &minorVersion);
        Gestalt(gestaltSystemVersionBugFix, &bugFixVersion);
#pragma GCC diagnostic pop
        
        NSString* v = [NSString stringWithFormat:@"%d.%d.%d", majorVersion, minorVersion, bugFixVersion];
        return [v UTF8String];
    }
}
0 Likes

#13

I found the code above online somewhere when figuring out how to get the OSX version. Not sure if I can do it in another way or what or if I should change something to get it working again for clang 9.

0 Likes

#14

Using respondsToSelector should work out of the box. And it should have been able to load that library imho.

1 Like

#15

We have this functionality in sys.get_sys_info():

{ --[[0x10999f150]]
  api_version = "",
  device_model = "",
  system_name = "Darwin",
  user_agent = "",
  gmt_offset = 120,
  territory = "SE",
  device_ident = "",
  device_language = "en",
  manufacturer = "",
  system_version = "18.6.0",
  language = "en"
}

And internally we get this using:

UIDevice* d = [UIDevice currentDevice];
dmStrlCpy(info->m_SystemVersion, [d.systemVersion UTF8String], sizeof(info->m_SystemVersion));

Which corresponds to the number you get from:

$ uname -r
18.6.0
1 Like

#16

@gameanalytics I’m afraid I cannot reproduce this?
I used the master branch and built/bundle for OSX. And it ran fine (I didn’t see a printout of the OSX version though)

I also tried to create a small example test app using that C code, and it built/worked fine with both apple-clang and clang-9 :confused:

Do you have a repro I can try out?

3 Likes

#17

From the log it looks like it doesn’t initialise correctly because you have not put in correct game and secret keys and then it will crash I think when it initialises correctly. I have sent you a DM with the keys @Mathias_Westerdahl.

2 Likes

#18

Ok I am not use if it is something you have fixed but after I have updated to MacOS 10.15 then I don’t have any crashes.

0 Likes

#19

I’m still on 10.14.5, but I did install XCode 11 and its toolchain, and that might have updated some things.

1 Like

#20

Ok so no crashes for you either then after entering keys into the test app?

0 Likes