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

Simplify script paths to ensure proper resource path checks #87124

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

rsubtil
Copy link
Contributor

@rsubtil rsubtil commented Jan 12, 2024

Fixes #87094.

Prevents script paths that could have partial dirs in them (e.g. res://./addons/<...> or res://folder1/../folder2/<...>) by simplifying them.

This issue manifested on a very specific case (#87094) of an addon with warnings, treating warnings as errors, and a script being supplied through the CLI interface with a preceding ./. It caused the script path to become res://./addons/..., which then fails this check and erroneously lets the warning be issued:

if (GLOBAL_GET("debug/gdscript/warnings/exclude_addons").booleanize() && script_path.begins_with("res://addons/")) {
return;
}

If applying this fix to the script_path is risky, I can move it to this check instead.

@akien-mga akien-mga merged commit 9a793d9 into godotengine:master Feb 8, 2024
15 checks passed
@akien-mga
Copy link
Member

Thanks!

2 similar comments
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn as Error applies to Addons when executing addon-provided tools
4 participants