Page MenuHomeWildfire Games

Remove JS_New in favour of JS::Construct in preparation for SM91
ClosedPublic

Authored by wraitii on Jan 9 2022, 10:35 AM.

Details

Summary

Spidermonkey 91, the next ESR, removes JS_New in favour or JS::Construct.
See
https://github.com/mozilla-spidermonkey/spidermonkey-embedding-examples/blob/migration-guide/docs/Migration%20Guide.md#object-construction
and
https://bugzilla.mozilla.org/show_bug.cgi?id=1491055

This change is SM78 compatible and should be done beforehand.

Test Plan

Compile the game.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

wraitii created this revision.Jan 9 2022, 10:35 AM

Build failure - The Moirai have given mortals hearts that can endure.

builderr-debug-macos.txt
In file included from ../../../source/simulation2/serialization/StdDeserializer.cpp:26:
In file included from ../../../source/scriptinterface/FunctionWrapper.h:21:
In file included from /Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../source/scriptinterface/Object.h:21:
In file included from /Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../source/scriptinterface/ScriptConversions.h:21:
/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../source/scriptinterface/ScriptRequest.h:32:10: fatal error: 'js/RootingAPI.h' file not found
#include "js/RootingAPI.h"
         ^~~~~~~~~~~~~~~~~
In file included from ../../../source/simulation2/components/CCmpParticleManager.cpp:20:
In file included from ../../../source/simulation2/system/Component.h:25:
In file included from ../../../source/simulation2/system/ComponentManager.h:22:
In file included from ../../../source/scriptinterface/ScriptInterface.h:22:
In file included from ../../../source/scriptinterface/ScriptConversions.h:21:
/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../source/scriptinterface/ScriptRequest.h:32:10: fatal error: 'js/RootingAPI.h' file not found
#include "js/RootingAPI.h"
         ^~~~~~~~~~~~~~~~~
1 error generated.
make[1]: *** [obj/simulation2_Debug/StdDeserializer.o] Error 1
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[1]: *** [obj/simulation2_Debug/CCmpParticleManager.o] Error 1
make: *** [simulation2] Error 2

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/5467/display/redirect

Build is unstable, some tests have failed - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/6566/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/7173/display/redirect

wraitii requested review of this revision.Jan 9 2022, 11:45 AM
wraitii updated this revision to Diff 19406.Jan 9 2022, 12:28 PM

This won't trigger the assertion for nothing

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/6570/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

builderr-debug-macos.txt
fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/StaticAnalysisFunctions.h' has been modified since the precompiled header 'obj/simulation2_Debug/precompiled.h.gch' was built
note: please rebuild precompiled header 'obj/simulation2_Debug/precompiled.h.gch'
fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/StaticAnalysisFunctions.h' has been modified since the precompiled header 'obj/simulation2_Debug/precompiled.h.gch' was built
note: please rebuild precompiled header 'obj/simulation2_Debug/precompiled.h.gch'
1 error generated.
make[1]: *** [obj/simulation2_Debug/StdDeserializer.o] Error 1
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[1]: *** [obj/simulation2_Debug/CCmpParticleManager.o] Error 1
make: *** [simulation2] Error 2

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/5472/display/redirect

Compilation and (de)serialisaton works.

This revision was not accepted when it landed; it landed in state Needs Review.Jan 12 2022, 5:51 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.