You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@adityamandaleeka I just discovered this as well and I have a fix (dotnet/coreclr#5048) that fixes this as well as a different issue. Our PR probably going to conflict since I'm moving that exact same code.
Yep. It is being searched already and that's exactly what LoadFromNativeDllSearchDirectories does. My other PR dotnet/coreclr#5048 only changes the order.
@manu-silicon That's a host specific issue since host owns translating the environment variables into NATIVE_DLL_SEARCH_DIRECTORIES that is understood by the runtime. @schellap Can you take a look and create a issue as well?
/cc @gkhanna79
In the meantime, I'll work on porting the Windows code to unixcoreruncommon to fetch the value of CORE_LIBRARIES as I need this to run some program on Unix. Thanks!
@manu-silicon Sorry, auto-correct on phone does its own thing.
CORE_LIBRARIES is just a development/internal-testing environment variable and should not be relied upon. If you wish to add it to unixcorerun for consistentcy, that is fine. But this is not expected to be formally supported in any host used in formal scenarios. The formal way to specify the folders to look for pinvoke targets is NATIVE_DLL_SEARCH_PATHS.
You cannot - this is a host property and you will need to write a host that sets it. For .NET Core, this is automatically computed based upon the app manifest and .NET Host passes it to the runtime. If you have a scenario where you wish to have an external user specify such a value, consider authoring a host.
@manu-silicon no need to use CLI. You can take a look at how the dotnet host sets it from its app manifest for the .net core app model and implement something similar.
However, I would suggest porting the CORE_LIBRARIES as it would be a smaller change than go down the app manifest route since your objective is just hooking the native paths.
Activity
adityamandaleeka commentedon May 18, 2016
@manu-silicon You're right. Thanks for finding this issue!
manu-st commentedon May 18, 2016
@adityamandaleeka You are welcome.
whoisj commentedon May 18, 2016
Wouldn't it be nice if the language / compiler complained loudly when return values were ignored?
https://twitter.com/xjoeduffyx/status/730991667960893440
😏
yizhang82 commentedon May 18, 2016
@adityamandaleeka I just discovered this as well and I have a fix (dotnet/coreclr#5048) that fixes this as well as a different issue. Our PR probably going to conflict since I'm moving that exact same code.
adityamandaleeka commentedon May 18, 2016
@yizhang82 I've closed my PR, and am reassigning this issue to you.
yizhang82 commentedon May 18, 2016
@adityamandaleeka Thank you!
yizhang82 commentedon May 18, 2016
Fixed with dotnet/coreclr#5048
manu-st commentedon May 19, 2016
@yizhang82 By the way, how one can set NATIVE_DLL_SEARCH_DIRECTORIES?
yizhang82 commentedon May 19, 2016
@manu-silicon Only host can. See https://github.com/dotnet/coreclr/blob/f4fe31a03dca4ede37bd6451d0c81365ee9ee7e4/src/coreclr/hosts/corerun/corerun.cpp
manu-st commentedon May 19, 2016
I see. Is there a way to have that set of directories searched too for PInvoke? That would help tremendously!
yizhang82 commentedon May 19, 2016
Yep. It is being searched already and that's exactly what LoadFromNativeDllSearchDirectories does. My other PR dotnet/coreclr#5048 only changes the order.
1 remaining item
yizhang82 commentedon May 19, 2016
@manu-silicon That's a host specific issue since host owns translating the environment variables into NATIVE_DLL_SEARCH_DIRECTORIES that is understood by the runtime.
@schellap Can you take a look and create a issue as well?
/cc @gkhanna79
manu-st commentedon May 19, 2016
In the meantime, I'll work on porting the Windows code to unixcoreruncommon to fetch the value of CORE_LIBRARIES as I need this to run some program on Unix. Thanks!
gkhanna79 commentedon May 19, 2016
Corelibraries is for internal development. We should probably clean it up and remove it. You should use native ski search path envvar only.
manu-st commentedon May 19, 2016
Not sure to understand what native ski means. I just made a patch for picking up from CORE_LIBRARIES. See https://github.com/dotnet/coreclr/compare/master...manu-silicon:core_libraries?expand=1 Let me know if this is worth creating a pull request.
gkhanna79 commentedon May 19, 2016
@manu-silicon Sorry, auto-correct on phone does its own thing.
CORE_LIBRARIES is just a development/internal-testing environment variable and should not be relied upon. If you wish to add it to unixcorerun for consistentcy, that is fine. But this is not expected to be formally supported in any host used in formal scenarios. The formal way to specify the folders to look for pinvoke targets is NATIVE_DLL_SEARCH_PATHS.
manu-st commentedon May 19, 2016
@gkhanna79 I understand that but how do I set this as a user? I only found CORE_LIBRARIES as a solution.
gkhanna79 commentedon May 19, 2016
You cannot - this is a host property and you will need to write a host that sets it. For .NET Core, this is automatically computed based upon the app manifest and .NET Host passes it to the runtime. If you have a scenario where you wish to have an external user specify such a value, consider authoring a host.
manu-st commentedon May 19, 2016
I was thinking about an app manifest too. Is this supported just for Windows?
gkhanna79 commentedon May 19, 2016
.NET Core is available cross-plat - https://www.microsoft.com/net/core#macosx
manu-st commentedon May 19, 2016
Being rusty on the app manifest. Does anyone have an example of a manifest that add to the NATIVE_DLL_SEARCH_PATHS?
schellap commentedon May 19, 2016
https://github.com/dotnet/cli/blob/rel/1.0.0-preview1/TestAssets/TestProjects/PortableTests/PortableAppWithNative/
dotnet restore, publish
manu-st commentedon May 19, 2016
@schellap This is confusing. I'm not using dotnet/cli. I'm looking at ways to tell CoreCLR where to look for my native dlls.
schellap commentedon May 19, 2016
@manu-silicon no need to use CLI. You can take a look at how the dotnet host sets it from its app manifest for the .net core app model and implement something similar.
However, I would suggest porting the CORE_LIBRARIES as it would be a smaller change than go down the app manifest route since your objective is just hooking the native paths.
Here is relevant code:
https://github.com/dotnet/cli/blob/rel/1.0.0/src/corehost/cli/hostpolicy.cpp#L62