You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was thinking about a PR, but it couldn't edit Wiki pages. And there's a discussion about improving mozjs dev experience by providing binary build.
So, I guess this might be the best place for my experience setting up Windows environment.
Windows remains the most difficult target to bootstrap because it will have to compile mozjs (a spider monkey fork for servo).
You will have to install LLVM, Moztools, Visual Studio Build Tools, and even set the right environment variables.
The error messages when building are usually not too helpful. So here are some tips you can look for.
Run mach bootstrap first
This will install all necessary dependencies mentioned above. But there are still some manual steps you'll need to do depending on how and what you are building.
If you build with mach build
This is the official way to build servo. mach will also set the correct path to the tools installed by mach bootstrap.
So if you see errors when building mozjs-sys, chances are there is something wrong with VS C++ tools.
While servo install VS C++ 2019, official Rust will install 2022 build tools already when installing Rust.
Check what's your latest VS in Program Files and Program Files (x64) and download the vs_buildtools.exe for that version.
For my case, I need to download 2022's vs_buildtools.exe.
And then install Desktop development with C++ with C++ ATL and C++MFC headers checked.
If you build with cargo build
You will probably also have issues above. Make sure VS build tools are installed correctly.
And next is missing some variables which would be set during mach build.
Assuming you are on x86_64, here are some commands for Powershell:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I was thinking about a PR, but it couldn't edit Wiki pages. And there's a discussion about improving mozjs dev experience by providing binary build.
So, I guess this might be the best place for my experience setting up Windows environment.
Windows remains the most difficult target to bootstrap because it will have to compile
mozjs
(a spider monkey fork for servo).You will have to install LLVM, Moztools, Visual Studio Build Tools, and even set the right environment variables.
The error messages when building are usually not too helpful. So here are some tips you can look for.
Run
mach bootstrap
firstThis will install all necessary dependencies mentioned above. But there are still some manual steps you'll need to do depending on how and what you are building.
If you build with
mach build
This is the official way to build servo.
mach
will also set the correct path to the tools installed bymach bootstrap
.So if you see errors when building
mozjs-sys
, chances are there is something wrong with VS C++ tools.While servo install VS C++ 2019, official Rust will install 2022 build tools already when installing Rust.
Check what's your latest VS in
Program Files
andProgram Files (x64)
and download the vs_buildtools.exe for that version.For my case, I need to download 2022's vs_buildtools.exe.
And then install
Desktop development with C++
withC++ ATL
andC++MFC
headers checked.If you build with
cargo build
You will probably also have issues above. Make sure VS build tools are installed correctly.
And next is missing some variables which would be set during
mach build
.Assuming you are on
x86_64
, here are some commands for Powershell:You can check the variable with following commands after reopen terminal:
If you are building mozjs alone
You will also need to set the path to moztools. If you also have servo and already run
mach bootstrap
. There's already on inservo/target
:Hope this can help while troubleshooting. Thre are more tips in wiki for Windows troubleshooting
Beta Was this translation helpful? Give feedback.
All reactions