-
Notifications
You must be signed in to change notification settings - Fork 132
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
[Alpine Linux] s390x
platform support
#2839
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Current issue: As is currently the case, crosscompilation of runtime fails due to clang13 not having |
I made another attempt. Considering no s390x support from lld, I set
|
cc @BahaVv |
This seems to be a problem with the cross-compile environment. Specifically:
EM 62 is
I see in the repo you've linked above that in
|
That strikes me as making total sense. I'll explore this further and come back to you. |
Okay, finally found time to setup a crossbuild environement on Alpine. I've managed to get parts of runtime built, but |
Yes, it's never been built against
so this needs to be fixed for |
Indeed, I'll have to clean up mono for musl. Considering that, I've setup a development protocol for crossbuilding on Alpine.
I'm currently at step 2. I've succesfully got runtime built, but I'm stuck on roslyn due to the following:
Roslyn's restore seems really bent on using 1.1.36, any idea what lever I need to switch? |
Note that for the above I'm trying to build 6.0.108 / 6.0.8, as fixing 6.0.100 on current Alpine would be a lot of work for nothing. |
Looking at your repo, I see things like this:
The point of my cross-build scripts was that you should allow downloading the SDK. Since it's an Intel-based cross-build, those will be available, and they'll provide all the exact versions that the build needs. Once you've used these scripts to create an initial bootstrap SDK, you can then use that bootstrap SDK to (natively) build the actual final version of the SDK. This would typically use the source-build method, with doesn't require any additional downloads. |
Unfortunately whether we pull dotnet v6.0.100 from Microsoft or use Alpine's dotnet 6.0.108 package, the result is the same. Maybe its a matter of building v6.0.100, as it was in your script originally. I have terrible memories of that release, it was really problematic to build on musl. |
Hmm, I haven't tried building 6.0.108 myself yet. I'll see if I can get it to work. |
Appreciate your help :) Next thing I should try is figuring out what flags source-build applies to roslyn's build
this from repos/roslyn.proj seems relevant. |
Hmm, I wasn't seeing any issue with building
|
Silly me! It was caused by |
Now at the stage of doing a control crossbuild to
Any idea what might cause this? EDIT: aarch64 has a similar error:
EDIT 2
Thus ilasm is being built for arm, but not for x64... EDIT 3 |
Terrific news! EDIT 1 EDIT 2 |
I got Mono fixed, and managed to crossbuild an SDK on dotnet7 :) Right now I just need an s390x VM to work out the kinks. Any idea where I might find that? |
You can get access to your own s390x VM here: https://linuxone.cloud.marist.edu If the default setup of those machines doesn't meet your requirements, let me know and we can work something out. |
I made a request last week, and awaiting response from their team :). I've been moving along via our CI pipeline, but the build has been really unstable. Every build fails for different reason, so it makes me think that the issue is with the CI. |
Got the s390x VM setup, and it looks like dotnet6 is pretty stable build wise - the bootstrap can build on itself (thus only runtime, roslyn, sdk, aspnet, installer). As for the full sdk, I'm getting a bunch of |
That's strange, the compile server normally works fine for me. This may be a problem with running different dotnet versions at the same time? Are there any old compile server tasks still left running? |
The error occurs in a pipeline environment, so it can't be due to running different dotnet versions. It only occurs on s390x. |
Fortunately, setting |
Fixed the apphost issue by doing as fedora did and disabling use of apphost in various components. Unfortunately the CompileServer issue is basically unsurmountable on full source-build. While I could get the bootstrap components (runtime, roslyn, sdk, aspnetcore, installer) to build, the full stack doesn't pickup @omajid, have you encountered this error when porting to fedora?
|
Disabling shared compilation via local _sharedcompArray="
Microsoft.CSharp.CurrentVersion.targets
Microsoft.VisualBasic.CurrentVersion.targets
Sdks/Microsoft.NET.Sdk.Razor/targets/Microsoft.NET.Sdk.Razor.Component.targets
Sdks/Microsoft.NET.Sdk.Razor/targets/Microsoft.NET.Sdk.Razor.Compilation.targets
Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets
Roslyn/Microsoft.Managed.Core.targets
"
for i in $_sharedcompArray; do
sed -i 's|<UseSharedCompilation>true</UseSharedCompilation>|<UseSharedCompilation>false</UseSharedCompilation>|' "$_cli_root"/sdk/*/$i
done where _cli_root equals location of bootstrap seems to force the false value on this flag accross the board. Although now build of newtonsoft-json fails with many errors of: /home/build/dotnet6/community/dotnet6-build/src/bootstrap/sdk/6.0.109/Roslyn/Microsoft.CSharp.Core.targets(75,5): error : [ERROR] FATAL UNHANDLED EXCEPTION: System.InsufficientExecutionStackException: Insufficient stack to continue executing the program safely. This can happen from having too many functions on the call stack or function on the stack using too much stack space. [/home/build/dotnet6/community/dotnet6-build/src/dotnet-v6.0.109/src/source-build/artifacts/source-build/self/src/src/newtonsoft-json/Src/Newtonsoft.Json/Newtonsoft.Json.csproj] The most recent version of newtonsoft-json gives the same error. |
Upgrading to 6.0.401, thus upgrading roslyn, seems to fix the shared compilation errors. The stack trace errors are still an issue though, suggesting that something is broken with my crosscompiled sdk. edit Nope, shared compilation still broken... there's something fundamentally broken with my crossgen and I can't find what it is. But, one thing is for sure, both dotnet7 and dotnet6 give me |
It turns out the issues that I'm encountering have less to do with s390x and more to do with mono-backed runtime being broken on musl. The stack issue is being tracked here. The shared compilation issue only exists on dotnet6, thus suggesting it has already been fixed and needing backporting. Shared compilation issue tracked here |
The stack issues seem to have been fixed. The current roadblock is a mono bug on musl making build of fsharp fail. It is being tracked here: dotnet/runtime#76805. I suspect it is the last bug to deal with given fsharp being one of the last components to build. |
Moving right along now, it seems like we got a full source-build build for .NET 6.0 on s390x. For .NET 7.0, there seems to be a regression:
Indeed, it doesn't take long for this kind of error to appear in CI. I set |
Closing as |
That's really excellent news! Thanks for your efforts in making this happen, @ayakael ! |
Thanks for your help in making it happen ^^ There is still one issue facing .net7 on s390x, but that's going to be tracked in #3020 Now that mono is fixed for musl, ppc64le support is trivial on dotnet7 (we even got a bootstrap crossbuilt already). Our crossbuild aware package builder, designed off of your s390x script, makes it much easier to port to new platforms. If anyone should want to model a script around our packabe builder, it reads very much like a shell script and it is available here |
I'm reopening this issue as s390x and ppc64le on Alpine is still plagued by stability problems, namely issues related to processes accessing the same file and process stalls which seem to be related to roslyn. These are hard to reproduce and I do not have the time / experience to work on this further. For anyone who wants to work further on this, I make the bootstraps available at: https://lab.ilot.io/ayakael/dotnet-stage0/-/releases |
Description
Dotnet6 on Fedora supports
s390x
. Dotnet6 on Alpine should do so, too.Parallel thread on Alpine Gitlab
Major roadblocks
As there are no dotnet6 prebuilt bootstraps release for
s390x
, we have to build our own by crosscompiling fromx86_64
tos390x
. Crosscompilation scripts was kindly provided by the Fedora team, and added to a git repo on Apine's Gitlab instance for further work.Hypothetical steps
aports/community/dotnet6-stage0
abuild deps
to install build dependencies of dotnetapk add quilt mono dotnet6-sdk
git clone https://gitlab.alpinelinux.org/ayakael/dotnet6-s390x
(original version here)cd dotnet6-s390x
&&./dotnet-s390x-prepare
./dotnet-s390x-build
cc. @nekopsykose @uweigand @omajid
The text was updated successfully, but these errors were encountered: