Native Extensions

I think it’s solvable, but we’ll have to discuss it internally.

2 Likes

As I understand appmanifest do not work if I have no NE in my project?
I try to add release.appmanifest to my project, where I have no NE, and I still see logs when I build the project (cmd+B), but If I adding any NE to this project logs turns off.
Is this cmd+B only or game bundle has the same issue? (is it bug?)

UPD:
ok, this is only cmd-b only issue - not a problem for me, but, I think, it can be issue for peoples who want to check some logic that uses is_debug.

Having just an app.manifest is totally fine. It will strip your executable. But, as you mentioned, the old bug of not respect the “release” button if you bundle the game. But for CMD+B, it should be the same (debug log enabled)

2 Likes

I tried to build DefUnityAds NE using 1.2.123, and recieved next error:

Description	Resource	Path	Location	Type
Build server output: clang++ -c -arch arm64 -target arm-apple-darwin12 -isysroot /opt/iPhoneOS11.2.sdk/ -m64 -O2 -g -miphoneos-version-min=6.0 -DDM_PLATFORM_IOS  -fno-exceptions  -Iupload/defunityads/include  -F/tmp/job3157322890644293834/upload/defunityads/lib/ios  -I/var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//include -I/var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//sdk/include  upload/defunityads/src/DefUnityCallback.cpp -obuild/DefUnityCallback.cpp_0.o
In file included from upload/defunityads/src/DefUnityCallback.cpp:2:
In file included from upload/defunityads/src/DefUnityCallback.h:3:
In file included from /var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//include/dmsdk/sdk.h:11:
/var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//include/dmsdk/dlib/log.h:118:2: warning: "DLIB_LOG_DOMAIN is not defined" [-W#warnings]
#warning "DLIB_LOG_DOMAIN is not defined"
 ^
1 warning generated.

clang++ -c -arch arm64 -target arm-apple-darwin12 -isysroot /opt/iPhoneOS11.2.sdk/ -m64 -O2 -g -miphoneos-version-min=6.0 -DDM_PLATFORM_IOS  -fno-exceptions  -Iupload/defunityads/include  -F/tmp/job3157322890644293834/upload/defunityads/lib/ios  -I/var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//include -I/var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//sdk/include  upload/defunityads/src/utils/LuaUtils.cpp -obuild/LuaUtils.cpp_1.o
In file included from upload/defunityads/src/utils/LuaUtils.cpp:1:
In file included from upload/defunityads/src/utils/LuaUtils.h:3:
In file included from /var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//include/dmsdk/sdk.h:11:
/var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//include/dmsdk/dlib/log.h:118:2: warning: "DLIB_LOG_DOMAIN is not defined" [-W#warnings]
#warning "DLIB_LOG_DOMAIN is not defined"
 ^
1 warning generated.

clang++ -c -arch arm64 -target arm-apple-darwin12 -isysroot /opt/iPhoneOS11.2.sdk/ -m64 -O2 -g -miphoneos-version-min=6.0 -DDM_PLATFORM_IOS  -fno-exceptions  -Iupload/defunityads/include  -F/tmp/job3157322890644293834/upload/defunityads/lib/ios  -I/var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//include -I/var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//sdk/include  upload/defunityads/src/DefUnityAds.cpp -obuild/DefUnityAds.cpp_2.o
upload/defunityads/src/DefUnityAds.cpp:30:26: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
        char *placementId_lua = "";
                                ^
upload/defunityads/src/DefUnityAds.cpp:39:29: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
    char *placementId_lua = "";
                            ^
2 warnings generated.

clang++ -c -arch arm64 -target arm-apple-darwin12 -isysroot /opt/iPhoneOS11.2.sdk/ -m64 -O2 -g -miphoneos-version-min=6.0 -DDM_PLATFORM_IOS  -fno-exceptions  -Iupload/defunityads/include  -F/tmp/job3157322890644293834/upload/defunityads/lib/ios  -I/var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//include -I/var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//sdk/include  upload/defunityads/src/objc/DefUnityAdsIOS.mm -obuild/DefUnityAdsIOS.mm_3.o
In file included from upload/defunityads/src/objc/DefUnityAdsIOS.mm:3:
In file included from upload/defunityads/src/objc/../DefUnityCallback.h:3:
In file included from /var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//include/dmsdk/sdk.h:11:
/var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//include/dmsdk/dlib/log.h:118:2: warning: "DLIB_LOG_DOMAIN is not defined" [-W#warnings]
#warning "DLIB_LOG_DOMAIN is not defined"
 ^
In file included from upload/defunityads/src/objc/DefUnityAdsIOS.mm:5:
In file included from /opt/iPhoneOS11.2.sdk//System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h:22:
In file included from /opt/iPhoneOS11.2.sdk//System/Library/Frameworks/AVFoundation.framework/Headers/AVAnimation.h:11:
In file included from /opt/iPhoneOS11.2.sdk//System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:128:
/opt/iPhoneOS11.2.sdk//System/Library/Frameworks/Foundation.framework/Headers/NSUUID.h:26:49: error: nullability specifier '_Nullable' cannot be applied to non-pointer type 'uuid_t' (aka 'unsigned char [16]')
- (instancetype)initWithUUIDBytes:(const uuid_t _Nullable)bytes;
                                                ^
/opt/iPhoneOS11.2.sdk//System/Library/Frameworks/Foundation.framework/Headers/NSUUID.h:29:30: error: nullability specifier '_Nonnull' cannot be applied to non-pointer type 'uuid_t' (aka 'unsigned char [16]')
- (void)getUUIDBytes:(uuid_t _Nonnull)uuid;
                             ^
1 warning and 2 errors generated.

	DefUnityAds.cpp	/DefUnityAds/content/defunityads/src	Unknown	Problem

I checked macOS 10.13 release notes, and didn’t find big changes in AVFoundation , same thing with AppKit in other NE.

Can you help me with this issue?

Similar problem with Defos NE after 1.2.123 update. Looks like there is a breaking changes on MacOSX10.13 sdk

clang++ -c -arch x86_64 -target x86_64-apple-darwin12 -isysroot /opt/MacOSX10.13.sdk/ -m64 -O2 -g -mmacosx-version-min=10.7 -DDM_PLATFORM_OSX -DLUA_BYTECODE_ENABLE   -Iupload/defos/include   -I/var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//include -I/var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//sdk/include  upload/defos/src/defos_mac.mm -obuild/defos_mac.mm_3.o
In file included from upload/defos/src/defos_mac.mm:7:
In file included from /opt/MacOSX10.13.sdk//System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:10:
In file included from /opt/MacOSX10.13.sdk//System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:128:
/opt/MacOSX10.13.sdk//System/Library/Frameworks/Foundation.framework/Headers/NSUUID.h:26:49: error: nullability specifier '_Nullable' cannot be applied to non-pointer type 'uuid_t' (aka 'unsigned char [16]')
- (instancetype)initWithUUIDBytes:(const uuid_t _Nullable)bytes;
                                                ^
/opt/MacOSX10.13.sdk//System/Library/Frameworks/Foundation.framework/Headers/NSUUID.h:29:30: error: nullability specifier '_Nonnull' cannot be applied to non-pointer type 'uuid_t' (aka 'unsigned char [16]')
- (void)getUUIDBytes:(uuid_t _Nonnull)uuid;
                             ^
2 errors generated.

I’m looking into this. Not sure why this fails :confused:

Current workarounds:

2 Likes

I heard there’s a Native Extension build server that Defold provides. I’m trying to understand the big picture concept of NE’s and building them.

Why is a build server needed? Is it always used, if you have a NE in your project?

For example, the FMOD extension by dapetcu21 - it is using bridge libraries that are pre-built in Visual Studio. Are the build servers not required in this case? But still used? Or not?

Are there multiple build steps to consider?

I’m lacking C++ experience but think it’s probably good to know what happens when.

Native extensions allows you, the user, to extend the engine with extra functionality. It can be a sound library, or an ads library, or something that interacts with the OS.

If your project contains a native extension, or has a dependency on one, we will build a custom engine for you, on our cloud server.

2 Likes

I am not sure but the old version of clang can be the reason of this bug (some info here and here)

1 Like

I was initially compiling my own libs to remove the need to bundle the FMOD headers with the dependency (as I was not authorized to distribute them). Now that I am authorized to distribute FMOD, I decided to still keep this structure because the Lua bindings have a lot of glue code (with lots of templates and macros) that is slow to compile and I’d like not to have to make tea each time I build the game. :wink:

The build server is perfectly capable of compiling all of that stuff (weeeelll… eeeexcept on Windows, where I managed to make that particular version of the MSVC compiler crash), but I’m free to link against libraries I compiled on my own.

The build server is still needed to link the whole binary together with the Defold engine.

Also, the rationale behind having a build server is so that everybody can bundle for any platform no matter the OS they’re bundling from and without having to set up a complicated cross-compiler toolchain.

8 Likes

Thanks, great explanation!

2 Likes

@AGulev @selimanac @joshua.winters The server has been updated with a bug fix, and it now “works for me”. Could any of you verify the fix as well?

8 Likes

I checked DefUnityAds - it works!

6 Likes

Works for me too

3 Likes

Hi, can you share roadmap for NE. This is one of my favorite Defold features and I looking forward for next improvements.

2 Likes

Hi!

Off the top of my head, there are a few bigger things that we wish to work on before we leave the alpha stage of the NE feature. The first ones are related to improving compiling speeds/latency for the builds. E.g., we want to cache code/extensions for some time, in order to reduce upload times, and also build times if an extension was already built by someone else (with correct version etc). And also, we’d like to investigate speeding up the windows builds too, since they’re currently quite long.

After that, I think improving the debug workflow should help a lot. At the same time, we’re also working on making sure we don’t get any unwanted downtime for the server, e.g. adding better alarms etc.

After that, I think it’s more down to requested features, and perhaps we could have a similar system as the editor2-issues for NE issues as well. I’ll mention this to the team and see what they think of it.

8 Likes

Linking against shared libraries? pretty please? :heart_eyes: :heart_eyes: :dog:
Release builds when release is checked?
Access to rendering primitives?
Access to the input system?

5 Likes

Trying to build Appodeal defold sdk (currently unsupported)
On android build is ok, but on iOS i got next thing:

“status”:500, “error”:“Internal Server Error”,“exception”:“java.lang.OutOfMemoryError”,“message”:“java.lang.OutOfMemoryError: Java heap space”,“path”:“/build/arm64-ios/…”

As I know, native extensions building on Defold servers. Is it problems on it? Locally I have increased java heap memory, seems its remote problem

Yes, that’s a remote (build server) problem. @Mathias_Westerdahl can probably take a look on Tuesday.

Hi @Insality!
Sorry to see you had this build issue. The server was fine in general, but for some reason it choked on your project.
I tried building the appodeal demo but that seems kind of broken. Do you have a test case I can use to reproduce this issue? And can you still reproduce it?

2 Likes