Page MenuHomeWildfire Games

Remove DefPersistentRooted and unneeded includes.
ClosedPublic

Authored by wraitii on Nov 11 2020, 9:57 AM.

Details

Summary

JS::PersistentRooted originally required a context/runtime to be created in. However, SM38 added a way to create an unitialized one to be init()-ed later.
This can be used to remove DefPersistentRooted.

OG patch by @Itms
Part of SM52 migration, stage: SM45 compatible.

Test Plan

Compile, test in-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.Nov 11 2020, 9:57 AM
wraitii updated this revision to Diff 13845.Nov 11 2020, 10:27 AM

Itms' version kept the unique_ptr but this actually not necessary: as written in the summary, we can since SM38 initialize PersistentRooted out of line.

The shared_ptr ones are different as we do use the reference count.

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

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

Stan added a subscriber: Stan.Nov 11 2020, 10:53 AM
Stan added inline comments.
source/lobby/XmppClient.h
1 ↗(On Diff #13845)
  1. You might like D1753
source/simulation2/system/ComponentManager.h
73 ↗(On Diff #13845)

Comment still accurate? Caps, final dot. Should be on top too.

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

builderr-debug-macos.txt
../../../source/simulation2/scripting/JSInterface_Simulation.cpp:155:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CFixedVector2D(-halfSize.X, -halfSize.Y),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
fatal error: fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/Assertions.h' has been modified since the precompiled header 'obj/gui_Debug/precompiled.h.gch' was built
file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/Assertions.h' has been modified since the precompiled header 'obj/gui_Debug/precompiled.h.gch' was built
1 error generated.
make[1]: *** [obj/gui_Debug/CMiniMap.o] Error 1
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[1]: *** [obj/gui_Debug/GUIManager.o] Error 1
make: *** [gui] Error 2

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

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

builderr-debug-macos.txt
../../../source/simulation2/scripting/JSInterface_Simulation.cpp:155:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CFixedVector2D(-halfSize.X, -halfSize.Y),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/Assertions.h' has been modified since the precompiled header 'obj/gui_Debug/precompiled.h.gch' was built
fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/Assertions.h' has been modified since the precompiled header 'obj/gui_Debug/precompiled.h.gch' was built
1 error generated.
make[1]: *** [obj/gui_Debug/GUIManager.o] Error 1
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[1]: *** [obj/gui_Debug/CMiniMap.o] Error 1
make: *** [gui] Error 2

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

wraitii requested review of this revision.Nov 11 2020, 11:28 AM
wraitii updated this revision to Diff 13865.Nov 12 2020, 7:01 AM

Tweaks before merging.

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

builderr-debug-macos.txt
../../../source/simulation2/scripting/JSInterface_Simulation.cpp:155:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CFixedVector2D(-halfSize.X, -halfSize.Y),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
In file included from ../../../source/graphics/tests/test_Camera.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/graphics/tests/test_Camera.h:168:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CVector3D(-101.0f, -101.0f, 101.0f),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
In file included from ../../../source/simulation2/tests/test_SerializeTemplates.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/simulation2/tests/test_SerializeTemplates.h:39:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        3, 0, 1, 4, 1, 5
                        ^~~~~~~~~~~~~~~~
                        {               }
1 warning generated.

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

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

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

Freagarach added a subscriber: Freagarach.EditedNov 12 2020, 7:30 AM
  • Tested local MP with PetraAI.
  • Tested loading map in Atlas.

Can't comment on the code.
However, one of the tests hangs.

wraitii updated this revision to Diff 13867.Nov 12 2020, 8:01 AM

Hanging tests revealed a bug in my changes, I need to reset() the ctor since we could be hotloading.
This fixes it.

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

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

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

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

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

builderr-debug-macos.txt
../../../source/simulation2/scripting/JSInterface_Simulation.cpp:155:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CFixedVector2D(-halfSize.X, -halfSize.Y),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/Assertions.h' has been modified since the precompiled header 'obj/gui_Debug/precompiled.h.gch' was built
fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/Assertions.h' has been modified since the precompiled header 'obj/gui_Debug/precompiled.h.gch' was built
1 error generated.
make[1]: *** [obj/gui_Debug/CMiniMap.o] Error 1
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[1]: *** [obj/gui_Debug/GUIManager.o] Error 1
make: *** [gui] Error 2

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

wraitii updated this revision to Diff 13868.Nov 12 2020, 8:22 AM

Still triggering an assertion in IsInList. I think PersistentRooted is doing something I don't expect, and I don't really care to understand what right now, so this reverts to Itms' unique_ptr diff, which worked fine.

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

builderr-debug-macos.txt
../../../source/simulation2/scripting/JSInterface_Simulation.cpp:155:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CFixedVector2D(-halfSize.X, -halfSize.Y),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
fatal error: file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/Assertions.h' has been modified since the precompiled header 'obj/gui_Debug/precompiled.h.gch' was builtfatal error: 
file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/mozilla/Assertions.h' has been modified since the precompiled header 'obj/gui_Debug/precompiled.h.gch' was built
1 error generated.
make[1]: *** [obj/gui_Debug/GUIManager.o] Error 1
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[1]: *** [obj/gui_Debug/CMiniMap.o] Error 1
make: *** [gui] Error 2

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

This revision was not accepted when it landed; it landed in state Needs Review.Nov 12 2020, 9:24 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.