servo icon indicating copy to clipboard operation
servo copied to clipboard

Windows build error: AttributeError: 'NoneType' object has no attribute 'decode'

Open SlashScreen opened this issue 3 years ago • 9 comments

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?

SlashScreen avatar Dec 21 '21 04:12 SlashScreen

Oh, I think you might get more useful output if you change this line to stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).

jdm avatar Dec 21 '21 04:12 jdm

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.

SlashScreen avatar Dec 21 '21 04:12 SlashScreen

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.

jdm avatar Dec 21 '21 14:12 jdm

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.

SlashScreen avatar Dec 22 '21 04:12 SlashScreen

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.

jdm avatar Dec 22 '21 04:12 jdm

Oh, I'm sorry. I must have misunderstood. I followed all the steps, but I wasnt using Visual Studio, but instead Vim and VSCode.

SlashScreen avatar Dec 22 '21 05:12 SlashScreen

The most important questions are:

  • What version of Visual Studio is installed?
  • what terminal are you running build commands from?

jdm avatar Dec 22 '21 12:12 jdm

I have Visual Studio build tools 16.11.8. I used both Powershell and the built in terminal for VSCode, which is also powershell.

SlashScreen avatar Dec 29 '21 02:12 SlashScreen

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
``

mota57 avatar Dec 12 '22 21:12 mota57

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.

mrobinson avatar Mar 16 '24 00:03 mrobinson