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 DllImport probing #689

Closed
ericstj opened this Issue Mar 21, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@ericstj
Copy link
Member

ericstj commented Mar 21, 2018

CoreCLR allows for more variations of DllImport probing:
https://github.com/dotnet/coreclr/blob/430331c011a0460670e2743ab08caa36f914f52d/src/vm/dllimport.cpp#L6066-L6084
https://github.com/dotnet/coreclr/blob/e7bb40f52d46671f5001012284a2f54eaa658e35/src/pal/inc/pal.h#L5259-L5265
As a result we should update our list:

var moduleRefCandidates = new[] { moduleName, moduleName + ".dll", moduleName + ".so", moduleName + ".dylib" };

Today it's missing the prefixes.

@ericstj ericstj self-assigned this Mar 21, 2018

@ericstj

This comment has been minimized.

Copy link
Member Author

ericstj commented Mar 21, 2018

We should fallback through the precedence where we consider all possible suffixes. Today we work in most cases due to co-location of native files and package rooting (eg: root the file containing one native impl and all are included) but if that package is marked trimmable, we'd miss the SO if a dll also existed.

I think our algo should look similar to the coreclr's fallback list, except we consider all prefixes/suffixes rather than just the one for our current platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.