aspnet / libuv-package

NuGet packages for libuv
Other
19 stars 14 forks source link

libuv not produced for ubuntu.14.04-x64 #10

Closed jchannon closed 8 years ago

jchannon commented 8 years ago

I noticed there is no libuv.so file produced under a ubuntu.14.04-x64 folder under bin/Release/netcoreapp1.0/publish/runtimes folder when dotnet publish is called on a Microsoft.NETCore.App when on Windows 10 with RC2 tooling. There was a debian-x64 folder but I assume this was ignored as when I try to run my app it threw an exception that libuv.dll was not present. This meant I had to compile and install libuv from source and the app ran fine after that.

{
    "version": "1.0.0-*",
    "buildOptions": {
        "emitEntryPoint": true,
        "copyToOutput": [ "test.sqlite" ]
    },
    "publishOptions": {
        "includeFiles": [ "test.sqlite" ]
    },
    "dependencies": {
        "Microsoft.NETCore.App": {
            "type": "platform",
            "version": "1.0.0-rc2-3002702"
        }
    },

    "frameworks": {
        "netcoreapp1.0": {
            "dependencies": {
                "Microsoft.AspNetCore.Hosting": "1.0.0-rc2-final",
                "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
                "Microsoft.AspNetCore.Owin": "1.0.0-rc2-final",
                "Nancy": "2.0.0-coreclr",
                "Microsoft.Data.SQLite": "1.0.0-rc2-final",
                "Dapper": "1.50.0-rc2b"
            },
            "imports": [
                "dotnet54",
                "portable-net451+win8"
            ]
        }
    }
}

However I found that if I remove type:platform and add

"runtimes":{
        "ubuntu.14.04-x64":{}
    },

and call dotnet publish -c=Release --runtime=ubuntu.14.04-x64 I get a bin/Release/netcoreapp1.0/ubuntu.14.04-x64/publish folder with libuv inside.

However this folder is 50mb whereas the previous is 10mb.

So what is the recommended publish story, what does removing that platform and adding a runtime node do and why is it 5x larger output?

jchannon commented 8 years ago

I see there is some info here about portable vs self contained https://dotnet.github.io/docs/core-concepts/app-types.html

However looking at my self contained output I don't see any way to execute the self contained application, there is no local dotnet for example

moozzyk commented 8 years ago

In the RID graph ubuntu derives from debian hence the .so in debian-x64 will work for ubuntu. I did try publishing from windows to ubuntu and both portable and standalone apps worked as far as I remember. Anyways, for RTM libuv will be included in the runtime,

halter73 commented 8 years ago

@davidfowl Do you have any insight on this?

If I understand this correctly @jchannon is able to successfully publish a self-contained application, but not a portable one.

@jchannon When you publish a portable app, is libuv.so in the publish output anywhere? If so, can you print the output of Environment.GetEnvironmentVariable("LD_LIBRARY_PATH") before starting (failing) to start Kestrel in your Program.Main?

However looking at my self contained output I don't see any way to execute the self contained application.

Since you are building the ubuntu standalone application on Windows, you will probably need to look for a file called "myapp" in bin/Release/netcoreapp1.0/ubuntu.14.04-x64/publish and run chmod +x on it to run it.

However this folder is 50mb whereas the previous is 10mb.

This is because all the dependencies in the shared runtime need to be included in the published output.

jchannon commented 8 years ago

On a portable app libuv is in a UNIX and a Debian folder but it's ignored as I'm in Ubuntu I presume.

Chmod is fine but how do you run it? Should there be a dotnet binary published with the self contained app as I don't see it in the publish folder

On Saturday, 11 June 2016, Stephen Halter notifications@github.com wrote:

@davidfowl https://github.com/davidfowl Do you have any insight on this?

If I understand this correctly @jchannon https://github.com/jchannon is able to successfully publish a self-contained application, but not a portable one.

@jchannon https://github.com/jchannon When you publish a portable app, is libuv.so in the publish output anywhere? If so, can you print the output of Environment.GetEnvironmentVariable("LD_LIBRARY_PATH") before starting (failing) to start Kestrel in your Program.Main?

However looking at my self contained output I don't see any way to execute the self contained application.

Since you are building the ubuntu standalone application on Windows, you will probably need to look for a file called "myapp" in bin/Release/netcoreapp1.0/ubuntu.14.04-x64/publish and run chmod +x on it to run it.

However this folder is 50mb whereas the previous is 10mb.

This is because all the dependencies in the shared runtime need to be included in the published output.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aspnet/libuv-package/issues/10#issuecomment-225317066, or mute the thread https://github.com/notifications/unsubscribe/AAGapnttA9oQTg-rY7gTHQlxfEGWN4faks5qKe8qgaJpZM4IzPpX .

halter73 commented 8 years ago

You should be able to just run ./myapp. As @moozzyk mentioned, dotnet running on Ubuntu should include the debian-x64 folder in its LD_LIBRARY_PATH.

davidfowl commented 8 years ago

You shouldn;t need to do any of that stuff.

@jchannon how exactly did you install the .NET Core SDK on your ubuntu machine?

jchannon commented 8 years ago

It looks like I published as a portable, installed dotnet via https://www.microsoft.com/net/core#ubuntu and then had to install libuv due to the error.

Here's a screenshot of the output http://twitter.com/jchannon/status/741312067311931392/photo/1

The code for the app is here https://github.com/jchannon/NancyVsVapor

I should have used stand alone.

BTW, ./myapp.dll is awesome to execute the app!

On 11 June 2016 at 06:25, David Fowler notifications@github.com wrote:

You shouldn;t need to do any of that stuff.

@jchannon https://github.com/jchannon how exactly did you install the .NET Core SDK on your ubuntu machine?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aspnet/libuv-package/issues/10#issuecomment-225337967, or mute the thread https://github.com/notifications/unsubscribe/AAGapqpEUZuag_50K3CK-4qQXi-gTi3iks5qKkaugaJpZM4IzPpX .

davidfowl commented 8 years ago

Yep I can reproduce this...

davidfowl commented 8 years ago

@schellap @ellismg Can you guys chime in here? RID fallback doesn't seem to be working here. I see this in the shared runtime deps file:

  "ubuntu.14.04-x64": [
      "ubuntu.14.04",
      "ubuntu-x64",
      "ubuntu",
      "debian-x64",
      "debian",
      "linux-x64",
      "linux",
      "unix",
      "unix-x64",
      "any",
      "base"
    ],

Or maybe it's working but something lower is busted (like loading .so on linux outside of the app base...)

schellap commented 8 years ago

I tried the repo and the server launches fine, I issued request for +:8200 and got:

{"statusCode":404,"message":"The resource you have requested cannot be found.","details":"<pre></pre>"}

I turned on tracing to see the rid fallback log and it happens successfully. Could you pls. confirm this as well? Does the debian libuv.so have some other dependencies (Linux or Debian libraries) not on your machine? More details below.

Dotnet version

.NET Command Line Tools (1.0.0-preview1-002702)

Product Information:
 Version:     1.0.0-preview1-002702
 Commit Sha:  6cde21225e

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  14.04
 OS Platform: Linux
 RID:         ubuntu.14.04-x64

Tracing

export COREHOST_TRACE=1
dotnet NancyVsVapor.dll

I also see the debian-x64 folder in the properties:

Property NATIVE_DLL_SEARCH_DIRECTORIES = /usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.0-rc2-3002702:/home/senthil/NancyVsVapor/src/NancyVsVapor/bin/Debug/netcoreapp1.0/publish/runtimes/debian-x64/native:/home/senthil/NancyVsVapor/src/NancyVsVapor/bin/Debug/netcoreapp1.0/publish:

I see this:

    Relative path query exists /home/senthil/NancyVsVapor/src/NancyVsVapor/bin/Debug/netcoreapp1.0/publish/runtimes/debian-x64/native/libuv.so

and this:

Chose debian-x64, so removing rid (win7-x64) specific assets for package Libuv/1.9.0-rc2-20896
Chose debian-x64, so removing rid (win7-x86) specific assets for package Libuv/1.9.0-rc2-20896
Chose debian-x64, so removing rid (win7-arm) specific assets for package Libuv/1.9.0-rc2-20896
Chose debian-x64, so removing rid (rhel-x64) specific assets for package Libuv/1.9.0-rc2-20896
Chose debian-x64, so removing rid (osx) specific assets for package Libuv/1.9.0-rc2-20896
schellap commented 8 years ago

Oh, I had a 50 MB file there in the portable layout.

davidfowl commented 8 years ago

I take that back, it does work for me

Adding to native path: /home/davidfowl/apps/myapp1/runtimes/debian-x64/native
Adding to native path: /home/davidfowl/apps/myapp1
Property NATIVE_DLL_SEARCH_DIRECTORIES = /usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.0-rc2-3002702:/home/davidfowl/apps/myapp1/runtimes/debian-x64/native:/home/davidfowl/apps/myapp1:

I was running into another issue 😄

@jchannon can you run your application with COREHOST_TRACE=1

jchannon commented 8 years ago

@davidfowl I put all output here:

https://gist.github.com/jchannon/85577d01384b0e54ee8bfe610df8448f

schellap commented 8 years ago

I see this in the log. Does the file exist?

Relative path query did not exist /home/helper/csharp-jon/runtimes/debian-x64/native/libuv.so

Can you stat this file?

jchannon commented 8 years ago

Yup I just realised at the same time as you I think. The runtimes folder was not present on the box only the contents of the publish folder. Deployment script FAIL.

Thanks for the help.