-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add CG2 to source-build bundle #49241
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
base: main
Are you sure you want to change the base?
Conversation
cc: @dotnet/distro-maintainers |
@tmds this might help address the issues you mentioned in dotnet/source-build#5225 |
It's a different problem. |
@am11 have you checked how much the size increase is? I've extracted I think the debug symbols are bloating the package significantly. |
For x64 and other MSFT platforms, PublishReadyToRun=true pulls it from nuget.org. For community supported platforms, the CG2 runtime package is not available. We have to manually copy the nuget package to the local store. We can limit it to non-MSFT platforms with a long condition (either include/exclude pattern). |
When we added source-built NativeAOT we spend some time to reduce the size impact on the SDK. We placed the native files under I don't think we should have this 100+MB file by default under
Yes, or let the maintainer set |
@am11 I think this needs some changes to |
On linux-riscv64, it's a 32M package:
Funny thing is
They have identical content. Looks like a packaging bug.
I was testing it with linux-riscv64 which is covered
|
The debug symbols shouldn't be stripped for source-build: https://github.com/dotnet/runtime/blob/624737eb3796e1a760465912b27ac349965d8ba5/Directory.Build.props#L276. This is what is in the Fedora 41 x64 package:
What files are in the linux-riscv64 package? |
It is downloadable from one of the runs https://github.com/filipnavara/dotnet-riscv/actions/runs/15317256008. For community platforms, there is one JIT for the target RID However, this - too - doesn't seem like something done intentionally but rather an infra bug. |
I don't even consider it common for end-users to publish r2r for the same platform, which is why I've not pursued bundling it with the SDK. Due to the large increase in size, I don't think we should bundle it by default for platforms where Microsoft provides a package through through nuget.org. Even for community platforms, you might choose to out the feature rather than take on the extra size. |
There're are additional problems for community platforms. Firstly, there's no mechanism to simply obtain these packages since they are not on NuGet. Suddenly you need extra infrastructure in addition to the xcopy deployed SDK. Secondly, I use the SDKs to bootstrap the VMR/runtime builds on target machines for local testing. Obviously I expect that to be niche but it's important at this stage. |
Quick github search suggests there are more PublishReadyToRun usages than PublishAot. Then supporting PublishAot out of the box and leaving behind PublishReadyToRun does not make sense.. |
The main suggestion I'm making is to not have For the community platforms, I don't have a strong opinion. I see both reasons to build |
@am11 I think it would be an option to default
|
MSFT supported RID gets it from nuget.org so it is optional. Unsupported RIDs will get it bundled by default because there is no other way to obtain it. Size optimization is not important when the question is about completeness. This is a choice of .NET team exclusively, as third party packages with native assets do not distinguish between official vs. community platforms: e.g. https://nuget.info/packages/SQLitePCLRaw.lib.e_sqlite3/2.1.11 so it is not a widespread issue. |
I don't think an end-user would have much of an issue if crossgen is not available on a community platform. They wouldn't be able to optimize their app. For ILCompiler the nupkg was also 100MB+ in size, so we did a different design that allowed to strip the symbols. If we could do something similar for Crossgen2 then it would be bundled by default with all source-built SDKs. I'm ok with the PR as it is. |
The size issue is most likely a bug #49241 (comment). Symbols package is created but it has the same content as the original.
PublishReadyToRun does not work, while PublishAot works. You may not see it as an issue, others do. |
so that this last line https://github.com/filipnavara/dotnet-riscv/blob/ee6f66cef9df27c4783561219f6589112533ab43/.github/workflows/build.yml#L52 is not needed in SB scenarios (followed by manually copying it to
<SDK install prefix>/library-packs/
after extraction on target machine to enable PublishReadyToRun=true).cc @jkoritzinsky, @filipnavara