How to create a Windows release build?

Currently, when using native extensions, the release only strips the engine. This is reported as DEF-2477.
We’re currently working on fixing it and it should land in 1.2.137 or so…

In the mean time, the workaround is to use an app manifest.
You can download one from @britzl’s page Manifestation

  • Select the feature you want
  • Download the manifest
  • Name it game.appmanifest
  • link to it from the game.project setting native_extension.app_manifest
  • Bundle the game

Now you should have a build without the feature you didn’t want/need

5 Likes

Thanks @Mathias_Westerdahl !

1 Like

I tried to build the game with following game.appmanifest, but the profiler is still there and port 8001/8002 are still occupied. I am sure the build process is used this manifest because there would be build errors if I turned on ‘use clang’ - of course, it is another problem.

platforms:
    x86_64-osx:
        context:
            excludeLibs: ["record","vpx","profilerext"]
            excludeSymbols: ["ProfilerExt","FacebookExt"]
            libs: ["record_null"]
            linkFlags: []

    x86_64-linux:
        context:
            excludeLibs: ["record","vpx","profilerext"]
            excludeSymbols: ["ProfilerExt","FacebookExt"]
            libs: ["record_null"]
            linkFlags: []

    js-web:
        context:
            excludeLibs: ["record","vpx","profilerext"]
            excludeSymbols: ["ProfilerExt","FacebookExt"]
            libs: ["record_null"]
            linkFlags: []

    x86-win32:
        context:
            excludeLibs: ["librecord","libvpx","libprofilerext"]
            excludeSymbols: ["ProfilerExt","FacebookExt"]
            libs: ["librecord_null.lib"]
            linkFlags: []
            use-clang: false

    x86_64-win32:
        context:
            excludeLibs: ["librecord","libvpx","libprofilerext"]
            excludeSymbols: ["ProfilerExt","FacebookExt"]
            libs: ["librecord_null.lib"]
            linkFlags: []
            use-clang: false

    armv7-android:
        context:
            excludeLibs: ["record","vpx","profilerext"]
            excludeSymbols: ["ProfilerExt","FacebookExt"]
            libs: ["record_null"]
            linkFlags: []

    armv7-ios:
        context:
            excludeLibs: ["record","vpx","profilerext"]
            excludeSymbols: ["ProfilerExt","FacebookExt"]
            libs: ["record_null"]
            linkFlags: []

    arm64-ios:
        context:
            excludeLibs: ["record","vpx","profilerext"]
            excludeSymbols: ["ProfilerExt","FacebookExt"]
            libs: ["record_null"]
            linkFlags: []

Did you check the Release checkbox? It should look like this:

Here we exclude the normal/debug version of the engine (“libengine”) and instead include the release version (“libengine_release”).

2 Likes

No, I did not check the Release checkbox in previous builds.
After I checked the Release checkbox, the game failed to start, I am working on it now.

As Björn mentioned, the “Release” flag disables the engine service which holds the web server.
When you launched it, did you use “build and run”?

Regarding building with clang, I’d like to know what extensions failed to compile and why? Was it your extensions, or some third party extensions? Note that we are switching to Clang as the compiler soon, so it’s good if you start making sure each extension actually works for you.

No, I bundled the game first, and tried to launch the game from Windows explorer. The game window started and disappeared immediately. I also tried to launch the game from a console window, the result is same and no message left in the console window.

It is my extension, which is used to detect the network reachability. Please see following error messages for more detail.


I am not sure if the static libs used by my extension is also needed to be built with clang if I use clang as the compiler.

Hmm, It does behave that way if it doesn’t find any game data, but I’m assuming that you launched it from the bundle folder, so it really shouldn’t do that.

Regarding clang:

  • It is abi compatible with your previous libraries, so that shouldn’t pose a problem
  • It is building on a case sensitive OS, which means you need to spell your includes correctly.
  • In this case, it’s called netlistmgr.h

Thanks @Mathias_Westerdahl, I will tried to fix the clang problems and keep you update.

1 Like

We should expand sys.get_connectivity() to support all platforms so that you don’t have to create your own extension.

2 Likes

We did not choose sys.get_connectivity() because:

  1. Game cannot get notified when reachability changs; (NONE / WIFI / MOBILE)
  2. sys.get_connectivity() does not work well on other platforms except iOS / Android ( Why is sys.get_connectivity() always reporting NETWORK_CONNECTED on macOS? (SOLVED) )

After I fix the include file name problem, there is no error found in clang build process. But editor still failed to create Windows bundle, please see following screenshot for more detail.

I don’t know how to get real error which is blocking the build process, is there any log files which can help to diagnose the problem?

Most unfortunate :confused:
In the next release on monday, the real error should be visible in the editor.

By looking in the server logs:

/usr/local/bin/lld-link: error: could not open Crypt32.Lib.lib: No such file or directory
/usr/local/bin/lld-link: error: unknown file type: x64\Release\sqlite3.obj
/usr/local/bin/lld-link: error: duplicate symbol: poly1305_init in tomcrypt.lib(poly1305.obj) and in libcrypto.lib(poly1305-x86_64.obj)
  • We’re changing from specifying libs without the “.lib” suffix" (we’ve updated @britzls defold-luasec to reflect this, so it should be “Crypt32” now (which will work for non-clang as well)

  • It tries to find use “-lsqlite3” but it seems it cannot find it? What is stored in the dsqlite3/lib/x86_64-win32 folder?

  • duplicate symbol: poly1305_init in tomcrypt.lib(poly1305.obj) and in libcrypto.lib(poly1305-x86_64.obj) seems you get a symbol collision. I’m not sure why you don’t get it with the non-clang build though. Perhaps some define is configured differently… Is this part of your extension or is it a third party extension?

I’d be happy to help if you’d be willing to share a repro case project with me :slight_smile:

2 Likes

Thanks @Mathias_Westerdahl, I will fix these errors and try again.

2 Likes

I fixed problem 1 and problem 3, but the second problem is still there:
/usr/local/bin/lld-link: error: unknown file type: x64\Release\sqlite3.obj

I don’t understand why this error happens, I stored sqlite3.lib in dsqlite3/lib/x86_64-win32 folder, why the linker tried to find sqlite3.obj? This extension can be built without any error if I turned off ‘use-clang’ option.

BTW, I used static library instead of including sqlite3.c source code because defold tried to compile .c file with c++ compiler and cause build errors Compile C files with C++ compiler while building native extension (DEF-3084). I just verified this bug is still there.

Please see following extension manifest file for more detail.

name: "dsqlite3"

platforms:
    arm64-ios:
        context:
            flags:      ["-std=c++11", "-stdlib=libc++"]
            libs:       ["z", "c++", "sqlite3"]

    armv7-ios:
        context:
            flags:      ["-std=c++11", "-stdlib=libc++"]
            libs:       ["z", "c++", "sqlite3"]

    x86-osx:
        context:
            flags:      ["-std=c++11", "-stdlib=libc++"]
            libs:       ["z", "c++", "sqlite3"]

    x86_64-osx:
        context:
            flags:      ["-std=c++11", "-stdlib=libc++"]
            libs:       ["z", "c++", "sqlite3"]
1 Like

What is the library named?
Would you be willing to share that extension so I could try it to see what’s wrong?

The library name is ‘sqlite3.lib’. I upload the extension to github for your convenience.

2 Likes

Any progress?

Hi @joshua.winters !
Sorry for the late reply.

I’ve added a PR to your repo

Basically, what I eventually did was go back to simple command line building, via the build.bat in the visual studio command prompt. By using that, the libraries was only 30% of their original sizes. And I never really understood what flags actually caused this to not work :confused:

2 Likes

Thank you for your kind help!

1 Like