Skip to content

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

Merged
jkotas merged 5 commits into
dotnet:mainfrom
tmds:sb_native_aot
Mar 13, 2024
Merged

ILCompiler: support publishing using a non-portable ILCompiler build.#99148
jkotas merged 5 commits into
dotnet:mainfrom
tmds:sb_native_aot

Conversation

@tmds

@tmdstmds commented Mar 1, 2024

Copy link
Copy Markdown
Member

@ghost

ghost commented Mar 1, 2024

Copy link
Copy Markdown

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

tmds commented Mar 1, 2024

Copy link
Copy Markdown
MemberAuthor

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

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

Comment threadsrc/tasks/Crossgen2Tasks/ResolveReadyToRunCompilers.cs
Comment threadsrc/installer/pkg/projects/Microsoft.DotNet.ILCompiler/ILCompilerRIDs.props Outdated
Comment threadsrc/coreclr/tools/aot/ILCompiler/ILCompiler.csproj Outdated
@tmds

tmds commented Mar 5, 2024

Copy link
Copy Markdown
MemberAuthor

@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
Copy Markdown
Member

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.

Comment threadsrc/coreclr/tools/aot/ILCompiler/ILCompiler.csproj Outdated
Comment threadsrc/coreclr/tools/aot/ILCompiler/ILCompiler.csproj Outdated
@tmds

tmds commented Mar 6, 2024

Copy link
Copy Markdown
MemberAuthor

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:

<KeepNativeSymbolsCondition="'$(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

tmds commented Mar 12, 2024

Copy link
Copy Markdown
MemberAuthor

@jkotas is this ready to merge?

@MichalStrehovskyMichalStrehovsky left a comment

Copy link
Copy Markdown
Member

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!

@jkotasjkotas left a comment

Copy link
Copy Markdown
Member

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:mainMar 13, 2024
@tmds

tmds commented Mar 13, 2024

Copy link
Copy Markdown
MemberAuthor

Thank you, @jkotas!

@github-actionsgithub-actionsBot locked and limited conversation to collaborators Apr 12, 2024
Sign up for freeto 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

@tmds@jkotas@am11@MichalStrehovsky