-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Support platforms where crossgen2 is not available #35916
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
Conversation
b353ea0 to
85a7581
Compare
|
Updated patch to automatically disable crossgen2 when targeting s390x. This enables the source-build method to work as well (there's no simple way to pass the /p:CrossgenOutput=false option when using the source-build framework). In any case, crossgen2 is completely unsupported on s390x, so it makes sense to disable it. |
|
FYI @adityamandaleeka - in addition to the big-endian patches, this PR is also required to get a successful build on s390x. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to make this reference conditional, some of the assemblies from here are necessary parts of our SharedFx. I'm thinking it'd be better to use another compatible RuntimeIdentifier in the event we're building on s390x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wtgodbe and I discussed this offline. Withdrawing the objection. Let's avoid the eng/Dependencies.props change and the "fix by adding a local repo holding the Microsoft.NETCore.App.Runtime.linux-s390x package to NuGet.config".
|
@wtgodbe I guess I was confused by this comment in eng/Dependencies.props then: If the App.Runtime package is indeed used for something else besides crossgen, then we can simply add the s390x version to that list and leave the reference unconditional. This means if you build aspnetcore on s390x, you'll have to provide the package via a local repository, but I think this is OK (with source-build it should work correctly anyway). Does this look reasonable to you? |
I'm generally concerned that this change indicates a significant gap, not just a missing
|
We are currently working on enabling .NET support for the s390x processor architecture (IBM Z mainframe). This is a new platform which needs support throughout the various runtime & SDK components. We currently have an internal build of all those components working, and are in the process of contributing the necessary source code changes back upstream. (E.g. the "runtime" package and most of the SDK already builds out of the box.) However, while source code changes have been merged to various dotnet components as community contributions, at this point there is no plan for Microsoft to officially support this architecture. We are working with Red Hat to enable support for s390x via the Red Hat .NET product. Therefore, Microsoft is likewise not doing any automated binary builds of .NET components, and so they're not available in the Azure repos (like "dotnet-public" etc.). This means that if the aspnetcore build looks there for e.g. a platform-specific App.Runtime package for linux-s390x, it won't find it there. That doesn't mean you can't build it - you just have to build the runtime source tree first, install the package in some local nuget repo, and add that when building aspnetcore. (Or use the source-build mechanism, where this should work automatically, and which is what Red Hat is using anyway.) As to the second question, if native code out of the runtime package is needed, then no, you cannot use any other runtime instead - s390x is a different processor architecture, so native code for other runtimes will not run. |
…
These two bits seem to contradict each other. If we don't need to produce an ASP.NET Core runtime for s390x, we shouldn't check anything into this repo, especially because the special cases complicate an already-complicated project.
Please why we don't either
Pretty sure we don't need native code from the runtime package. |
|
@dougbu - there is the concept of "community maintained" ports. Tizen is another example of this, and we're generally supportive of this effort, so unless there are compelling technical reasons to reject this PR, I think we should take it. |
|
Thanks, @Pilchie ! I'm happy to work on finding whatever solution is the least maintenance burden to the aspnetcore project while still allowing it to be built for s390x as a community maintained port. @dougbu This patch was intended to address three problems I was running into:
As far as I can see, the last two points really need (small) changes to the aspnetcore sources. The only alternative would be to make those changes via patches carried permanently in source-build, but that doesn't really seem preferable overall ...
I guess I'm still confused what the platform-specific runtime package is used for then (in the absence of crossgen)? @wtgodbe you mentioned the SharedFx framework, and I do indeed see target runtime code there, but unless I'm missing something this is installed via |
👍
I suspect it's not actually needed except when using |
Thanks!
I don't quite understand what you're asking me to do here, sorry. I thought the code I'm adding in line 46 there does disable
The two |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not positive what's going wrong here but the following seems safer:
| <CrossgenOutput Condition=" '$(CrossgenOutput)' == '' AND '$(Configuration)' != 'Debug' AND '$(TargetArchitecture)' != 's390x' ">true</CrossgenOutput> | |
| <CrossgenOutput Condition=" '$(TargetArchitecture)' == 's390x' ">false</CrossgenOutput> | |
| <CrossgenOutput Condition=" '$(CrossgenOutput)' == '' AND '$(Configuration)' != 'Debug' ">true</CrossgenOutput> |
If that doesn't build correctly, add -bl to your build (/p:SkipTestBuild=true also recommended) and find the exact location of the error(s) that occur w/o the @(Reference) items for the runtime and crossgen2 packages.
|
Either your suggested change, or my original patch, will build fine with the other two changes (conditional references) included. Neither version will build without the changes to the references lines. As far as I can see, the only difference with your suggestion is that it removes the possibility to override the CrossgenOutput setting manually on the command line. I guess this doesn't really matter either way to me -- if you prefer the version with the s390x check on a separate line, I'm happy with that. I'm not sure if you're still interested in the specific errors that occur when removing the changes to the references lines, but just in case, the first error is: This error goes away when adding the following to and then I immediately get instead: which I can similarly fix by adding to However, then I get the following errors: The first of those I can fix by adding a local repo holding the Of course, making the References lines conditional as in the PR will fix both those issues. |
* Do not use crossgen2 when targeting s390x (where it is not supported) * Only reference "Microsoft.NETCore.App.Runtime.$(RuntimeIdentifier)" and "Microsoft.NETCore.App.Crossgen2.$(BuildOsName)-$(Crossgen2BuildArchitecture)" when actually using crossgen2.
85a7581 to
a605dd6
Compare
|
Updated PR as per the above suggestion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't clear and missed something in your earlier comments @uweigand, sorry. I thought making the two @(Reference) items conditional caused other problems w/ the s390x runtime package. Since that's not the case, this is fine as-is.
Strongly suggest running the Microsoft.AspNetCore.App.UnitTests.csproj tests on x390x to make sure the runtime built matches expectations.
Let's go w/ the conditionalized @(Reference)s for both the NETCore runtime and crossgen2 packages. Can't leave the crossgen2 reference and don't want the complications if we leave the NETCore.App reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wtgodbe and I discussed this offline. Withdrawing the objection. Let's avoid the eng/Dependencies.props change and the "fix by adding a local repo holding the Microsoft.NETCore.App.Runtime.linux-s390x package to NuGet.config".
Thanks!
I did run this, and IMO it looks basically good. There are a couple of issues causing test failures, but those seem to be test case problems -- I'm seeing the exact same failures also on linux-x64. Specifically, I get:
With the two manual changes mentioned above, there is still one final failing test, because that environment variable is not set when running outside of Helix. (And also the test seems to hardcode win-x64 anyway.) |
|
Thanks @uweigand❕ |
|
/backport to release/6.0 |
|
Started backporting to release/6.0: https://github.com/dotnet/aspnetcore/actions/runs/1215205405 |
|
@Pilchie backporting to release/6.0 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Support platforms where crossgen2 is not available
Using index info to reconstruct a base tree...
M src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj
Falling back to patching base and 3-way merge...
Auto-merging src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj
CONFLICT (content): Merge conflict in src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Support platforms where crossgen2 is not available
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
|
Hi @uweigand. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
PR Title
Support platforms where crossgen2 is not available
PR Description
On s390x, we currently do not support crossgen2, neither as build nor as target architecture. It should still be possible to build aspnetcore by specifying
/p:CrossgenOutput=false, but that runs into the problem that the build still tries to restore the following packages that are not available:However, those packages are not acually needed when using
/p:CrossgenOutput=false, so by simply making the package reference conditional, the build succeeds on s390x.