There’s a bug in the engine which is problematic for us (I previously reported it here: https://github.com/defold/defold/issues/5287). As we’re coming close to app release, and the bug hasn’t been fixed yet, I’m trying to patch the defold engine myself.
I’m running into issues trying to build the engine on a clean repo with tag 1.2.176
for iOS on macOS Catalina. I packaged the sdks under./local_sdks
:
MacOSX10.15.sdk.tar.gz
XcodeDefault12.0.xctoolchain.tar.gz
iPhoneOS14.0.sdk.tar.gz
iPhoneSimulator14.0.sdk.tar.gz
And I installed the dependencies: ./scripts/build.py install_ext --platform=armv7-darwin --package-path=./local_sdks
Both worked. But when trying to build the engine (./scripts/build.py build_engine --platform=armv7-darwin
), I get the following, which I am not sure how to handle:
[exec] git remote get-url origin
Running 'build_engine'
env DM_BOB_ROOTFOLDER=/var/folders/hz/qn05zbsd5fj59kqv03mhzdqm0000gs/T/bob-light-vSsKwV
Building dlib for x86_64-darwin
[exec] python /Users/marco/Dev/defold/tmp/dynamo_home/ext/bin/waf --prefix=/Users/marco/Dev/defold/tmp/dynamo_home --skip-tests distclean configure build install --platform=x86_64-darwin --skip-tests --skip-build-tests
'distclean' finished successfully (0.010s)
Checking for program valgrind : not found
Checking for program ccache : ok /usr/local/bin/ccache
Checking for program nodejs : not found
Checking for program dsymutil : ok /usr/bin/dsymutil
Checking for program zip : ok /usr/bin/zip
Checking for program gcc,cc : ok /Users/marco/Dev/defold/tmp/dynamo_home/ext/SDKs/XcodeDefault12.0.xctoolchain/usr/bin/clang
Checking for program g++,c++ : ok /Users/marco/Dev/defold/tmp/dynamo_home/ext/SDKs/XcodeDefault12.0.xctoolchain/usr/bin/clang++
Checking for program javac : ok /usr/bin/javac
Checking for program java : ok /usr/bin/java
Checking for program jar : ok /usr/bin/jar
'configure' finished successfully (0.049s)
Waf: Entering directory `/Users/marco/Dev/defold/engine/dlib/build'
Waf: Leaving directory `/Users/marco/Dev/defold/engine/dlib/build'
At least one compiler (gcc, ..) must be selected
None
Traceback (most recent call last):
File "./scripts/build.py", line 2143, in <module>
f()
File "./scripts/build.py", line 1024, in build_engine
self._build_engine_lib(args, lib, host, skip_tests = skip_tests)
File "./scripts/build.py", line 989, in _build_engine_lib
run.env_command(self._form_env(), args + plf_args + self.waf_options + skip_build_tests, cwd = cwd)
File "/Users/marco/Dev/defold/build_tools/run.py", line 63, in env_command
return _exec_command(args, shell = False, stdout = None, env = env, **kwargs)
File "/Users/marco/Dev/defold/build_tools/run.py", line 41, in _exec_command
raise ExecException(process.returncode, output)
run.ExecException
It looks like a lib called “wafadmin” is missing an env var that tells it which compiler to use? I tried injecting the env var CC_NAME
into the build script, but couldn’t.
Any idea what’s wrong here?
I’m not sure how finicky the rest of the build process is and if this is just the first issue of lots to come, so if someone with a working iOS build setup is willing to recompile the engine with my change, I’d be very happy too
My end goal is to tell the engine to only use public dns servers (https://github.com/defold/defold/blob/master/engine/dlib/src/dlib/dns.cpp#L50) to work around the iOS permission issue.
I’m obviously not able to test this yet, but changing the function at https://github.com/defold/defold/blob/master/engine/dlib/src/dlib/dns.cpp#L198 to the following should most likely do this:
static void ConfigureChannel(Channel* channel)
{
ares_set_servers_csv(channel->m_Handle, DEFAULT_DNS_SERVERS);
}