sdk icon indicating copy to clipboard operation
sdk copied to clipboard

dotnet run should use the dotnet muxer and not corehost

Open pakrym opened this issue 10 years ago • 16 comments

Steps to reproduce

Build something with dependency to System.Security.Cryptography.OpenSsl/4.0.0-rc2-23914 on windows. Run it.

Expected behavior

When having library like System.Security.Cryptography.OpenSsl which doesn't have runtime target for current platform corehost should skip it.

    "System.Security.Cryptography.OpenSsl/4.0.0-rc2-23914": {
        "dependencies": {
          "System.Collections": "4.0.11-rc2-23914",
          "System.IO": "4.1.0-rc2-23914",
          "System.Resources.ResourceManager": "4.0.1-rc2-23914",
          "System.Runtime": "4.1.0-rc2-23914",
          "System.Runtime.Extensions": "4.1.0-rc2-23914",
          "System.Runtime.Handles": "4.0.1-rc2-23914",
          "System.Runtime.InteropServices": "4.1.0-rc2-23914",
          "System.Runtime.Numerics": "4.0.1-rc2-23914",
          "System.Security.Cryptography.Algorithms": "4.1.0-rc2-23914",
          "System.Security.Cryptography.Encoding": "4.0.0-rc2-23914",
          "System.Security.Cryptography.Primitives": "4.0.0-rc2-23914",
          "System.Text.Encoding": "4.0.11-rc2-23914",
          "runtime.native.System.Security.Cryptography": "4.0.0-rc2-23914"
        },
        "runtimeTargets": {
          "runtimes/unix/lib/netstandard1.4/System.Security.Cryptography.OpenSsl.dll": {
            "rid": "unix",
            "assetType": "runtime"
          }
        },
        "native": {}
      },

Actual behavior

Fails with an error.

Did not find a matching fallback rid for package System.Security.Cryptography.OpenSsl/4.0.0-rc2-23914 for the host rid win10-x64
Invalid .deps file

Environment data

dotnet --version output:

.NET Command Line Tools (1.0.0-beta-001806)

Product Information:
 Version:     1.0.0-beta-001806
 Commit Sha:  N/A

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

pakrym avatar Mar 16 '16 18:03 pakrym

/cc @schellap

pakrym avatar Mar 16 '16 18:03 pakrym

Added blocking-partner because it blocks MVC.

pakrym avatar Mar 16 '16 18:03 pakrym

Also blocking Microsoft.Data.Sqlite: https://github.com/aspnet/Microsoft.Data.Sqlite/issues/241 ... which in-turn blocks Entity Framework's SQLite provider

natemcmaster avatar Mar 21 '16 23:03 natemcmaster

@pakrym this is fixed now, right? @natemcmaster did you see this error message in the latest CLI?

schellap avatar Mar 22 '16 00:03 schellap

@schellap just reproed in this version:

.NET Command Line Tools (1.0.0-beta-001935)

Product Information:
 Version:     1.0.0-beta-001935
 Commit Sha:  0e92937850

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.11
 OS Platform: Darwin
 Runtime Id:  osx.10.11-x64

natemcmaster avatar Mar 22 '16 16:03 natemcmaster

Can I ssh or can you gzip your app?

schellap avatar Mar 22 '16 16:03 schellap

@schellap sqlite3.zip

natemcmaster avatar Mar 22 '16 16:03 natemcmaster

Is this the exact error message, could you double check? Because this code got removed from deps_format.cpp.

https://github.com/dotnet/cli/blob/rel/1.0.0/src/corehost/cli/deps_format.cpp

schellap avatar Mar 22 '16 16:03 schellap

@schellap maybe this change isn't in the build I'm using?

$ dotnet run
Project sqlite3 (.NETStandard,Version=v1.5) was previously compiled. Skipping compilation.
Did not find fallback rids for package Microsoft.Data.Sqlite/1.0.0-rc2-20270 for the host rid osx.10.10-x64
Invalid .deps file
$ dotnet --version
.NET Command Line Tools (1.0.0-beta-001935)

Product Information:
 Version:     1.0.0-beta-001935
 Commit Sha:  0e92937850

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.11
 OS Platform: Darwin
 Runtime Id:  osx.10.11-x64

natemcmaster avatar Mar 22 '16 16:03 natemcmaster

Just saw a new build came out a few minutes ago. Still getting the exact same error.

.NET Command Line Tools (1.0.0-beta-001937)

Product Information:
 Version:     1.0.0-beta-001937
 Commit Sha:  3616378130

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.11
 OS Platform: Darwin
 Runtime Id:  osx.10.11-x64

natemcmaster avatar Mar 22 '16 16:03 natemcmaster

Which dotnet is on your path? Can you invoke it directly with absolute path and see if this reproes?

If it still reproes, I need this file:

`which dotnet`/../shared/Microsoft.NETCore.App/1.0.0-rc2-23911/Microsoft.NETCore.App.deps.json

The error message in the linked bug is slightly different, this means the host is not able to find a rid fallback graph for its own starting rid.

schellap avatar Mar 22 '16 20:03 schellap

I've been installing dotnet into $HOME/.dotnet

curl https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/install.sh | bash -s -- -i $HOME/.dotnet

And yes, with absolute path invocation, this still reproduces.

$ $HOME/.dotnet/dotnet run
Project sqlite3 (.NETStandard,Version=v1.5) was previously compiled. Skipping compilation.
Did not find fallback rids for package Microsoft.Data.Sqlite/1.0.0-rc2-20270 for the host rid osx.10.10-x64
Invalid .deps file
$ $HOME/.dotnet/dotnet --version                                
.NET Command Line Tools (1.0.0-beta-001941)

Product Information:
 Version:     1.0.0-beta-001941
 Commit Sha:  61a47dade4

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.11
 OS Platform: Darwin
 Runtime Id:  osx.10.11-x64

Here is the deps.json file: https://gist.github.com/natemcmaster/792c658fa25f00306923

natemcmaster avatar Mar 22 '16 20:03 natemcmaster

Okay I have figured out the issue:

dotnet run is not using the dotnet muxer. It is using corehost and hence there is no rid fallback present and corehost failing to do a rid fallback.

--- Invoked host main = {
/Users/clrteam/Desktop/schellap/cli/temp/sdk/1.0.0-beta-001941/corehost
/Users/clrteam/Desktop/schellap/cli/temp/sqlite/sqlite3/bin/Debug/netstandard1.5/sqlite3.dll
}

I worked around by doing this: dotnet /Users/clrteam/Desktop/schellap/cli/temp/sqlite/sqlite3/bin/Debug/netstandard1.5/sqlite3.dll

@pakrym could you PTAL or assign it to the right person.

schellap avatar Mar 22 '16 21:03 schellap

@piotrpMSFT please redirect...

schellap avatar Mar 22 '16 22:03 schellap

This PR makes the switch: failures were for some weird reasons, retesting now https://github.com/dotnet/cli/pull/1851

brthor avatar Mar 22 '16 22:03 brthor

This was fixed last week

brthor avatar Mar 29 '16 00:03 brthor