sdk icon indicating copy to clipboard operation
sdk copied to clipboard

DOTNET_HOSTING_OPTIMIZATION_CACHE requires architecture in the folder name

Open victorhurdugaci opened this issue 10 years ago • 6 comments

It seems that setting DOTNET_HOSTING_OPTIOMIZATION_CACHE requires the architecture to be part of the path. I was under the impression that you just point it to a folder that has two subfolders in it and it works.

So, my native image cache has:

  • ni-cache\x86
  • ni-cache\x64

If the env var points to the ni-cache, the packages are not loaded but if I point to ni-cache\x64 then it works.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-rc2-002439)

Product Information: Version: 1.0.0-rc2-002439 Commit Sha: ef0c3b2cee

Runtime Environment: OS Name: Windows OS Version: 10.0.10586 OS Platform: Windows RID: win10-x64

victorhurdugaci avatar Apr 26 '16 22:04 victorhurdugaci

It looks like there is a workaround here. @schellap, is the behavior by-design?

TheRealPiotrP avatar Apr 26 '16 23:04 TheRealPiotrP

No, it is not by design. In fact code from the commit SHA above seems to be appending get_arch and get_arch is x86/x64. Can I ask @victorhurdugaci to share set COREHOST_TRACE=1 output with me, please?

https://github.com/dotnet/cli/blob/ef0c3b2cee6c2cae84a0201e794ec1c272c0e211/src/corehost/cli/deps_resolver.cpp#L210

https://github.com/dotnet/cli/blob/5b38dd6765f0bf9b3fdd198d7e2e762fbf1fcbed/src/corehost/common/utils.cpp#L155

schellap avatar Apr 27 '16 00:04 schellap

Just tried to repro and things work as expected on this specified version:

  1. Created c:\temp, c:\temp\x64; set DOTNET_HOSTING_OPTIMIZATION_CACHE=c:\temp
  2. Downloaded https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/1.0.0-rc2-002439/dotnet-dev-win-x64.1.0.0-rc2-002439.zip
  3. Copied %USERPROFILE%\.nuget\packages\runtime.win7.System.Console into c:\temp\x64
  4. dotnet help
  5. Saw this in the TPA: .dll;c:\temp\x64\runtime.win7.System.Console\4.0.0-rc2-24018\runtimes\win7\lib\netstandard1.3\System.Console.dll;H:\Downloads

schellap avatar Apr 27 '16 00:04 schellap

That's strange. I cannot reproduce it anymore... I'll investigate more but it seems to work now. Will reopen if I find a case in which it doesn't work

victorhurdugaci avatar Apr 27 '16 15:04 victorhurdugaci

Are you hitting MAX_PATH?

schellap avatar Apr 27 '16 17:04 schellap

Nope. The folder in the root of the drive

victorhurdugaci avatar Apr 27 '16 19:04 victorhurdugaci