Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Servo does not compile with Visual Studio 2017 #16305

Closed
larsbergstrom opened this issue Apr 7, 2017 · 10 comments
Closed

Servo does not compile with Visual Studio 2017 #16305

larsbergstrom opened this issue Apr 7, 2017 · 10 comments
Labels

Comments

@larsbergstrom
Copy link
Contributor

@larsbergstrom larsbergstrom commented Apr 7, 2017

From a comment by Ahmed Charles on the recent Hacks article:
It doesn’t seem like the instructions here can work because servo doesn’t currently support MSVC 2017. I assume that if this set of instructions was tested, it worked because MSVC 2015 was installed already. The mach.bat looks for %VS140COMNTOOLS%, which is MSVC 2015.

Note, this can be worked around by executing the appropriate vcvarsall.bat. (I wasn’t able to get it to work under powershell and it just seems to complicate things compared to using cmd consistently.)

However, there’s a second error, which is that the MSVC 2017 vcvarsall.bat sets %PLATFORM% to be ‘x64’ rather than ‘X64’, which is what is expected in util.host_triple() and therefore, the appropriate rust download can’t be found.

The third problem is that if a recent version of cmake isn’t in the path, it will download 3.6.1, which doesn’t support MSVC 2017.

The fourth problem, which I haven’t figured out how to fix is that “\servo\target\debug\build\mozjs_sys-b75999929c5a0ce6\out\dist\include\js\TraceKind.h” fails to build with MSVC 2017 due to a syntax error: (176): error C2760: syntax error: expected ‘)’ not ‘…’

It looks like valid C++ to me, but I can’t figure out what’s going on.

@alex-mayorga
Copy link

@alex-mayorga alex-mayorga commented Apr 7, 2017

¡Hola Lars!

Ended up here from https://twitter.com/alex_mayorga/status/850154408109277185

Glad to see I was not just missing something obvious along the way =)

Perhaps link this issue to https://hacks.mozilla.org/2017/04/hacking-contributing-to-servo-on-windows/ to save others some head scratching?

¡Gracias!

@jdm
Copy link
Member

@jdm jdm commented Apr 7, 2017

@larsbergstrom
Copy link
Contributor Author

@larsbergstrom larsbergstrom commented Apr 7, 2017

@alex-mayorga Thanks for the comment and tweet! And I'm sorry the experience was totally lame.

I'm trying to figure out if we should:
a) update the article to point to VS 2015 for now (instead of VS 2017)
b) rush like mad to get VS 2017 working with the toolchain and hope that nobody else notices :-)

Maybe we should do both?

cc @Jayflux

@Coder206
Copy link
Contributor

@Coder206 Coder206 commented Apr 7, 2017

@larsbergstrom This afternoon, I have been trying to get VS 2015 and I can't seem to download a new binary from MS. If we can't download VS2015 any more, I don't see a valid long term reason to keep on working with it.

https://www.microsoft.com/en-us/download/details.aspx?id=48146

@Boddlnagg
Copy link

@Boddlnagg Boddlnagg commented Apr 8, 2017

Yeah, it seems like older versions are only offered for download if you have a (free) Microsoft Dev Essentials subscription: https://www.visualstudio.com/vs/older-downloads/

@jasonwilliams
Copy link
Contributor

@jasonwilliams jasonwilliams commented Apr 8, 2017

ahh thats annoying!
I did try this out in a VM with little problem. Maybe it already had VS 2015 on it from before

Anything i can do to help?

@ahmedcharles
Copy link
Contributor

@ahmedcharles ahmedcharles commented Apr 9, 2017

MSVC 2017 doesn't have a single install location anymore that can be used to determine where the compiler binaries are. So, one option is to require the user launch python mach from a "x64 Native Tools Command Prompt for VS 2017", which should have the same effect as the current script. The other approach is to use vswhere to detect a valid 2017 installation. Though, that would require distributing an executable.

On the plus side, I already submitted issues and/or PRs which fixed the C++ compile error and I can verify that it works if you call python mach build --dev directly from a VS command prompt.

@Coder206
Copy link
Contributor

@Coder206 Coder206 commented Apr 9, 2017

According to Microsoft, here are some other ways this could be addressed.

@atouchet
Copy link
Contributor

@atouchet atouchet commented Apr 14, 2017

Was this fixed with #16307?

@larsbergstrom
Copy link
Contributor Author

@larsbergstrom larsbergstrom commented Apr 14, 2017

Indeed! Great catch, @atouchet :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
8 participants
You can’t perform that action at this time.