-
-
Notifications
You must be signed in to change notification settings - Fork 620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot build my GDExtension with Godot 4.4 #1729
Comments
Moving to https://github.com/godotengine/godot-cpp. |
Thanks for the report! Just to make sure I'm understanding correctly: the issue is caused by the classes that were added to Godot in your custom module, not the classes added in your GDExtension? That does make sense, given that all the generated classes are dumped into the same directory, and so scons would put them in the same I'm not sure what tools (if any) scons gives us to deal with this. A potential solution is just making more directories for the generated |
Yes that's correct.
I don’t think this would work, because the issue is with the number of files passed to the command that creates the library, and we want to reduce that number. I am trying a different approach: create small intermediate static libraries and then link them together. Edit:
|
I can't find a single out-of-the-box method that is portable:
As far as I can tell, we are left with two possible approaches, but one requirement must be dropped:
|
does using a file for the options work?
|
Nice idea! It works, I am making some more tests and will provide a PR in a few hours if everything is fine. |
Tested versions
Reproducible with Godot 4.4
Not reproducible with Godot 4.3
System information
Godot v4.4.1.rc (afaa0cd4b) - Ubuntu 22.04.5 LTS 22.04 on X11 - X11 display driver, Multi-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1070 (nvidia; 535.183.01) - Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (8 threads)
Issue description
I encountered an unusual build error while porting my project from Godot 4.3 to 4.4. My project consists of several custom modules registering 94 classes to
ClassDB
and a small GDExtension written in C++.Godot 4.4 itself builds without errors, and godot-cpp for 4.4 also compiles successfully. However, building my extension fails with the following error:
In the
ar rc
command, 1050 object files are listed, including the 94 from my project. The total length of the arguments is 131,107 characters. I believe the error occurs because the arguments are interpreted as a single entity, exceeding the system's limit of MAX_ARG_STRLEN (131,072).To confirm this, I commented out some of my
GDREGISTER_CLASS
calls to reduce the total argument length below the threshold, and the build succeeded. Another potential workaround could be relocating my project to a directory with a shorter path (though I haven’t tested this; my current project path is only 47 characters long).As Godot continues to grow, I suspect more users on similar Unix-like systems will encounter this limitation.
I'm unsure whether to report this issue to godot-cpp, or even scons directly, given its potential impact on Godot’s documentation. Please let me know if I should transfer this bug report elsewhere.
Notes:
--debug=stacktrace
) produces the following error when the build fails:Steps to reproduce
Increase the number of classes registered to
ClassDB
then build the GDextension C++ exampleMinimal reproduction project (MRP)
Let me know if you need one (it's not a trivial task)
The text was updated successfully, but these errors were encountered: