# Windows and waf issue (SOLVED)

**URL:** <https://forum.defold.com/t/windows-and-waf-issue-solved/65245>\
**Category:** Source Code\
**Created:** [May 21, 2020, 1:19pm UTC](https://forum.defold.com/t/windows-and-waf-issue-solved/65245 "2020-05-21T13:19:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![prunde](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/prunde/32/20423_2.png) [@prunde](https://forum.defold.com/u/prunde)\
**Post date:** [May 21, 2020, 1:19pm UTC](https://forum.defold.com/t/windows-and-waf-issue-solved/65245/1 "2020-05-21T13:19:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Erik\_Angelin](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/e/59ef9b/32.png) [@Erik\_Angelin](https://forum.defold.com/u/Erik_Angelin)\
**Post date:** [May 21, 2020, 1:33pm UTC](https://forum.defold.com/t/windows-and-waf-issue-solved/65245/2 "2020-05-21T13:33:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![prunde](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/prunde/32/20423_2.png) [@prunde](https://forum.defold.com/u/prunde)\
**Post date:** [May 21, 2020, 2:35pm UTC](https://forum.defold.com/t/windows-and-waf-issue-solved/65245/3 "2020-05-21T14:35:59Z")

</div>

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’

---

<div class="post-metadata">

**Author:** ![Erik\_Angelin](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/e/59ef9b/32.png) [@Erik\_Angelin](https://forum.defold.com/u/Erik_Angelin)\
**Post date:** [May 21, 2020, 3:05pm UTC](https://forum.defold.com/t/windows-and-waf-issue-solved/65245/4 "2020-05-21T15:05:23Z")

</div>

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 WindowsKits_something_ 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](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.

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [May 21, 2020, 3:18pm UTC](https://forum.defold.com/t/windows-and-waf-issue-solved/65245/5 "2020-05-21T15:18:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [May 21, 2020, 5:51pm UTC](https://forum.defold.com/t/windows-and-waf-issue-solved/65245/6 "2020-05-21T17:51:50Z")

</div>

I made a PR to clarify the install\_ext step:

[https://github.com/defold/defold/pull/4809](https://github.com/defold/defold/pull/4809)

---

<div class="post-metadata">

**Author:** ![prunde](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/prunde/32/20423_2.png) [@prunde](https://forum.defold.com/u/prunde)\
**Post date:** [May 21, 2020, 6:14pm UTC](https://forum.defold.com/t/windows-and-waf-issue-solved/65245/7 "2020-05-21T18:14:30Z")

</div>

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](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\>

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [May 21, 2020, 6:17pm UTC](https://forum.defold.com/t/windows-and-waf-issue-solved/65245/8 "2020-05-21T18:17:53Z")

</div>

> [@prunde](#):
>
> Downloading [http://0.0.0.0:8000/WindowsKits-8.1.tar.gz](http://0.0.0.0:8000/WindowsKits-8.1.tar.gz)

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

---

<div class="post-metadata">

**Author:** ![prunde](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/prunde/32/20423_2.png) [@prunde](https://forum.defold.com/u/prunde)\
**Post date:** [May 21, 2020, 7:15pm UTC](https://forum.defold.com/t/windows-and-waf-issue-solved/65245/9 "2020-05-21T19:15:06Z")

</div>

I had to change it to [http://localhost:8000](http://localhost:8000)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [May 21, 2020, 9:52pm UTC](https://forum.defold.com/t/windows-and-waf-issue-solved/65245/10 "2020-05-21T21:52:30Z")

</div>

Excellent to hear that you solved it!
