-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Attempting to use --doctool --gdscript-docs gives error Class "class name" hides a global script class. #84579
Comments
I tried the minimal reproduction project provided by #79497 with the custom compile of the commit that claimed to fix that issue. As i am using linux so for ease i have added the executable to the $PATH (Also please note that at this point in time the minimal reproduction project is made in Godot 4.1)
i then converted it to Godot 4.2 and tried the command again. this time no files get generated and the errors are:
minimal project of issue #79497: here's a video of me going through the process test-.2.mp4 |
I made the original issue/MRP, and I just tested and am able to replicate the findings here with 4.2-beta5, but I am still getting the original errors I reported with 4.1.3 (rather than the "hides a global script class"). The original working script ( This appears to be a regression. It looks like the build artifact for #82116 has expired, or I would test it separately. 4.1.3-stable errors:
4.2-beta5 errors:
Edit: To clarify, this was using the original MRP from #79497. I did open it in 4.2-beta5 to convert it prior to testing in that version. All the scripts do still appear to be generating documentation correctly inside the script editor in 4.2-beta5 (like they did in 4.1). |
TL;DR: for a workaround use This is caused by a filename mismatch here: godot/modules/gdscript/gdscript_analyzer.cpp Lines 357 to 368 in 13a0d6e
The script is somehow loaded twice. Once by the doctool and once sometime previously (No idea how/when/why). If you invoke the doctool like this: However, the same file has previously been loaded from The same problem can be demonstrated from within gdscript. MRP (filename class_name Test
func _ready():
load("test.gd") In the above MRP, the file is first loaded from The good news: I found a workaround for this issue. Try invoking with The bad news: Properly fixing this could be very challenging. Checking whether two file paths are the same is hard, you normally open them and check their device id and inode (Or whatever the windows equivalent is). Now, considering the filesystem abstraction provided by godot this becomes way worse, as it needs to handle multiple edge cases, for example whether |
Could folks check whether this is working as expected in However, the executable does not terminate - which I believe may be unintended? Created a fix for this in #95656. |
Godot version
Godot_v4.2-beta5_linux
System information
Linux Mint 21.2
Issue description
Even though #79497 is assumed to be fixed i am having the same errors on the same reproduction project (after the project converts to
Godot_v4.2-beta5
)I tried the process by re-creating the project inside Godot_v4.2-beta5 and the same errors appeared again
test-.3.mp4
Steps to reproduce
open the folder "newDocToolsTest" inside the terminal
![Screenshot from 2023-11-07 19-22-10](https://private-user-images.githubusercontent.com/77773850/281071413-488e0dea-24c3-4075-b611-f0b380b18300.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNjg0MTQsIm5iZiI6MTczOTE2ODExNCwicGF0aCI6Ii83Nzc3Mzg1MC8yODEwNzE0MTMtNDg4ZTBkZWEtMjRjMy00MDc1LWI2MTEtZjBiMzgwYjE4MzAwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDA2MTUxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk5NmY2MTM1NzcwNTg5Njg4NDM0ZjBhMjE1YTZhOTk0MGYyNWIzNGViNjEwNzM2ZTE0ZjJhZjU1YzA5OTMyNTMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.LB4C-5NmA2_M8-F473drdfCDsU_iw3hbyU4tCxeWmKs)
run the command
../Godot_v4.2-beta5_linux.x86_64 --doctool --gdscript-docs .
, No docs will get created in thedocs/
folder and errors will appearMinimal reproduction project
newDocToolsTest.zip
The text was updated successfully, but these errors were encountered: