Skip to content
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

ILCompiler: support publishing using a non-portable ILCompiler build. #99148

Merged
merged 5 commits into from
Mar 13, 2024

Conversation

tmds
Copy link
Member

@tmds tmds commented Mar 1, 2024

@ghost
Copy link

ghost commented Mar 1, 2024

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Contributes to dotnet/source-build#1215.
Closes #66859.

@jkotas @hoyosjs @jkoritzinsky @agocke ptal.

cc @MichaelSimons @ashnaga @omajid

Author: tmds
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@tmds
Copy link
Member Author

tmds commented Mar 1, 2024

I validated this change together with dotnet/installer#18835.

We should let the installer PR flow into the vmr before we merge this one.

@tmds
Copy link
Member Author

tmds commented Mar 5, 2024

@jkotas I took a look at what is in the non-portable compiler package and compared it with nuget.org's linux-x64 of .NET 9 preview1:

linux-x64 (9.0.0-preview.1.24080.9):

-rw-r--r--. 1 tmds tmds  14M Jan 31 03:45 ilc
-rw-r--r--. 1 tmds tmds  27M Jan 31 03:45 ilc.dbg
-rw-r--r--. 1 tmds tmds 566K Jan 31 03:45 ILCompiler.Compiler.pdb
-rw-r--r--. 1 tmds tmds  22K Jan 31 03:44 ILCompiler.DependencyAnalysisFramework.pdb
-rw-r--r--. 1 tmds tmds 142K Jan 31 03:45 ILCompiler.MetadataTransform.pdb
-rw-r--r--. 1 tmds tmds  78K Jan 31 03:45 ILCompiler.RyuJit.pdb
-rw-r--r--. 1 tmds tmds 162K Jan 31 03:44 ILCompiler.TypeSystem.pdb
-rw-r--r--. 1 tmds tmds 278K Jan 15 18:21 libc++abi.so.1
-rw-r--r--. 1 tmds tmds 2.8M Jan 31 03:42 libclrjit_universal_arm64_x64.so
-rw-r--r--. 1 tmds tmds 2.4M Jan 31 03:42 libclrjit_universal_arm_x64.so
-rw-r--r--. 1 tmds tmds 2.9M Jan 31 03:39 libclrjit_unix_x64_x64.so
-rw-r--r--. 1 tmds tmds 2.9M Jan 31 03:43 libclrjit_win_x64_x64.so
-rw-r--r--. 1 tmds tmds 2.9M Jan 31 03:42 libclrjit_win_x86_x64.so
-rw-r--r--. 1 tmds tmds 1.4M Jan 15 18:21 libc++.so.1
-rw-r--r--. 1 tmds tmds  47K Jan 31 03:34 libjitinterface_x64.so
-rw-r--r--. 1 tmds tmds  20M Jan 15 20:21 libobjwriter.so
drwxr-xr-x. 1 tmds tmds  168 Mar  5 14:18 netstandard

fedora.39-x64 (9.0.0-preview.2.24123.1):

-rw-r--r--. 1 tmds tmds  13M Mar  5 06:15 ilc
-rw-r--r--. 1 tmds tmds  24M Mar  5 06:15 ilc.dbg
-rw-r--r--. 1 tmds tmds 571K Mar  5 06:14 ILCompiler.Compiler.pdb
-rw-r--r--. 1 tmds tmds  22K Mar  5 06:14 ILCompiler.DependencyAnalysisFramework.pdb
-rw-r--r--. 1 tmds tmds 142K Mar  5 06:14 ILCompiler.MetadataTransform.pdb
-rw-r--r--. 1 tmds tmds  78K Mar  5 06:14 ILCompiler.RyuJit.pdb
-rw-r--r--. 1 tmds tmds 151K Mar  5 06:14 ILCompiler.TypeSystem.pdb
-rw-r--r--. 1 tmds tmds  42M Mar  5 06:11 libclrjit_universal_arm64_x64.so
-rw-r--r--. 1 tmds tmds  35M Mar  5 06:12 libclrjit_universal_arm_x64.so
-rw-r--r--. 1 tmds tmds  42M Mar  5 06:11 libclrjit_unix_x64_x64.so
-rw-r--r--. 1 tmds tmds  42M Mar  5 06:11 libclrjit_win_x64_x64.so
-rw-r--r--. 1 tmds tmds  41M Mar  5 06:13 libclrjit_win_x86_x64.so
-rw-r--r--. 1 tmds tmds 309K Mar  5 06:04 libjitinterface_x64.so

Is the difference in size of the libclrjit files expected?

Because we want to enable publishing for the host os+architecture (using the non-portable rid), maybe we can remove some files from the non-portable nuget package that are meant for cross-targeting.

@jkotas
Copy link
Member

jkotas commented Mar 5, 2024

Is the difference in size of the libclrjit files expected?

Looks like the libclrjit* files do not have stripped symbols on Fedora. Are you disabling symbol striping for your build (-keepnativesymbols option for build.sh).

maybe we can remove some files from the non-portable nuget package that are meant for cross-targeting.

We include all cross-compiling JITs in both NAOT and R2R compiler packages to keep things simple.

If you would like to strip cross-compilation support for non-portable builds, I do not see a problem with it.

@tmds
Copy link
Member Author

tmds commented Mar 6, 2024

Looks like the libclrjit* files do not have stripped symbols on Fedora. Are you disabling symbol striping for your build (-keepnativesymbols option for build.sh).

Yes, that is the reason!

keepnativesymbols is the default behavior for source-build:

<KeepNativeSymbols Condition="'$(KeepNativeSymbols)' == '' and '$(DotNetBuildSourceOnly)' == 'true'">true</KeepNativeSymbols>

and from reading #39203 I learn it is the responsibility of the distro package system to strip them.

If you would like to strip cross-compilation support for non-portable builds, I do not see a problem with it.

I'll look closer into it once we have something working from the vmr.

@tmds
Copy link
Member Author

tmds commented Mar 12, 2024

@jkotas is this ready to merge?

Copy link
Member

@MichalStrehovsky MichalStrehovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me otherwise!

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@jkotas jkotas merged commit 596a1f7 into dotnet:main Mar 13, 2024
147 checks passed
@tmds
Copy link
Member Author

tmds commented Mar 13, 2024

Thank you, @jkotas!

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NativeAOT doesn't work with Linux non-portable build
4 participants