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

Fix .so being appended, again. #572

Merged
merged 2 commits into from
Jan 8, 2023
Merged

Fix .so being appended, again. #572

merged 2 commits into from
Jan 8, 2023

Conversation

Y-Less
Copy link
Collaborator

@Y-Less Y-Less commented Jan 8, 2023

So previously this fix was done in the plugin constructor, which takes a path and loads it as a plugin. The Windows version of the code uses LoadLibraryA, which auto-appends an extension when the file doesn't exist, while the Linux version uses dlopen, which doesn't. Therefore if you pass in a path that doesn't exist the Windows version still works, so we changed the Linux version to do the same, the theory being that obviously the constructor can already accept a path that doesn't exist.

Turns out, that wasn't the issue, at least not the only one. The Windows version of utils::Canonicalise compacts string segments purely lexicographically; that is, doesn't care if they're valid. However, the Linux version actually checks the file exists and resolves symlinks. Thus the constructor can be called with an invalid path on Windows, but not on Linux, so our .so appending code was never reached on the OS is mattered on. The solution is simple - move that .so appending to before utils::Canonicalise is called.

@Y-Less
Copy link
Collaborator Author

Y-Less commented Jan 8, 2023

Right code, wrong place.

@AmyrAhmady AmyrAhmady merged commit 675f8fb into master Jan 8, 2023
@AmyrAhmady AmyrAhmady deleted the plugin-extensions-pr2 branch January 8, 2023 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants