Started mozillabuild, added Rust and LLVM to path with
export PATH=$PATH:"/c/Program Files/LLVM/bin"
export PATH=$PATH:"/c/Users/miles.thornton/AppData/Local/Programs/Rust stable MSVC 1.63/bin"
and set the mozconfig file with
export MOZCONFIG=/c/SOURCE20/javascript_dir/mozconfig/js102_win_release
Tried to build with
./mach build
This churns away for a while and gives the following error
Can anybody give me any help? What am I doing wrong?
In older versions I remember that the mozjs tarball did not contain mozglue/dllservices and I had to manually add it but it looks like things have changed in the build since then.
Is there something similar that I need to do?
I would be very grateful for any help.
It looks like my comments in my mozconfig file starting with ‘#’ have been turned into markup in my post above. Apologies. I hope it still makes sense…
Actually, I’ve just realised that I can edit it so I have removed the comments…
Thanks for the reply and info.
I had managed to build it in the end yesterday by doing something similar (I edited mozglue/misc/moz.build and removed WindowsDllMain.cpp from SOURCES so it just didn’t compile it). However, I wasn’t sure if this was the “correct” thing to do and whether I would just get problems later on, so thanks for the info. Good to know that what I did was OK.
Did you also have to do something for duplicate definitions of HeapAlloc, HeapFree, and HeapReAlloc? I’m thinking that I need to comment it out from /mozilla-unified/memory/mozalloc/winheap.cpp. What solution did you try, if you also had this problem?
After doing that, I was able to compile and run, and the interpreter seems to be working. Now I have to link it to my Windows app and see if I have any luck.
Thanks for sharing your mozconfig, it was extremely helpful!
build_scripts/setup.py is a script that will walk through all the required steps, from downloading sources and correct mozilla-build, to applying required patches.
build_scripts/patches contains all the patches which are needed for build to complete and/or for embedding to work properly with MSVC.
Note: setup.py in mozjs repo only builds x86 library, but it can be easily adapted to build x64 as well (I haven’t tested that though, so it might require additional SM patches)
Note 2: mozjs repo contains only patches that must be applied before build (i.e. they can’t be applied post-build).