Help building the engine

I’m trying to build the engine. These are the steps I’ve made


./scripts/build.py shell

To paget the packages into a local_sdks folder


./scripts/package/package_win32_sdk.sh


     ./scripts/build.py --package-path=./local_sdks install_sdk --platform=x86_64-win32

install external packages


./scripts/build.py install_ext --platform=x86_64-win32 --package-path=./local_sdks

then executing the build command with


./scripts/build.py build_engine --platform=x86_64-win32 --skip-tests -- --skip-build-tests

I get this error:


  src\test\jni/Testapi.empty.cpp => Testapi

In file included from src\test\jni/Testapi.empty.cpp:1:

In file included from C:\Users\myuser\_root\src\defold\engine\jni\src\test\testapi.h:19:

C:\Users\myuser\_root\src\defold\tmp\dynamo_home\sdk\include\dmsdk/dlib/array.h:18:10: fatal error: 'assert.h' file not found

   18 | #include <assert.h>

      |          ^~~~~~~~~~

1 error generated.

Traceback (most recent call last):

  File "C:\Users\myuser\_root\src\defold\tmp\dynamo_home\ext\bin\waf3-2.0.23-7dbdd0b348178777c338c9a31f6218a5\waflib\Scripting.py", line 119, in waf_entry_point

    run_commands()

  File "C:\Users\myuser\_root\src\defold\tmp\dynamo_home\ext\bin\waf3-2.0.23-7dbdd0b348178777c338c9a31f6218a5\waflib\Scripting.py", line 182, in run_commands

    ctx=run_command(cmd_name)

        ^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\myuser\_root\src\defold\tmp\dynamo_home\ext\bin\waf3-2.0.23-7dbdd0b348178777c338c9a31f6218a5\waflib\Scripting.py", line 173, in run_command

    ctx.execute()

  File "C:\Users\myuser\_root\src\defold\tmp\dynamo_home\ext\bin\waf3-2.0.23-7dbdd0b348178777c338c9a31f6218a5\waflib\Configure.py", line 85, in execute

    super(ConfigurationContext,self).execute()

  File "C:\Users\myuser\_root\src\defold\tmp\dynamo_home\ext\bin\waf3-2.0.23-7dbdd0b348178777c338c9a31f6218a5\waflib\Context.py", line 92, in execute

    self.recurse([os.path.dirname(g_module.root_path)])

  File "C:\Users\myuser\_root\src\defold\tmp\dynamo_home\ext\bin\waf3-2.0.23-7dbdd0b348178777c338c9a31f6218a5\waflib\Context.py", line 133, in recurse

    user_function(self)

  File "C:\Users\myuser\_root\src\defold\engine\jni\wscript", line 24, in configure

    conf.recurse('src')

  File "C:\Users\myuser\_root\src\defold\tmp\dynamo_home\ext\bin\waf3-2.0.23-7dbdd0b348178777c338c9a31f6218a5\waflib\Context.py", line 133, in recurse

    user_function(self)

  File "C:\Users\myuser\_root\src\defold\engine\jni\src\wscript", line 11, in configure

    conf.recurse('test')

  File "C:\Users\myuser\_root\src\defold\tmp\dynamo_home\ext\bin\waf3-2.0.23-7dbdd0b348178777c338c9a31f6218a5\waflib\Context.py", line 133, in recurse

    user_function(self)

  File "C:\Users\myuser\_root\src\defold\engine\jni\src\test\wscript", line 31, in configure

    gen_java.generate(header_path   = make_path('./testapi.h'),

  File "C:\Users\myuser\_root\src\defold\engine\jni\scripts\gen_java.py", line 1207, in generate

    ir = gen_ir.gen(source_path, includes, module_name, namespace, [])

         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\myuser\_root\src\defold\engine\jni\scripts\external\gen_ir.py", line 223, in gen

    ast = clang_cpp(source_path, includes)

          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\myuser\_root\src\defold\engine\jni\scripts\external\gen_ir.py", line 220, in clang_cpp

    return subprocess.check_output(cmd)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Python312\Lib\subprocess.py", line 466, in check_output

    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Python312\Lib\subprocess.py", line 571, in run

    raise CalledProcessError(retcode, process.args,

subprocess.CalledProcessError: Command '['clang++', '-Xclang', '-ast-dump=json', '-c', '-IC:\\Users\\myuser\\_root\\src\\defold\\engine\\jni', '-IC:\\Users\\myuser\\_root\\src\\defold\\tmp\\dynamo_home\\sdk\\include', 'src\\test\\jni/Testapi.empty.cpp']' returned non-zero exit status 1.

[exec] python C:\Users\myuser\_root\src\defold\tmp\dynamo_home/ext/bin/waf --prefix=C:\Users\myuser\_root\src\defold\tmp\dynamo_home --skip-tests distclean configure build install --platform=x86_64-win32 --skip-build-tests

Error:

Traceback (most recent call last):

  File "C:\Users\myuser\_root\src\defold\scripts\build.py", line 2390, in <module>

    f()

  File "C:\Users\myuser\_root\src\defold\scripts\build.py", line 1118, in build_engine

    self._build_engine_lib(args, lib, host)

  File "C:\Users\myuser\_root\src\defold\scripts\build.py", line 1074, in _build_engine_lib

    run.env_command(self._form_env(), args + plf_args + self.waf_options + skip_build_tests, cwd = cwd)

  File "C:\Users\myuser\_root\src\defold\build_tools\run.py", line 98, in env_command

    return _exec_command(args, shell = False, stdout = None, env = env, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\myuser\_root\src\defold\build_tools\run.py", line 75, in _exec_command

    raise e

run.ExecException: 2

seems like the assert.h header is missing, should I download a different version of the win sdk? i’m using the one specified in scripts\package\package_win32_sdk.sh

1 Like

Hi!

I reckon I have to update the notes, since it is no longer needed for Windows and macOS to install the sdk, if they already have Visual Studio or XCode installed.

I’d say, remove the sdk folder /tmp/dynamo_home/ext/SDKs/Win32 again (no need to run the “install_sdk” command).

Then you should be able to build.

(side note, I think it should have worked for you, but the recommended approach is faster)

EDIT: It seems we already had documented that the step was optional for Windows/macOS: documentation

Edit2: I also added a separate section about ’install_sdk’, restating the part that it may not be necessary depending on platform.

Thank you for the heads up and the quick update :slight_smile: I’m still having the missing assert.h error, am I missing something from the installation of VS? I downloaded everything that is in the Development with c++ workload.

1 Like

What VS version, Windows version are you on?
What does the vswhere2 toold report in you build step?

Perhaps best if you upload your build log.

Sure! This is my build log
log.txt (71.6 KB)

VS version is 2019 on windows 11. I also have VS2022 installed but the paths seem correct (?)

1 Like

Thanks!

First check, yes, your SDK is found locally:

Checking for program 'CL'                : C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\CL.exe
Checking for program 'LINK'              : C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\LINK.exe
Checking for program 'LIB'               : C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\LIB.exe
Checking for program 'RC'                : C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\RC.exe
Checking for program 'signtool'          : C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe

And it build the first library (dlib) fine.

Then it fails when building the the (relatively new) library jni.
This library has a dependency of clang++, and I’m guessing it finds one, but it’s not the one under the Visual Studio installation.

In your command prompt, what do you get if you run `which clang++´ ?
I’m guessing you get some other installation, and that the solution may be to make sure that the MSVC clang++ is found first.

1 Like

Yep, I had another installation of clang++ on my system, I changed the PATH and installed the MSVC clang tools

➜  defold git:(dev) which clang++
/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/Llvm/x64/bin/clang++

this is the which result now. The build process gives the same error so I’m guessing something is still missing ?

1 Like

What if you try the clang command in isolation?
(The one listed as failing at the ens of the log)

Tried that too by running this:

clang++ -Xclang -ast-dump=json -c \
-I/C/Users/34BTUser/_root/src/defold/engine/jni \
-I/C/Users/34BTUser/_root/src/defold/tmp/dynamo_home/sdk/include \
C:/Users/34BTUser/_root/src/defold/engine/jni/src/test/jni/Testapi.empty.cpp

Dumped the log to a file →
outputLog.txt (342.3 KB)

1 Like

Ok, that outpu suggests that the command succeeded, i.e no error on assert.h.

Not sure what to test next to be honest.

So, problably was some kind of error with PATHS in windows since I had multiple versions of LLVM isntalled. Now I am able to build the engine :partying_face:, but a new error came up when trying to run the editor :grinning_face_with_smiling_eyes:

I installed leiningen and ran lein.bat init, this is the output:

Compiling 38 source files to C:\Users\34BTUser\_root\src\defold\editor\target\classes
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
using cached file 'https://github.com/sass/dart-sass/releases/download/1.62.1/dart-sass-1.62.1-windows-x64.zip' -> 'C:\Users\34BTUser\.dcache\github_com-sass-dart-sass-releases-download-1.62.1-dart-sass-1.62.1-windows-x64.zip-22307838444234354535353839304435463822'
sass: styling/stylesheets/ -> resources/
java.io.IOException: Cannot run program "C:\Users\34BTUser\_root\src\defold\editor\target\packages\dart-sass\1.62.1\dart-sass\sass": CreateProcess error=2, The system cannot find the file specified
 at java.lang.ProcessBuilder.start (ProcessBuilder.java:1143)
    java.lang.ProcessBuilder.start (ProcessBuilder.java:1073)
    leiningen.sass$sass.invokeStatic (sass.clj:85)
    leiningen.sass$sass.doInvoke (sass.clj:71)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.lang.Var.applyTo (Var.java:705)
    clojure.core$apply.invokeStatic (core.clj:669)
    clojure.core$apply.invoke (core.clj:662)
    leiningen.core.main$partial_task$fn__7380.doInvoke (main.clj:284)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invokeStatic (core.clj:669)
    clojure.core$apply.invoke (core.clj:662)
    leiningen.core.main$apply_task.invokeStatic (main.clj:334)
    leiningen.core.main$apply_task.invoke (main.clj:320)
    leiningen.core.main$resolve_and_apply.invokeStatic (main.clj:343)
    leiningen.core.main$resolve_and_apply.invoke (main.clj:336)
    leiningen.init$init.invokeStatic (init.clj:88)
    leiningen.init$init.doInvoke (init.clj:75)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.RestFn.applyTo (RestFn.java:132)
    clojure.lang.Var.applyTo (Var.java:705)
    clojure.core$apply.invokeStatic (core.clj:669)
    clojure.core$apply.invoke (core.clj:662)
    leiningen.core.main$partial_task$fn__7380.doInvoke (main.clj:284)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.RestFn.applyTo (RestFn.java:132)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invokeStatic (core.clj:669)
    clojure.core$apply.invoke (core.clj:662)
    leiningen.core.main$apply_task.invokeStatic (main.clj:334)
    leiningen.core.main$apply_task.invoke (main.clj:320)
    leiningen.core.main$resolve_and_apply.invokeStatic (main.clj:343)
    leiningen.core.main$resolve_and_apply.invoke (main.clj:336)
    leiningen.core.main$_main$fn__7469.invoke (main.clj:453)
    leiningen.core.main$_main.invokeStatic (main.clj:442)
    leiningen.core.main$_main.doInvoke (main.clj:439)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.lang.Var.applyTo (Var.java:705)
    clojure.core$apply.invokeStatic (core.clj:667)
    clojure.main$main_opt.invokeStatic (main.clj:514)
    clojure.main$main_opt.invoke (main.clj:510)
    clojure.main$main.invokeStatic (main.clj:664)
    clojure.main$main.doInvoke (main.clj:616)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.lang.Var.applyTo (Var.java:705)
    clojure.main.main (main.java:40)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
 at java.lang.ProcessImpl.create (ProcessImpl.java:-2)
    java.lang.ProcessImpl.<init> (ProcessImpl.java:499)
    java.lang.ProcessImpl.start (ProcessImpl.java:158)
    java.lang.ProcessBuilder.start (ProcessBuilder.java:1110)
    java.lang.ProcessBuilder.start (ProcessBuilder.java:1073)
    leiningen.sass$sass.invokeStatic (sass.clj:85)
    leiningen.sass$sass.doInvoke (sass.clj:71)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.lang.Var.applyTo (Var.java:705)
    clojure.core$apply.invokeStatic (core.clj:669)
    clojure.core$apply.invoke (core.clj:662)
    leiningen.core.main$partial_task$fn__7380.doInvoke (main.clj:284)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invokeStatic (core.clj:669)
    clojure.core$apply.invoke (core.clj:662)
    leiningen.core.main$apply_task.invokeStatic (main.clj:334)
    leiningen.core.main$apply_task.invoke (main.clj:320)
    leiningen.core.main$resolve_and_apply.invokeStatic (main.clj:343)
    leiningen.core.main$resolve_and_apply.invoke (main.clj:336)
    leiningen.init$init.invokeStatic (init.clj:88)
    leiningen.init$init.doInvoke (init.clj:75)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.RestFn.applyTo (RestFn.java:132)
    clojure.lang.Var.applyTo (Var.java:705)
    clojure.core$apply.invokeStatic (core.clj:669)
    clojure.core$apply.invoke (core.clj:662)
    leiningen.core.main$partial_task$fn__7380.doInvoke (main.clj:284)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.RestFn.applyTo (RestFn.java:132)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invokeStatic (core.clj:669)
    clojure.core$apply.invoke (core.clj:662)
    leiningen.core.main$apply_task.invokeStatic (main.clj:334)
    leiningen.core.main$apply_task.invoke (main.clj:320)
    leiningen.core.main$resolve_and_apply.invokeStatic (main.clj:343)
    leiningen.core.main$resolve_and_apply.invoke (main.clj:336)
    leiningen.core.main$_main$fn__7469.invoke (main.clj:453)
    leiningen.core.main$_main.invokeStatic (main.clj:442)
    leiningen.core.main$_main.doInvoke (main.clj:439)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.lang.Var.applyTo (Var.java:705)
    clojure.core$apply.invokeStatic (core.clj:667)
    clojure.main$main_opt.invokeStatic (main.clj:514)
    clojure.main$main_opt.invoke (main.clj:510)
    clojure.main$main.invokeStatic (main.clj:664)
    clojure.main$main.doInvoke (main.clj:616)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.lang.Var.applyTo (Var.java:705)
    clojure.main.main (main.java:40)

EIDT: PATH problems again with my shell environment, all good now, I managed to build editor and engine. I’ll get to building stuff now :partying_face: