Skip to content

Fix .so being appended, again. - #572

Merged
AmyrAhmady merged 2 commits into
masterfrom
plugin-extensions-pr2
Jan 8, 2023
Merged

AmyrAhmady merged 2 commits into
masterfrom
plugin-extensions-pr2

Conversation

@Y-Less

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

Copy link
Copy Markdown
Collaborator

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

Y-Less commented Jan 8, 2023

Copy link
Copy Markdown
Collaborator Author

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