Fix crash in Jolt when doing incremental builds #111408
Merged
+4
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We've had at least one report of someone crashing here after doing an incremental build after #110965 was merged:
godot/thirdparty/jolt_physics/Jolt/RegisterTypes.cpp
Lines 72 to 90 in d61cd91
The reason for this isn't confirmed, but is (as discussed in #110965) potentially as follows:
thirdparty/jolt_physics
(and possibly other third-party vendorings as well).CPPPATH
, it likely clashes with us relying onfast_unsafe=yes
by default whendev_build=yes
, which enables theimplicit_cache
SCons option, which in its documentation states that it causes SCons to "ignore any changes that may have been made to search paths (like $CPPPATH or $LIBPATH)".Jolt/RegisterTypes.cpp
didn't have any changes to it, it should still have been recompiled, since its header dependencies did change, but these dependencies were likely not restored because offast_unsafe=yes
.std::abort
in its version check because the compilation environment of that particular file doesn't line up with the caller's compilation environment, leading to this crash.While the fix here is as simple as doing a clean rebuild, this will likely keep happening to people in the future as they go to bisect with
dev_build=yes
, since incremental builds from any commit between 1f56d96 and 9052d31 will be subject to this.As such, this PR cherrypicks jrouwe/JoltPhysics@9e48d59 in order to have some kind of change to
Jolt/RegisterTypes.cpp
, which should at least prevent the crash from happening going forward.Note that the crash is arguably a red herring here, the real problem is ending up with incomplete incremental builds because of what is likely to be
fast_unsafe=yes
, potentially across several third-party vendorings.