-
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
source-build 'dotnet restore' fails for platform rid #1202
Comments
If I edit <KnownFrameworkReference Include="Microsoft.NETCore.App"
TargetFramework="netcoreapp3.0"
RuntimeFrameworkName="Microsoft.NETCore.App"
DefaultRuntimeFrameworkVersion="3.0.0-preview8-28405-07"
LatestRuntimeFrameworkVersion="3.0.0-preview8-28405-07"
TargetingPackName="Microsoft.NETCore.App.Ref"
TargetingPackVersion="3.0.0-preview8-28405-07"
RuntimePackNamePatterns="Microsoft.NETCore.App.Runtime.**RID**"
RuntimePackRuntimeIdentifiers="fedora.30-x64;linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86"
IsTrimmable="true"
/> it works. |
I would guess this is a portable vs. non-portable issue. I wouldn't expect fallback for the framework packs because they aren't restored using PackageReferences. The Maybe there's some non-portable build magic that still needs to be removed? |
Yeah, this looks like we might have missed somewhere we removed non-portableness. I'm looking into this now. |
I phrased this poorly, just to clarify, I mean that I wouldn't expect fallback once the SDK decides what it wants and tells NuGet to download it. The SDK performing fallback when the target RID isn't specified in |
For my education, is the |
I got a build from @omajid where this is now working because of the switch to portable. This means the using @omajid mentioned build is switching to portable because of ASP.NET Core integration. I don't see how ASP.NET Core and portable are linked, because afaik ASP.NET Core is all managed code? |
Yep, design is over here: dotnet/designs#50. Source-build does produce this package, along with the other packs. Here's the list of what Core-Setup produced in a recent CI run:
|
You can see the original discussion here, but the short version is that the core runtime and the ASP.NET runtime are required to have the same RID. ASP.NET doesn't have a non-portable build, because it is all managed code, and this would essentially be adding a new feature from them that nobody except source-build would use. This change actually brings us more in line with the official build, which uses a portable runtime even with the non-portable SDK. |
Nice. Is it the plan to include this in the dotnet installation? Then source-build sdk could do self-contained without nuget.org involvement. PS: this is definitely a package that shouldn't be source-built under the
Can you give an example of something (some code/project file) that is expecting this? |
Sure, core-sdk expects them to be the same here. I tried overriding this in a couple different ways and did manage to get things building, but I still had failures at runtime due to ASP.NET expecting to live in same folder as the core runtime here. That was when I looked into how the official build was doing this and discovered it was using the portable runtime all the time. |
Unfortunately this isn't supported in the current design: #1046 (comment).
I don't understand these comments... is there a reason that the Microsoft portable build would support more Linuxes than a source-build portable build? Why shouldn't we build a portable |
I think this is about implicit guarantees of what Correct me if I am wrong, but Microsoft builds the portable build on a RHEL 7 machine. That uses a certain version of Building on a more recent platform - say Fedora 30, or Debian 10 - means that .NET Core may (will?) use As I understand it, @tmds 's concern is that we can build source-build on two different platforms, both will produce a "portable" For self-contained applications, will this work at all? If someone builds "portable" |
Thanks for those references. Is it about rid-named folders mostly?
If you build binaries you link with what you have on the system unless that has been taken care of specifically (e.g. openssl 1.0 vs 1.1). glibc can be especially tricky because it has different versions for symbols. afaik Microsoft has been building linux-x64 on rhel.7 because that has the oldest version of glibc. If you build on a newer os, you may require some symbol version which aren't present on an os with an older glibc version. |
I honestly stopped looking into it after my first couple workarounds failed and I found out how the official build was doing it. We didn't think this would cause any issues, now that we know it's a bit more problematic, I can go back and try a few more things after I finish up the prebuilt stuff I'm currently doing. |
Thanks, wasn't aware of this dependency, very interesting. Building non-portable builds/RIDs certainly seems like the clearest thing to do. I agree that it can't be put anywhere accessible in the end product as (They're built on CentOS 7, by the way: https://github.com/dotnet/core-setup/blob/c947763d1fa6e935086a35d81bd1e7f5ef750b93/azure-pipelines.yml#L100, https://github.com/dotnet/coreclr/blob/0bbc89c7279a2655e8cfe8466eb69d85899033a8/eng/platform-matrix.yml#L143.) |
There are two aspects. binary compatibility with given distribution. glibc, curl and openssl are some example where compatibility may be problem. But there is also the RID graph and package selection where build may or may not be portable at .NET layer. |
@crummel have you had the chance to look into this? |
I can confirm the issue: built on Fedora 31, running on RHEL7.7 I get:
So two issues:
|
I am not sure I understand this question. If we are using source-build to build a package that should become (say) a part of Fedora 31, how do we ask people to build on a different OS? |
I guess that's true, we can't target the non-portable SDK to the correct RID while we're building on a different OS. Scratching that one. |
Based on what I've learned in this thread, this seems to me to be the right thing to do, that it's literally impossible to make a It seems like if you want to publish something that will run across, say, Fedora 31, 32, and 33, you have to get access to a 31 distro (machine, VM, Docker container...) then use its source-built .NET Core SDK to publish a |
I think I crossed some wires... the above is my understanding why .NET Core needs to be built for a specific RID, but it seems possible that since ASP.NET Core is all managed code, it could still be built as |
Exactly!
I wouldn't consider this a real use-case.
Yes, afaik ASP.NET Core is even the |
Oh right, this is actually not completely true as far as runtime packs and shared framework go. The build runs crossgen to create native images in the DLLs--I'm not sure if those have the same compatibility requirements as the base runtime. If they do, I can imagine someone wanting to get the Microsoft-built ASP.NET Core runtime pack, and they might be unable to (by normal means) when source-build gives them a
Makes sense to me, does seem against the point of building from source in the first place. |
Catching up here as I've been away. Expect more replies.
That line indicates which runtime packs will be available from nuget feeds (at this time runtime packs always come from nuget), so we should not add the source build RID to it unless there is some work done to make it available. |
@fadimounir Does crossgen emit anything differently if built for a specific distro? I don't think it does, but I want to be sure. |
Ah, yes, crossgen will make this
source-build makes things compatible at the source code level. backwards binary compatibility is a much harder problem. |
@nguerrera crossgen should emit the same image for different distros. Running crossgen however requires the correct crossgen/distro compatibility. For instance, crossgen that runs on linux-musl can't run on linux. But the output R2R image should be the same |
I've opened #1221 to revert to building the non-portable core runtime. This still uses the portable ASP.NET runtime. |
#1221 has been merged, we're back to a non-portable core runtime by default. |
This might be a silly question, but |
No. It should fall back to linux-x64. |
Okay, then this sounds like a bug:
|
Can you check if |
It's there:
Surprisingly, |
source-build adds it. |
This is the other side of dotnet/source-build#1202. In this case the apphost is not known and the SDK downloads the host from nuget.org instead of using the host that is included with the sdk.
This is the other side of dotnet/source-build#1202. In this case the apphost is not known and the SDK downloads the host from nuget.org instead of using the apphost that is included with the sdk.
This is the other side of dotnet/source-build#1202. In this case the apphost is not known and the SDK downloads the host from nuget.org instead of using the apphost that is included with the sdk.
This is the other side of dotnet/source-build#1202. In this case the apphost is not known and the SDK downloads the host from nuget.org instead of using the apphost that is included with the sdk.
repro:
Using Microsoft 3.0.100-preview8-013656:
Using source-build 3.0.100-preview8-013656 sdk on Fedora 30:
The source-build sdk doesn't fall back to the linux-x64 rid.
project.assets.json
diff:CC @omajid @crummel @dagood
The text was updated successfully, but these errors were encountered: