servo
servo copied to clipboard
Windows build error: AttributeError: 'NoneType' object has no attribute 'decode'
I am trying to build Servo on Windows 10, and using both normal Mach and python Mach I get this error:
AttributeError: 'NoneType' object has no attribute 'decode'
File "S:\servo\python\servo\build_commands.py", line 331, in build
print(stderr.decode(encoding))
What's going on here?
Oh, I think you might get more useful output if you change this line to stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
.
Okay, I'm getting closer. Now I'm getting:
Failed to run vcvarsall. stderr:
The system cannot find the path specified.
I'm, not entirely sure what file it's referring to. I don't know my way around the project yet.
It's trying to run vcvarsall.bat from the Visual Studio installation. Apparently the path to it from https://github.com/servo/servo/blob/8dc59c698529bf7ca45f06f468311414dd132fce/python/servo/build_commands.py#L319 doesn't match your setup for some reason.
Ok, turns out I hadn't installed visual studio redist properly. Sorry to keep bothering, but now when I try building, it gives me a Lot of panic about LLVM while compiling strsim v0.9.3. the gist of it is:
lld-link: error: could not open 'kernel32.lib': no such file or directory
lld-link: error: could not open 'ws2_32.lib': no such file or directory
lld-link: error: could not open 'bcrypt.lib': no such file or directory
lld-link: error: could not open 'advapi32.lib': no such file or directory
lld-link: error: could not open 'userenv.lib': no such file or directory
lld-link: error: could not open 'kernel32.lib': no such file or directory
lld-link: error: could not open 'msvcrt.lib': no such file or directory
but I can give the full, very long output if it's necessary. I have tried using both the 64 and 32 bit version of LLVM, and linking LLVM in .cargo/config.toml. What am I doing wrong? I've never heard of LLVM so I'm not familiar with how it thinks. Some cursory google searching only revealed problems with VS specifically, but I'm using VSCode and the same thing happens when I run it in powershell. This also happens with both the python and the mach.bat, although that shouldn't be the issue, seeing as mach.bat simply runs the python script.
The only supported windows builds use Visual Studio. It's hard to tell what you're actually trying to do if you're not following the steps from the README.
Oh, I'm sorry. I must have misunderstood. I followed all the steps, but I wasnt using Visual Studio, but instead Vim and VSCode.
The most important questions are:
- What version of Visual Studio is installed?
- what terminal are you running build commands from?
I have Visual Studio build tools 16.11.8. I used both Powershell and the built in terminal for VSCode, which is also powershell.
same issue here for
lld-link: error: could not open 'kernel32.lib': no such file or directory
lld-link: error: could not open 'ws2_32.lib': no such file or directory
lld-link: error: could not open 'bcrypt.lib': no such file or directory
lld-link: error: could not open 'advapi32.lib': no such file or directory
lld-link: error: could not open 'userenv.lib': no such file or directory
lld-link: error: could not open 'kernel32.lib': no such file or directory
lld-link: error: could not open 'msvcrt.lib': no such file or directory
``
Closing this. There are new build instructions for Windows that should resolve some of these kind of issues. If this still comes up following those feel free to open a new bug.