-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Package Request: .NET Core #516
Comments
I have started a branch, and it compiles on my machine, but I will need some help to make sure it works: https://github.com/christianrondeau/termux-packages/tree/dotnet-dev/packages/dotnet-dev I searched for high level instructions on how to:
A few links to get started would be very helpful, rather than fiddling (and probably making easy to avoid mistakes) Thanks! Once I have the information I need, I might contribute to the documentation once I understand all pieces. |
After building the package, you can find its deb package(s) in the termux-packages/debs folder of your cloned git repo. |
Thank you very much @vishalbiswas - I should have enough to get going for a while :) I'm still trying to understand the relationship between .Net Core repositories and their apt-get counterpart, but I'll reach out if I get stuck. |
I've actually built coreclr in termux on device, as well as the necessary bits of corefx. Unfortunately I failed to push commits to my forked coreclr repo so I have to rebuild from scratch. |
@cydhaselton that would be amazing, I'm still trying to figure out the build part of dotnet-cli (works from a checkout, not from their release tar file for multiple reasons), the relationship with the three .deb files generated in the Microsoft Ubuntu release as well as the subtleties of Termux itself :) Also the time I can put on this per day is near to zero so that will probably take forever! Hopefully I'll learn something from this though. Let me know if I can help, I'll continue slowly progressing on my branch in the meantime. |
Small info : So either we build on a custom commit rather than the release, or we monkey patch dynamically. Or I got it wrong :P I'll continue my investigation. |
@christianrondeau: Best of luck with your efforts...I'm still banging my head against this, as I'd like to get Powershell running in Termux. If you are ever able to build it for Termux let me know. I'd be more than happy to test. EDIT: So you have a dotnet/cli that runs on Termux? Care to share? |
Not yet, no - I have the There is a bunch of output folders generated by the dotnet/cli build, with multiple stages, |
@christianrondeau build-package.sh steps:
|
Thanks again @vishalbiswas, this was indeed my understanding (but I prefer knowing this rather than just relying on my guesses). Where I am at (for those who are interested): Lookin at the Ubuntu distribution of .NET core, I see the
And when I build locally .NET, if I look at https://github.com/dotnet/cli/blob/rel/1.0.0/Documentation/developer-guide.md#buildingrunning I can see I need the stage 2 output, which looks like this (excluding third party notices and license files):
So two things I'm not sure about.
So my next steps are to:
It's moving forward! |
I can now build the .deb file successfully! But here's my first roadblock. I copied the list of dependencies from the ubuntu .Net Core target, and I tried to install them. Most of them are not available for termux (see output below). Does this mean I'm screwed? Reading package lists... Package libcurl3 is not available, but is referred to by another package. Package libgcc1 is not available, but is referred to by another package. Package libgssapi-krb5-2 is not available, but is referred to by another package. Package libicu55 is not available, but is referred to by another package. Package liblldb-3.6 is not available, but is referred to by another package. Package liblttng-ust0 is not available, but is referred to by another package. Package libssl1.0.0 is not available, but is referred to by another package. Package libstdc++6 is not available, but is referred to by another package. Package libunwind8 is not available, but is referred to by another package. Package libuuid1 is not available, but is referred to by another package. Package zlib1g is not available, but is referred to by another package. |
Skipping dependencies using
I'm on a S7 (aarch64), I compiled on Ubuntu 16.04 x64, and I took the file from the termux-packages/debs folder. The built executable works on Ubuntu, but the massaged version spits out (on ubuntu) :
I guess this part is normal, but I can't say for sure. Not sure where to go from there. Any idea? |
@christianrondeau Turn off HOSTBUILD. From my understanding, hostbuild will build for the build machine. It should only be enabled for arch independent and/or packages that don't require libc (I'm not sure). Also remove libc6 from depends list, termux uses system provided libc, bionic. Change libcurl3 to libcurl and also remove version requirements from them. |
HOSTBUILD is already off: https://github.com/christianrondeau/termux-packages/blob/dotnet-dev/packages/dotnet-dev/build.sh For the librairies, it makes sense and I can work through them, thanks. I'm still stumped for I'll try cleaning my environment and make sure it's not a copy error on my part... |
@christianrondeau That Exec format error is because its built for your build machine (probably). I think the Compile command implicitly uses your system gcc and friends. There must be a way to set them to the toolchain ones. You can run |
I rebuilt it to make sure. When I extract the generated
Which shows it is indeed the massaged version. I also see in When I force-install it on Termux (and ignore dependencies):
Either I misunderstood what target arch to use when building the. NET Core source (right now it's ubuntu 16.04 x64), or the Any ideas? |
@christianrondeau run |
Here's the output in Termux on my S7:
Fun fact: I piped the command output to I also ran
|
I think I see what I misunderstood; @cydhaselton if you have stuff to share, that'll help. So, I'm afraid I'm quite a few steps back. I now need to find how to target ARM/aarch64 in the .NET Core CLI before moving forward on the Termux side. Thanks, I'll keep this thread updated. Hopefully my dream of developing .NET Core apps on my phone with Vim is not too far fetched! Update: It is on Microsoft's roadmap for Q4 2016 - Q1 2017: https://blogs.msdn.microsoft.com/dotnet/2016/07/15/net-core-roadmap/ which will make things much easier... I'll still try in the meantime! |
It would be better to port mono, until upstream .Net Core adds support for arm. |
@vishalbiswas that would not work for my purposes, my objective is to build "Standard" .Net Core apps (no dependency on an installed. Net frameworks) rather than the "full" framework. I see that arm is actually kind of supported in the master branches, so I can probably get at least a non official build of it and fiddle with it. So when they're ready, I will be too :) |
Here's the overview of what I found on how to build it on ARM:
On other OSes than Ubuntu/Debian, there is a single "apt" instead of the four described before, so that might be the way to go here. But I feel like too many pieces are missing to realistically use cli on arm today ... So maybe this issue will have to wait a few months :( I'll continue fiddling, my only hope now is to at least get the framework (coreclr/corefx) working on this branch, so that it will be easier once cli supports arm to finish these build scripts. If anyone have a better idea, I'm open to them. |
@christianrondeau I've got a working port of mono on Termux, so I've been attempting to build parts of cli using the Roslyn csharp compiler (which runs with the mono runtime) or mono's xbuild (since the cli directory contains proj files). It's hit and miss: xbuild doesn't want to use relative paths and throws a permissions error when accessing "/data" and the source wasn't structured to build using the commandline csharp compiler. Or I'm not familiar enough with the csharp compiler…which is also possible. I'm currently re-building coreclr on device so that I can upload the patched sources to github. I've already got corefx built and the changes pushed to my fork. If you're motivated you can search the dotnet/cli gitter archives for my efforts to figure out what in the cli source tree can be built using the utilities I've already built for Termux. |
@cydhaselton How about building in chroot on device? |
@vishalbiswas: Interesting idea. I've built in a completely chrooted environment before but it was pre-installed (kbox); I'd have to figure out how to set it up. I'll give it a shot once coreclr is done. EDIT: Would there be issues with running a program built in proot in regular termux-space? |
@cydhaselton So what you're saying, is that you tried to use a custom mono build for Termux, to run the Roslyn compiler and then use that to build dotnet cli? My head hurts :) So I see that your branch has a termux-fix-shebang Anyway, I got coreclr building for arm64 already without any custom branches nor monkey patching, so I guess I can already push this, which brings the question: Should we do like A) Ubuntu, and provide a different package for clr, fx and cli, or B) build and bundle everything together? I'm not sure yet because is looks like there are cross-dependencies between them. Splitting would allow easier tracking than this mega-thread. Probably something to discuss after it works :) I feel like I'm way out of my league with this, but there's movement and lots of learning, so it's all good I guess! |
|
Yeah, I build everything on-device; I don't have easy access to Linux builds (and yes I do know about the various prebuilt VMs out there…its a space issue) and my tablet is always with me. I'm aware my branch is behind; I have a limited knowledge of git and a full plate at work so updating the branch is on a to-do list for now. My recommendation would be to provide the packages separately with dependencies where appropriate. The various moving parts of .NET can be huge. @christianrondeau Yup, that's about right. Getting rosyn to work with mono was easy; basically someone told me that roslyn would execute under the mono runtime. The difficult part is figuring out all of the dependencies for .NET Core, which repos contain which dependencies and exactly what is needed to run Powershell…which is my ultimate goal. Let me know if/when the coreclr is available for termux; I'll quit the build I'm currently working on and focus on corecli |
BTW, |
From this article it seems that net 6.0 will support building for android:
|
Easy way to cross-compile to Android host whole dotnet framework and compilers? We need a full package, not just runtime/libs. |
I found some instructions in the https://github.com/dotnet/runtime repository on how to build the dotnet runtime for The same repository also has some instructions on how to build the runtime for android here. Unfortunately, these instructions seem to be outdated. I have asked for some up-to-date instructions in the issue that is used to track building the runtime for android (dotnet/runtime#33237 (comment)). |
I've just started using my phone for c# development with mono, and I was wondering if there's been any progress on this so I can start using dotnet core instead? |
.NET 6 provides native arm64 binary. So is there a possibility to install it on termux? |
+1 |
This one is achieved in an Ubuntu environment through |
Dotnet v7 is available on linux arm64 https://dotnet.microsoft.com/en-us/download/dotnet/7.0 |
pkg install mono -y; |
This install but not run dotnet, and in install have many warring with dependencies. Need this dependencies https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#dependencies When you install with a package manager, these libraries are installed for you. But, if you manually install .NET or you publish a self-contained app, you'll need to make sure these libraries are installed:
|
Hi all, we will adopt semi source build approach to build .NET to match other Linux distro offerings (Ubuntu, Fedora, Alpine) as:
AFAICT the minimum viable version offered will be .NET 7. Anything lower will involve a lot more patches. PRs are welcomed until the version EOL. This is not a guarantee that the package is on the way. Building all .NET components:
Hence will disable building them individually for the short term. We will learn as we build along the way. PRs are definitely welcomed after the initial package is landed. |
Awesome @truboxl - looking forward to helping out if I can! |
Building it from source shouldn't be that complex. Hmu if you need any help with it. |
.NET 8 has been released. Any progress on this? |
Any progress on .NET for Android? |
I was experimenting with this and sort of got the
But whenever I try to do anything, including
See the attached strace via Possibly related to dotnet/runtime#91987 ? |
This comment was marked as off-topic.
This comment was marked as off-topic.
A new typical project worked flawless in dotnet but xbuild msbuild all failed https://github.com/heasm66/UnZ These are some of the notes I saved I will try to build this on device preferably
|
This project is a very promising initiative to develop in .Net with real cross platform support.
Website: https://www.microsoft.com/net/core (already supports multiple Linux distros)
And the cli on github: https://github.com/dotnet/cli
The text was updated successfully, but these errors were encountered: