-
Notifications
You must be signed in to change notification settings - Fork 0
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
VoidLinux dotnet discussion #1
Comments
Just updates: |
Good job! I'll check if Jellyfin is working with this... are there any issues you're aware of? |
I'm not sure about jellyfin. I haven't tried using it on here yet. Dotnet 7 seems to be working ok. I'm doing another build on my machine now to make sure. Dotnet 6 is giving me trouble now. The last 2 attempts I tried locally have failed. After 7 finishes, im gonna try again with different settings. |
Updates: Both dotnet 6 and 7 are building fine now. They were included in the latest commit of the work branch. I'm looking through it again and I am wondering if I need to put in conflicts or something to avoid situations where the user tries to install both sets of packages. Open to thoughts on this one. |
Good job! Sadly I'm still sick, but I hope I can test this soon and package jellyfin for it. (Already have the old templates, I just need to update them) |
On Alpine, |
Hi @ayakael , I'm finally starting to get work on the musl part. Setting up the cross build environment and will try a build on that side to see what crashes hard then figure out how to make musl specific patches on here. So... progresss. :) Unfortunately, I noticed that a new version of dotnet7 recently dropped so I started working on that. I was hoping that it would be a simple switch but, unfortunately, I was mistaken. When I try to pkg 7.0.101, the build fails due to a missing crossgen2 tool that looks to be omitted from the source build. I need to investigate further on this so I branched that update separately and pushed it here as well. I need to look further on this to see what I can do for this failure. Thanks, |
Thank you for your efforts, Ryan, and good luck with musl libc! |
@rmboggs For musl did you use a separate masterdir as per https://github.com/void-linux/void-packages#building-for-musl? You mentioned cross-compiling which afaik isn't supported for any package really in terms of cross-libc, If you meant cross-compiling as in architecture wise then I'd say worry about that a bit later and get native musl libc compilation working first as a stepping stone |
Could you share the error log that you encountered with crossgen2? There were some important infrastructure changes integrated to 7.0.101 via dotnet/installer#14549, so maybe it is related to that. Also - as for musl bootstraps, the SDK that Microsoft provides for alpine should also work for void as they actually target |
Yeah, I'm only referring x86_64-musl here. I was not planning on looking into things like ARM or anything like that at the moment for this. And i am using the doc you mentioned above for building musl binaries with a different masterdir. I just got distracted with the recent dotnet 7 update that was just released. |
Yeah, it could be related to that pull. I posted the aspnetcore log file that contains the details to this gist for reference. It's just not finding that crossgen2 program to finish building aspnetcore.
Thanks for the head up on on the bootstraps. I'm going to see if I can get back to the musl build now using 7.0.100 as that version is working well on my machine now. Hoping that if the musl piece goes well, I can make a formal pull request for both 6 and 7 soon but with the holiday season now, probably won't happen until after the new year. |
Hmm, I've had issues with crossgen2 before on aspnetcore, but not this particular one. Can you try building with |
Tried both, the only one that built was I haven't installed the built package or tried using it yet. I want some more opinions before I proceed with that. |
Hi, Sorry to be away for awhile. Been really busy with work and the holidays. Since last post, not too much has changed. I got dotnet7 updated to 7.0.102 and working fine. I still need the CrossgenOutput patch unfortunately but I haven't seen anything out of the ordinary with it so cautiously optimistic. As far as musl goes, not much has changed yet. I tried cross compiling on my main system but didn't like that setup so I just setup another laptop I had with void-linux-musl so I can try building and testing to make sure it's working ok before proceeding to next steps. So far not much progress as it is currently complaining that it cannot find the linux-musl-x64 nuget packages but I plan on taking a closer look at the apline dotnet repo to see what other settings I might need. Hoping to make progress soon on this front. |
based |
By the way, I've setup a pipeline on my personai Gitlab instance that automatically generates tarballs for new releases of dotnet. For dotnet6 and dotnet7, it is available here: https://lab.ilot.io/dotnet/installer/-/releases. For dotnet8: https://lab.ilot.io/dotnet/dotnet/-/releases. Y'all are welcome to use them. Dotnet8-preview1 has also been packaged here: https://gitlab.alpinelinux.org/ayakael/aports/-/merge_requests/15 edit |
@ayakael - Sorry for the delay, trying to circle back on this. Thank you for providing the links for the tarballs. Quick question though, and sorry for my limited understanding of this, how should these builds be applied to the package for musl builds? FYI - I am in the middle of updating the dotnet7 package to 7.0.105. Dotnet6 has started giving me trouble again starting with 6.0.115 due to the distro RID being generated is now showing up as "void-x64" instead of "linux-x64" and the runtime build is not recognizing it. I've barely started investigating but I found the shell script that is causing the problem but still trying to see the best way to patch. I'll update here when I can make progress. |
So, update: Surprisingly enough, 7.0.105 actually builds successfully on x86_64-musl on an actual musl machine but fails during the package process with an odd error:
After a bit of research, it looks like the common/shlibs needs to be updated to map that shared library but I am not sure which package it belongs to. However, I'm not 100% sure that is correct as this does look like a default library for musl, which means that I may need to update the template a bit just for musl. Anyone have any thoughts on this? |
Ahh good news! I pushed a bunch of patches upstream to get dotnet7 to build with as little patching as possible. As for libc.musl, that sounds like a void package manager problem, which I can't help with. For dotnet6, 6.0.115 saw some changes backported from dotnet7 by myself which removes the necessity to runtime twice (via runtime-portable). Unfortunately, upstream NACKed the last patch as it was deemed too risky. Ironically, this complicated things as the change is now in a half-backed state across the dotnet ecosystem. Everything is in, except the last change that brings everything together. Thus, I recommend you apply the patch I run on Alpine, which should fix the error that you are encountering. This also introduces logics that automatically adds unrecognized RIDs. installer_14816-eliminate-portable-build.txt Now, because void uses both libc and musl, it's a bit awkward RIDs-wise. To match how RIDs are set globally, there should be a |
Re bootstrapping: On Alpine, we skip Coming back to the RID issue, you will like have some problems down the line due to dotnet interpreting your system (even when musl-based) as So, to fix this, I see two approaches:
|
Thanks both for all the hard work! I am just reading along to see when you call out for testers, I have both x86_64 and aarch64 hardware to test with (both glibc though). |
@Anachron - dotnet7 is building and running on x86_64 glibc in the dotnet-work-NOMERGE branch of this repo if you want to start trying it out. Please be aware, however, that it takes a LONG time to build for me due to having older machines. I haven't put any work into the arm builds yet. @ayakael - I finally got the pkg process to complete on my musl system for all the packages but I don't believe I fixed the On the plus side, except for dotnet-sdk, all of the other packages (runtimes, hosts, templates, targeting-packs, etc) for dotnet 7 built and installed without problems on void-musl. However, I have yet to test them thoroughly due to the sdk package issue. I haven't had a chance to circle back to the dotnet 6 build yet. Based on @ayakael's previous comment regarding the current rid issue that I am dealing with, I do think the second approach would be ideal. My only question would be: "would it be possible for the new rids to be backported to version 6 or is it only possible to for version 7+ to be updated?" I'll need to ask and find out. |
Did some more looking today. Looking at this doc and this doc too it looks like the minimum version of musl supported by dotnet is 1.2.2. Void is still on 1.1.*. I'm actually kinda surprised I am getting as far as I have been. Based on that, I'm not sure how much farther I can get until Void can update their musl base system to 1.2.2. |
I think I'd take that with a pinch of salt, but I can imagine why they've done that upstream... I would say the path forward may not be impossible with 1.1.x but some of the shortcuts will likely be missing .. |
I'd like to add that Void's musl is quite heavily patched to the point it's starting to resemble 1.2.x more than 1.1.x |
First, you gotta
Second, I guess you still need those symlinks ;-)
Edit: Looks good:
Took around 1 hour with a
I find it a bit disturbing just how big this builddir is: |
Glad to be of service! They should be arch agnostic as they don't contain any prebuilts, just source code. It's a relief that, with dotnet8, this business of building tarballs won't be necessary. We can pull the source code directly from the GitHub repo now. |
@ayakael - Thanks, good to know. Sounds like it's going to be awhile before the updated openssl packages will be available, unfortunately. So it'll be some time before I can actually get this work off the ground. May not be able to pick up until tomorrow. My timing sux. Based on my testing from yesterday, I believe that I just need to need to unzip the contents into the ${wrksrc}/sources directory but I need to move it up one directory with the following command:
|
If there is anything I can do to help, let me know. I am happy to test things on both Until then, good luck! |
Thanks, my current hold up is waiting for the openssl updates to hit the void servers so i can test withoit rebuilding everything manually. I'll keep you all posted. |
FYI - The build is failing in the installer step that is complaining that the generated source link is empty. I posted build log in the Gist linked below. I'm either not setting something in the build correctly or I am missing more downloads? Anyone have any ideas? |
We also get this error on Alpine Linux. The following patch workarounds the issue: From 98054ea87ce70247bb09ceafd2ad1a0b36d2fef4 Mon Sep 17 00:00:00 2001
From: Antoine Martin <dev@ayakael.net>
Date: Sat, 1 Oct 2022 09:21:58 -0400
Subject: [PATCH] Disable source link
Addresses undiagnosed "Source control information is not available" error
---
diff --git a/repos/installer.proj b/repos/installer.proj
index 3a9756a27b7..4968184b14e 100644
--- a/repos/installer.proj
+++ b/repos/installer.proj
@@ -26,6 +26,7 @@
-->
<BuildCommandArgs>$(BuildCommandArgs) /p:NETCoreAppMaximumVersion=99.9</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:OSName=$(OSNameOverride)</BuildCommandArgs>
+ <BuildCommandArgs>$(BuildCommandArgs) /p:EnableSourceLink=false</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:PortableOSName=$(PortableOS)</BuildCommandArgs>
<BuildCommandArgs Condition="'$(TargetOS)' == 'Linux'">$(BuildCommandArgs) /p:Rid=$(TargetRid)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:DOTNET_INSTALL_DIR=$(DotNetCliToolDir)</BuildCommandArgs>
`` |
By the way, I'm working on getting dotnet6 builds working on linux-musl without patches: This is only necessary if you do not use the Alpine patches that drops |
Thanks @ayakael, that fixed it. It builds successfully now. Let me see if I can post the new template files somewhere for someone else to test. |
New working dotnet 7 template file with correct references to @ayakael stage files can be found here for review and critique if interested. https://github.com/void-dotnet/staging/blob/main/srcpkgs/dotnet7/template |
@rmboggs Great job! I successfully packaged Parabolic (a dotnet gnome app), thanks to your efforts! I see you disabled the telemetry in the template. You can also set the
By the way, here is the template I compiled:
|
@chrysos349 Neat stuff, I feel like there definitely could be a Btw |
Yes, but first thing is first. ;)
Is this for the dotnet 7 item? If so, what build style should be used? |
@rmboggs If the |
Ah ok, makes sense. Thanks. |
Just an fyi - I will try to work on the x86_64-musl build next. if I remember correctly, I may need to request an update to the musl libs for void linux as during my previous tests, the dotnet libraries were looking for a specific musl library that Alpine Linux seems to include in their files but Void Linux does not. I believe it was just a simple symlink but need to look at it further. If anyone wants to give arm64 a try, please feel free and let me know if changes to the template file are needed. |
You're funny, you restricted Also, all your symlinks are gone from the https://github.com/void-dotnet/staging/tree/main repo. That lets my build fail instantly. I've done some cd gitsrc/srcpkgs
ln -svT dotnet7 dotnet-host
ln -svT dotnet7 dotnet7-hostfxr
ln -svT dotnet7 dotnet7-runtime
ln -svT dotnet7 aspnetcore7-runtime
ln -svT dotnet7 dotnet7-sdk
ln -svT dotnet7 dotnet7-targeting-pack
ln -svT dotnet7 aspnetcore7-targeting-pack
ln -svT dotnet7 dotnet7-templates
ln -svT dotnet7 netstandard-targeting-pack
ln -svT dotnet7 dotnet7-apphost-pack And it's building now. Will update once it's finished. Edit:
Do I still need the patch from #1 (comment) ? Edit2:
|
@Anachron not that hard to recreate all symlinks from the template. run this in
|
I was thinking more about musl support. One thing I'd explore doing is, when using linux musl, set Also, as explained a while ago, your Prebuilt artifacts tarball will need the edit |
Yeah, that's my bad. I didn't spend much time getting the template file up there. Sorry about that.
Thanks for that script. |
Where should this be applied? I'm thinking that the target RID should be calculated depending on the platform/libc types and saved to a variable or something somewhere. I just need to know where to pass the parameter in, the build or in the configure/prep step?
Yeah, I already know that the musl side is going to be more of a challenge due to this and other items.
Hence, another reason to calculate it ahead of time like I mentioned above. It used to be linux awhile ago and then it flipped to "void", which caught me off guard, and now it's going back. Better to define it ourselves than have it default. |
If you wanna do pull requests for the staging repo to add whatever code is needed for musl/arm64, feel free. I'll pull them in and use those updates with my work and ultimate submission. I don't want to do it in the void-packages repo as they tend to do some rebasing/flattening stuff that has messed up my work before. Or if you want to be included in this repo's org, let me know. |
Like so:
By the way, |
Ah, in the build, good to know. Thanks.
Also, good to know. I'll keep that with the dotnet6 template then. |
As in, it only worked with dotnet5 and below, and even then it was never really supported. Aspnetcore relied on portable build artifacts. and skipping portable runtime build would thus break aspnetcore, apparently. With dotnet6, unless you use dotnet/installer#14816, you should be building runtime-portable step. |
Turns out, we need The build now fails with
I think I will move this one on my |
Indeed, cross-compiling dotnet is... not straightforward. For Alpine we had to ditch source-build and crosscompile individual components: https://lab.ilot.io/ayakael/dotnet-stage0/-/blob/main/APKBUILD I'd keep it native, and use the binaries provided by Microsoft for now. |
Downloading the binaries and running them from the folder they come in seems to work for now. They imply you can have multiple SDKs and runtimes available and callable from the same |
I'm moving this conversation over to: Seems more appropriate there now. |
Opening issue to continue discussion on packaging dotnet on VoidLinux.
The text was updated successfully, but these errors were encountered: