Skip to content

Print file path when failing to load dynamic library#116125

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
JohanAR:fix-dyn-lib-missing-log
Feb 10, 2026
Merged

Print file path when failing to load dynamic library#116125
Repiteo merged 1 commit into
godotengine:masterfrom
JohanAR:fix-dyn-lib-missing-log

Conversation

@JohanAR

@JohanAR JohanAR commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

Include the file path when failing to open a dynamic library. Previously it would only print the path of the .gdextension file on failure, making debugging harder

Comment thread drivers/unix/os_unix.cpp Outdated
@@ -1058,7 +1058,7 @@ Error OS_Unix::open_dynamic_library(const String &p_path, void *&p_library_handl
path = get_executable_path().get_base_dir().path_join("../lib").path_join(p_path.get_file());
}

ERR_FAIL_COND_V(!FileAccess::exists(path), ERR_FILE_NOT_FOUND);
ERR_FAIL_COND_V_MSG(!FileAccess::exists(path), ERR_FILE_NOT_FOUND, vformat("Can't open dynamic library, file not found: '%s'.", path));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ERR_FAIL_COND_V_MSG(!FileAccess::exists(path), ERR_FILE_NOT_FOUND, vformat("Can't open dynamic library, file not found: '%s'.", path));
ERR_FAIL_COND_V_MSG(!FileAccess::exists(path), ERR_FILE_NOT_FOUND, vformat("Can't open dynamic library, file not found: '%s'.", p_path));

I would use original p_path here, path is taking multiple values, so using only the value from the last check (../lib/libname) might be misleading.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was considering that, and it might make more sense since that's the path in the .gdextension, but I went with path since that's the thing it actually looks for. I'll change it to p_path if you find that more logical

@JohanAR JohanAR force-pushed the fix-dyn-lib-missing-log branch from a7e4303 to 2acdfdb Compare February 10, 2026 12:34
@Repiteo Repiteo modified the milestones: 4.x, 4.7 Feb 10, 2026
@Repiteo Repiteo merged commit 07f6c64 into godotengine:master Feb 10, 2026
20 checks passed
@Repiteo

Repiteo commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

Thanks!

rivie13 pushed a commit to rivie13/Phoenix-Agentic-Engine that referenced this pull request Feb 16, 2026
…g-log

Print file path when failing to load dynamic library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment