Repository navigation
Description
Godot version
v4.5.1.stable.official [f62fdbde1]
godot-cpp version
4.4 [269c925]
System information
Godot v4.5.1.stable - Pop!_OS 22.04 LTS on X11 - X11 display driver, Single-window, 3 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4070 Ti - AMD Ryzen 9 7950X 16-Core Processor (32 threads) - 61.94 GiB memory
Issue description
In #1747, we added the "use_static_cpp" flag for Linux, and made it enabled by default
However, in my testing, this appears to break reload. :-/ Specifically, it prevents Godot from loading the new versions of any virtual methods. Other aspects of hot reload may still work, but I'm not sure
For reusable GDExtensions (ie not ones with game logic), enabling "use_static_cpp" makes sense as a default. However, for ones that include game logic, reload is very important!
We have a couple options:
- Make
use_static_cppdefault to disabled - Make
use_hot_reloaddefault to disabled - Automatically disable
use_static_cppifuse_hot_reloadis enabled - Automatically disable
use_hot_reloadifuse_static_cppis enabled - Figure out some change to godot-cpp that allows
use_static_cppto still work withuse_hot_reload?
Unfortunately, I have no idea how to do nr 5
I kind of wish we could do nr 2, but that's been the default for so long, it would be pretty disruptive. (This also applies to nr 4, which would effectly lead to nr 2, since that would be what happens with no options.)
So, only nr 1 and nr 3 are really viable, given that use_static_cpp has only been around for a short time
Steps to reproduce
- Make a GDExtension with a
Nodethat prints something in_process() - In the editor, make a scene that has this node
- Notice that the log is filling up with your print statements!
- Rebuild the GDExtension, and focus on the editor
- Notice that your prints have stopped appearing in the log
Minimal reproduction project
Haven't had a chance to make one (but would probably be useful if other folks want to look into it)
Activity
dsnopek commentedon Nov 1, 2025
I've made PRs for:
use_static_cppto disabled #1878I'm probably leaning to #1878 at this point
enetheru commentedon Nov 2, 2025
does this solve any of these related issues?
#1847
#1712
#1502
dsnopek commentedon Nov 2, 2025
Ah, it could certainly be related to #1847 - I think the other two are from before the
use_static_cppflag was added for LinuxIvorforce commentedon Nov 3, 2025
It seems to me that hot reload is only needed for builds used locally, while using static cpp is only needed for builds sent out to people.
Theoretically, they should be mutually exclusively useful. I'd prefer that for the convenience of the user.
Is that your suggestion number 3?
dsnopek commentedon Nov 3, 2025
Sort of. PR #1877 implements nr 3
The problem is that
use_hot_reloaddefaults to enabled on all builds except release templates. So, if we do #1877 and folks don't change their arguments to scons at all, they'll end up with editor and debug templates that haveuse_static_cppdisabled, and release templates that have it enabled. That'll be weird and unexpected.That's why I wrote above that I wish we could do nr 2, so that people were passing
use_hot_relead=yeswhen they actually needed hot reload, but at the moment, I suspect folks don't even know that option exists because it's enabled by default. But at this point, if we changed the default on that, it'd be disruptive since it's been the default for so long.The least disruptive change is nr 1, because that's only been the default for a little while
Ivorforce commentedon Nov 3, 2025
I guess we don't have a convenient way to differentiate between the "builds I make for myself" and "builds I send to other people" then? (I'm not aware of any, anyway)
I would probably expect hot reload to work by default for local builds. So I think I'm with you to go with solution 1.
Explicitely set `use_static_cpp=yes` on Linux