New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it expected that cli can be built on ARM? #5784
Comments
The CLI itself is a portable application, so it will run happily anywhere we find a CLR, CoreFx, and Host [Shared Framework] to match. Whenever we do a new platform bring-up there is a one-time step to bootstrap builds. We've historically done this by getting the Host [corehost] to build, taking a corresponding CLR + CoreFx, and manually building out the first drop of the CLI. Afterwards, the system rolls forward nicely. We don't have any immediate plans to expand platform coverage. That said, if this is blocking you and you are interested in submitting a PR then I can see if/how soon we could stand up a CI to match. |
It's not a big deal, I just thought it'd be fun to get it up and running on my Pi. I'm not sure if I know enough about Linux (total noob!) or dotnet core to do much without hand-holding :( |
It would be very nice to be able to build CLI for ARM and Raspberry pi. We have several projects where we are using rc1 on Pi, and it would be excellent to be able to try rc2 |
@moozzyk was able to build it a while back. I still need to get him his Raspberry Pi back, in fact. |
I was actually thinking about trying to enable dotnet on ARM... CoreClr on ARM works and the cli itself does not have a lot awful of native code. |
I'm slightly confused from the last two comments about whether this is possible or needs work? :/ @piotrpMSFT said the CLI is a portable app, but @moozzyk said it has some native code. (it's possible I'm confused between the terms dotnet/cli/coreclr/etc.!) |
@DanTup - the lowest layer of the code/bootstrapper is native and CoreClr has also a lot of native code. Currently there is no version of the bootstrapper that is compiled for ARM. The CLI portable applications can be run on different platforms as long as there is a bootstrapper and CoreClr for a given platform. |
Sorry, still confused :( What was it that you got working with Scott?
Could I just compile the whole thing directly on a Pi or would it likely need debugging/tweaking of native code? |
I am also working with my Raspberry Pi's to try to get dotnet working on them. I have RPi 2 and RPi 3. I have been tinkering with both Raspian Jessie and Windows 10 IoT core. I have yet to gain some results, but i'll keep tinkering. |
I'm using PI2s with mono rc2 and dnx4.5.1 on raspbian jessie at the moment and it's all great, I'm interested in knowing what my options are going forwards though. I'd like to be able to use the new stuff in future. Stuck with linux as I need hardware accelerated display. It's out of my comfort zone to try it myself but, if needed, I'd be a willing tester / experimenter for somebody wanting to have a crack. |
coreclr has made very good progress on linux arm , thanks to contributions from the community. People from the community are tracking the progress here. I think manually building coreclr on arm and using that build to built this repo can be made possible. But i think to make cli functional on linux will also need some changes to corefx, mainly publishing linux arm version of native bits published to the nuget feeds. The actual native code work required was in coreclr which is very near to complete as can be seen from the arm progress issue i linked. |
@mylibero had "almost" prepared dotnet-cli/ARM a while ago to the point where we simply need to run Roslyn(csc.exe) in ARM/Linux, which seems to run reliably now (I build my own ARM/Linux c# test cases in ARM machines). |
Is the source available for this "stage0" bootstrapper? Obviously there's a bit of inception going on, since the bootstrapper itself is a dotnet CLI, so I'm not sure if it's just a previous build of the full dotnet CLI, or something else but just named the same. Alternatively, might be able to work some magic with qemu... |
I've recently noticed an increasing demand for C# support on Raspbian Jessie. .NET Core would provide a great framework for many kind of networked applications. |
I tried using Mono for now because of lack of support for Core but it was so clunky/buggy and installed so much junk on my Pi I've recently just abandoned the idea of using C# and converted my scripts to Dart. Dart runs on my PC, my x86 Chromebook (in Dev mode, without needing a full linux install) and my Pi; that's what I call cross-platform (.NET Core won't currently run on either the CB or the Pi). :-( |
👍 |
Glad this is starting to get some traction -- my qemu hail mary hit a dead end and now that I have an ARM Chromebook, I need this more than ever! While officially this is on the roadmap for Q4'16/Q1'17, I'd love to get it working on a dev branch ASAP...If it's simply a matter of priority, I have the cycles to help out however I can -- just point me in the direction of how you'd like it to work and I'll see what I can do about a PR! Otherwise, my next hail mary is going to be to fork dnx as the stage0... |
for stage0 one will need to compile dotnet/coreclr and corefx for pi2 (which is quite stable now) and use that build to run other stages which i suppose includes running nuget for restore , and csc for compiling and may be msbuild too. All of these can be made to run on a coreclr and corefx build as the cli uses nuget to download packages and csc to compile source code. |
From @piotrpMSFT
I found this after cloning the cli repo to my Android device...which I did after successfully building CoreCLR and CoreFX. I have two questions and one request:
|
If I'm not mistaken, corehost is no longer, so how would we do this now? (other than going back to the last commit before corehost was removed, unless that's the only way) |
Just discovered corehost got moved to https://github.com/dotnet/core-setup -- hopefully can make some more progress now |
I'm confused with dependencies... (BananaPi + Ubuntu) Namely I managed to compile coreclr, but corefx downloads dotnet.tar with x86/x64 binaries:
So, I assume cli is needed as next, but this repo downloads dotnet too: ` /root/holisticware/cli/run-build.sh: line 120: /root/holisticware/cli/.dotnet_stage0/x64/dotnet: cannot execute binary file: Exec format error while core-setup downloads:
|
+1 for arm devices (not only raspberry pi). Will cross-compiling work ? I.e. build on a linux machine with crosscompilling toolchain and then copy binaries to linux arm device? |
So did anyone locate the sources for the dotnet binary? |
If by "dotnet binary" you mean the muxer, the source is in https://github.com/dotnet/core-setup. |
Yeah, ARM builds are actually pretty close -- see dotnet/core-setup#725 for details |
FYI. "dotnet" muxer, CoreCLR and CoreFX for ARM is now available as described in https://github.com/dotnet/core-setup/issues/725. However you still have to build them yourself with cross compilation by now. |
I'm actively working on bringing up Android/ARM64 based on that checklist and, while it is useful I'm still a bit fuzzy on the relationship between core-setup and cli, and what both repos contain. I understand that core-setup contains the installer bits for CoreFX, CoreCLR and shared host (dotnet) but the installation scenarios link points to documentation in the cli repo and seems to about installation of the CLI. If I go to the home page for the CLI repo, I see that it's the source for the .NET Core command-line toolchain, but not really because a link in that page points to the various separate repos that make up .NET Core. Right now I'm trying to figure out if CLI will be needed as part of Android/ARM64 enablement and, if so, is it a prerequisite to bringing up core-setup or not. After this post I'll be reading the What Is .NET Core link because I assume it will help me get a handle on the various moving parts and know what is needed to bring up a new platform, but I could use suggestions/recommendations. |
@cydhaselton The way I understand .NET Core components and how they map to repositories is as follows:
|
Note to others working on new platform bring up, dotnet/coreclr#917 is an ongoing discussion. |
@cydhaselton The CLI is for doing things like In my experimentation, the CLI commands were all far too slow on ARM to be useful, so I have stopped working on getting the CLI buildable for ARM. While it is possible to build and develop from an ARM device, I see ARM much more realistically solely as a build target. Just as you wouldn't develop or build Android or iPhone apps on the devices you're targeting, you'd build your .NET Core app on a proper (x64) development environment, targeting ARM, and then deploy it to ARM devices. |
@SteveDesmond-ca: Thanks for the clarification. A few follow up questions:
|
|
Two or more of the tasks in dotnet/core-setup#725 involve cross-building corehost and/or dotnet for the target. If we're creating a build target, rather than a full deployment, wouldn't those steps be excluded? If so, would the final "package" be affected? |
Does current build.sh could be used to create arm binaries? First I have error linked with distributive: |
There are ARM builds of the .NET Core Runtime at https://github.com/dotnet/core-setup, but (unless something has stealthily changed) the CLI/SDK is still x64 only. |
we now have linux arm32 and linux arm64 un-official builds available with 2.1.300 CLI. |
@livarcocc good news, how we can build for linux-arm64 (I want run on arm64v8) ? |
what failure did you see? cross publishing should be supported independent of having a .NET Core SDK that targets that or not. For instance, I can publish to linux from a windows box without any issues. In that sense, publishing to linux-arm should be no different. @Petermarcu what is the appropriate rid for linux arm64? |
Thats the right rid but @eerhardt made an update in corefx to add it to the identity package. I don't know if he fix has flowed into the SDK yet. I had to explicitly reference the runtime packages because the link up wasn't in there. I also had to disable package dependency validation. Here is a sample of the workaround:
You will need to adjust the versions as appropriate and make sure you have a nuget.config.
|
@Peter-Schneider , @livarcocc
Whats wrong? |
Are you xcopying the contents of the publish folder? Under something like bin\debug\netcoreapp2.0\publish? That's what you need to copy, not the contents under the build folder. |
@livarcocc yes, I had tried run under publish ( |
Ah, typo in my sample. Sorry. The last package is missing "64" it needs to be |
I'm fixing my example inline as well. |
@Petermarcu 🥇 , @livarcocc 🥇 Thanks, finally run hello world on arm64v8 router :) |
I was under the impression that I could build this on ARM (as is @shanselman), however I've been unable to make it work. The first step of
build.sh
seems to be to download a binary rather than build and that seems to be an x86 binary.I found #5310 but it's not clear it that was about binaries or building from source (it sounds like the poster was trying to build, but the subject suggests he wanted binaries).
Is it supposed to be possible to build on ARM, or is this also unsupported?
Steps to reproduce
build.sh
Expected behavior
Build with no errors.
Actual behavior
Error when executing
dotnet restore
Environment data
dotnet --info
output:dotnet
does not runThe text was updated successfully, but these errors were encountered: