Windows and waf issue (SOLVED)

I’m trying to build the engine on windows 10. Using mingw32 shell I get this message:

Waf: The wscript in ‘e:\DefoldSource\defold\engine\dlib’ is unreadable
Traceback (most recent call last):
File “e:\DefoldSource\defold\tmp\dynamo_home\ext\bin\waf-2.0.20-36f5354d605298f6a89c09e0c7ef6c1d\waflib\Scripting.py”, line 102, in waf_entry_point
set_main_module(wscript)
File “e:\DefoldSource\defold\tmp\dynamo_home\ext\bin\waf-2.0.20-36f5354d605298f6a89c09e0c7ef6c1d\waflib\Scripting.py”, line 142, in set_main_module
Context.g_module=Context.load_module(file_path)
File “e:\DefoldSource\defold\tmp\dynamo_home\ext\bin\waf-2.0.20-36f5354d605298f6a89c09e0c7ef6c1d\waflib\Context.py”, line 362, in load_module
exec(compile(code,path,‘exec’),module.dict)
File “e:\DefoldSource\defold\engine\dlib\wscript”, line 9, in
import Options
ImportError: No module named Options
None
Traceback (most recent call last):
File “scripts/build.py”, line 1919, in
f()
File “scripts/build.py”, line 891, in build_engine
self._build_engine_lib(args, lib, host, skip_tests = skip_tests)
File “scripts/build.py”, line 861, in _build_engine_lib
run.env_command(self._form_env(), args + plf_args + self.waf_options + skip_build_tests, cwd = cwd)
File “e:\DefoldSource\defold\build_tools\run.py”, line 63, in env_command
return _exec_command(args, shell = False, stdout = None, env = env, **kwargs)
File “e:\DefoldSource\defold\build_tools\run.py”, line 41, in _exec_command
raise ExecException(process.returncode, output)
run.ExecException

Thanks

Did you install waf manually? Looks like you’re on a different version than the one installed using install_ext.

Ran build.py install_ext and it was fine up to this point:

Downloading DM_PACKAGES_URL/WindowsKits-8.1.tar.gz
Traceback (most recent call last):
File “scripts/build.py”, line 1919, in
f()
File “scripts/build.py”, line 479, in install_ext
self.install_sdk()
File “scripts/build.py”, line 504, in install_sdk
download_sdk( ‘%s/%s.tar.gz’ % (self.package_path, PACKAGES_WIN32_SDK_8), join(win32_sdk_folder, ‘WindowsKits’, ‘8.1’) )
File “scripts/build.py”, line 486, in download_sdk
dlpath = self._download(url)
File “scripts/build.py”, line 357, in _download
path = http_cache.download(url, lambda count, total: self._log(‘Downloading %s %.2f%%’ % (url, 100 * count / float(total))))
File “e:\DefoldSource\defold\build_tools\http_cache.py”, line 61, in download
hit = c.get(url)
File “e:\DefoldSource\defold\build_tools\http_cache.py”, line 24, in get
path = self._url_to_path(url)
File “e:\DefoldSource\defold\build_tools\http_cache.py”, line 21, in url_to_path
return os.path.join(self.root, mangle(url))
File “e:\DefoldSource\defold\build_tools\http_cache.py”, line 6, in mangle
return ‘%s%s’ % (url.hostname.replace(’.’, '
’), url.path.replace(’/’, ‘-’))
AttributeError: ‘NoneType’ object has no attribute ‘replace’

I’m not on windows so can’t check, but in general I think you should first run the package script package_win32_sdk.sh under script/package. That should create a WindowsKitssomething in a packages folder. When running build.py install_ext …, it expects to download packages from the path pointed to by the –package-path argument. That argument probably should accept local file paths, but I think for now it actually needs to be a url. I usually start a simple web server in my packages folder, using python: python -m SimpleHTTPServer (if using python 2.7, as you should when building defold). Then the install_ext command line should be something like ./scripts/build.py install_ext --platform=x86_64-win32 --package-path=http://0.0.0.0:8000
It looks like the WindowsKit version is slightly off right now, so you’ll probably need to tweak the numbers used in the scripts.

1 Like

Just confirming that you need to run a HTTP file server for the packages for this step to work currently. It’s a good candidate for the community to improve to allow to run without this necessary.

I made a PR to clarify the install_ext step:

Ran package_win32_sdk.sh. Placed results in the packages folder(WindowsKits-8.1.tar.gz). Using the simple web server I get this error:

Downloading http://0.0.0.0:8000/WindowsKits-8.1.tar.gz
Traceback (most recent call last):
File “scripts/build.py”, line 1919, in
f()
File “scripts/build.py”, line 479, in install_ext
self.install_sdk()
File “scripts/build.py”, line 504, in install_sdk
download_sdk( ‘%s/%s.tar.gz’ % (self.package_path, PACKAGES_WIN32_SDK_8), join(win32_sdk_folder, ‘WindowsKits’, ‘8.1’) )
File “scripts/build.py”, line 486, in download_sdk
dlpath = self._download(url)
File “scripts/build.py”, line 357, in _download
path = http_cache.download(url, lambda count, total: self._log(‘Downloading %s %.2f%%’ % (url, 100 * count / float(total))))
File “e:\DefoldSource\defold\build_tools\http_cache.py”, line 67, in download
response = urllib2.urlopen(req)
File “C:\Python27\lib\urllib2.py”, line 154, in urlopen
return opener.open(url, data, timeout)
File “C:\Python27\lib\urllib2.py”, line 429, in open
response = self._open(req, data)
File “C:\Python27\lib\urllib2.py”, line 447, in _open
‘_open’, req)
File “C:\Python27\lib\urllib2.py”, line 407, in _call_chain
result = func(*args)
File “C:\Python27\lib\urllib2.py”, line 1228, in http_open
return self.do_open(httplib.HTTPConnection, req)
File “C:\Python27\lib\urllib2.py”, line 1198, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 10049] The requested address is not valid in its context>

And if you open a browser and try the URL? Does the file download?

1 Like

I had to change it to http://localhost:8000

1 Like

Excellent to hear that you solved it!

1 Like