aspnet / libuv-build

Libuv build automation for ASP.NET Core
Other
22 stars 18 forks source link

Need a build for Linux arm #19

Closed moozzyk closed 7 years ago

moozzyk commented 7 years ago

https://github.com/dotnet/core-setup/issues/725

RIDs have been added:

https://github.com/dotnet/core-setup/pull/712

gkhanna79 commented 7 years ago

@moozzyk Do you have a sense of when this will be available?

moozzyk commented 7 years ago

I will start looking into it sometime next week.

jyoungyun commented 7 years ago

@moozzyk @gkhanna79 Please let me know if you need my help. I do not think this issue is necessary for us to release .NET Core for ARM. So I have been looking at Cli codes, which I think is a higher priority. Please let me know if I am wrong. Thank you.

moozzyk commented 7 years ago

Libuv is used by the Kestrel web server.

sesispla commented 7 years ago

And Kestrel is core to ASP.NET...

jyoungyun commented 7 years ago

@moozzyk @sesispla But we don't have plans to support ASP.NET on tizen and Ubuntu arm yet...

gkhanna79 commented 7 years ago

@jyoungyun We need libuv to build for consistency of SharedFW across all platforms/arch we will build .NET Core for.

qmfrederik commented 7 years ago

@moozzyk I drafted a PR which should add support for linux arm, armel; all feedback is welcome.

moozzyk commented 7 years ago

@qmfrederik - I saw it - thanks! I wanted to change how we build libuv entirely (i.e. get rid of Sake/shade) but since this is much bigger task it makes sense to unblock arm by using Sake/shade for now.

qmfrederik commented 7 years ago

@moozzyk Yeah, it kind of is the most straightforward way I could think of and it unblocks ARM. So if someone can validate & test, at least we could move forward with this.

PS: Looking at the package, I see you include the RIDs for the various Linux distributions. Since you also include linux-x64, is that really required? I think you can reduce the package size if you just reference linux-x64.

moozzyk commented 7 years ago

@qmfrederik - I will update the CI so that it can built libuv for ARM - currently it does not have arm toolchain.

Adding linux-x64 is a very recent change. It does allow removing distro specific copies of libuv which will make the package smaller. I don't know what is the timeline for this however. @gkhanna79 - do you know?

gkhanna79 commented 7 years ago

We should keep the distro specific binaries for now until we have proven the Linux-x64 approach.

moozzyk commented 7 years ago

@qmfrederik - I just tried building on a CI agent and the hf version compiles fine but the other one fails with:

info:   workingdir: /tmp/tmp/libuv-build
/tmp/fs-poll-0187d5.s: Assembler messages:
/tmp/fs-poll-0187d5.s:465: Error: selected processor does not support ARM mode `blx r12'
/tmp/fs-poll-0187d5.s:514: Error: selected processor does not support ARM mode `blx r12'
...

The interesting thing is that I can build it just fine on my own Linux VM which seems to have the same cpu (both are Azure VMs). What am I missing?

moozzyk commented 7 years ago

Interestingly building libuv directly like this:

./gyp_uv.py -Dtarget_arch=arm -DOS=linux -Duv_library=shared_library 
AR=arm-linux-gnueabi-ar CC=arm-linux-gnueabi-gcc CXX=arm-linux-gnueabi-g++ LINK=arm-linux-gnueabi-g++ PLATFORM=linux make -C out

also works:

file out/Debug/obj.target/libuv.so.1
out/Debug/obj.target/libuv.so.1: ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=1ae1973b0d0436eea6fabcd9d1ee6b9db1d64922, not stripped
qmfrederik commented 7 years ago

@moozzyk I think the difference is not the host CPU but the target CPU architecture - your build machine probably chooses a different ARM version for armhf.

It looks like the blx instruction was introduced with ARMv5 (http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0204j/Cihfddaf.html), so I'm guessing you ended up compiling for an older ARM version.

I guess we can be more explicit about that.

Which OS are you running on the build VM? Ubuntu 14.04?

jyoungyun commented 7 years ago

Finally, I understood why we need to resolve this issue. When I tried to install Microsoft.NETCore.App nupkg for building cli, it couldn't resolve the dependency due to lack of the Libuv.nupkg file. So I was trying to build libuv-build and libuv-package projects. I invoked ./build.sh command and I got an artifacts directory including libuv.so for linux-arm and linux-armel by using #22 PR. But the name of generated nupkg is weird like Microsoft.AspNetCore.Internal.libuv-Linux.1.10.0-t003d17dfe.nupkg (t003d17dfe is not a commit hash and it is fixed by the downloaded tools) and I can't find the way how to use it to create the normal libuv nupkg file like libuv.1.10.0-preview1-22033.nupkg. I try to build asp.net module for the first time. So I do not have much knowledge about it. Please give me a hint for building libuv nupkg for arm.

qmfrederik commented 7 years ago

@jyoungyun https://github.com/aspnet/libuv-package takes the .Internal packages for Windows & Linux and combined them into a single libuv package

moozzyk commented 7 years ago

@qmfrederik - both machines were:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.4 LTS"
moozzyk commented 7 years ago

@jyoungyun - if you build a package on a dev box it contains a timestamp in the version. Only packages built by the CI will have actual versions. Also as mentioned by @qmfrederik the package you built is an intermediate package we will use to build the final fat package (fat - containing versions for all RIDs)

qmfrederik commented 7 years ago

@moozzyk I just tried to compiliation on Ubuntu 14.04 x64 with the latest changes to #22 and the build succeeds.

Did you try with the latest changes? Do you still get the same issue?

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:        14.04
Codename:       trusty
jyoungyun commented 7 years ago

@moozzyk @qmfrederik Thank you for comments. I understood the naming rule and I got a Libuv nupkgs from libuv-package and it worked well when I tried to resolve the Microsoft.NETCore.App nupkg.

moozzyk commented 7 years ago

Fixed in e0533cb4f95c4c96ca111eaceef9dedd665ff5d9 and https://github.com/aspnet/libuv-package/commit/164eb560696d4dc483bc56aa58f623015466093a