Skip to content
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

GDScript compilation error with no description in built-in scripts #95563

Open
smedelyan opened this issue Aug 15, 2024 · 4 comments
Open

GDScript compilation error with no description in built-in scripts #95563

smedelyan opened this issue Aug 15, 2024 · 4 comments

Comments

@smedelyan
Copy link

smedelyan commented Aug 15, 2024

Tested versions

  • Reproducible in 4.3 stable

System information

Godot v4.3.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1660 (NVIDIA; 32.0.15.6081) - AMD Ryzen 7 2700X Eight-Core Processor (16 Threads)

Issue description

I'm yet to figure out the context and describe the issue precisely. I've opened my project (previously on 4.2.2) in newly released 4.3 and that gave me a fuzzy compilation error:
image

Also, this seems to cause this error next:

Invalid call. Nonexistent function 'new' in base 'GDScript'

Also, the editor crashes on exit with no helpful information:
image

I tried to remove .godot/ folder, but that didn't help.

Context about project setup (something may be irrelevant to the issue, but I don't know what might be actually useful):

  1. I have a custom graph-based (GraphNode, GraphEdit) plugin for the editor. It also allows to configure custom GUI for particular data types via calling a static register_gui() function (which puts that gui in static Dictionary)
  2. configure_ineditor_plugins.gd is an autoload where all those register_gui() are invoked
    • This autoload is automatically added by another plugin called setup in its _enable_plugin() method. This plugin also provides EditorExportPlugin, but I don't believe this matters.
  3. The class that fails to load on the screenshot is a @tool script (basic GUI implementation provided by plugin) from which other @tool scripts (custom GUIs in editor/ folder, project-specific) inherit. This offending class inherits GraphNode which is experimental, but there are no visible errors in its code.
  4. The error comes from configure_ineditor_plugins.gd, but is caused by the compilation error.

Steps to reproduce

Don't have an MRP yet. This just happens when opening the project.

Minimal reproduction project (MRP)

Don't have one yet, sorry

@smedelyan smedelyan changed the title (Context to be defined yet) GDScript compilation error with no description. GDScript compilation error with no description in built-in scripts Aug 15, 2024
@github-project-automation github-project-automation bot moved this to For team assessment in GDScript Issue Triage Aug 15, 2024
@smedelyan
Copy link
Author

I'm trying to debug this myself, but am unable to build the engine from sources. Not sure whether it's worth to open a new issue, for now just posting here: https://forum.godotengine.org/t/line-too-long-when-compiling-engine-with-spine-godot-on-windows/92348 . It's been several days already with no answer, so I hope maybe someone can help me with building this to debug the issue

@smedelyan
Copy link
Author

smedelyan commented Nov 26, 2024

Finally, I've been able to track this down to this line:

push_error(vformat(R"(Could not resolve class "%s".)", p_class->fqcn), p_source);

There was completely no clue about which errors caused the failure, but after debugging the engine I got this error:

Image

I will share a small piece of the relevant code here:

Image

It seems to be related to lambdas. I changed this offending line to reference self.frame (it's a class field) and it compiled OK (though, later when I open a graph, I get a crash with null-reference - have not checked yet whether it's caused by this lambda setup or not).

It's also weird that I don't get any errors for line 140 from this screenshot which looks completely the same to me and should've caused a compile error as well, but it compiled OK.

Ideally, I'd like to see these "other_parser" errors in the output window.
For the particular error - I don't think it is correct (I guess, it's quite possible to capture the frame field within lambda scope - but even if this is not correct way to utilize lambdas, then why it's not telling anything on the other line?)


@AThousandShips can you please help me ping the right person to draw some attention to this as I'm afraid this issue got buried already?

@AThousandShips
Copy link
Member

This issue is already tracked for GDScript triage so it is probably not buried

@smedelyan
Copy link
Author

The crash was caused by this issue: #91857
Though, the lack of proper error message is still an issue (and, in fact, it is still not clear to me why it was not seeing class field frame; anyway, I just replaced that part with explicit function declaration instead of lambda). I had to compile the engine and debug gdscript loading process myself to finally get the error text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: For team assessment
Development

No branches or pull requests

3 participants