-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Move tools to use LKG ILC #107772
Draft
agocke
wants to merge
17
commits into
dotnet:main
Choose a base branch
from
agocke:use-aot-lkg
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Move tools to use LKG ILC #107772
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e2500de
Move tools to use LKG ILC
agocke cf9e021
Remove more properties set centrally.
agocke 23814ac
Remove crossgen2_inbuild and use main project
agocke 55b59d5
Keep cross-arch configuration
agocke 6991193
Re-introduce publish projects
agocke 8d56351
Refactor and add crossarch to clr.tools
agocke 691a4dc
Remove NativeAotSupported condition for crossgen2 crossarch
agocke da3f86c
Force non-crossarch crossgen to use buildarch
agocke db46f33
Use crossarch when cross building and publish when local
agocke 87489cc
Only use cross-crossgen when crossbuilding
agocke 9fa5a66
Typo
agocke 6529d3e
crossgen-corelib should prefer ILC'd crossgen
agocke 7299cd1
Always build and use crossgen2_inbuild
agocke b78ace9
Keep apphost skip
agocke 549a505
Use inbuild for runtime pack
agocke 57aa6cd
Skip armel and riscv64
agocke db94fc6
PR comments
agocke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<Project> | ||
<!-- Settings for tools that publish as AOT --> | ||
|
||
<PropertyGroup Condition="'$(AotOrSingleFile)' == 'true' and '$(UseNativeAotForComponents)' == 'true'"> | ||
<PublishAot>true</PublishAot> | ||
<!-- Use .dwarf files instead of .dsym files since our symbol exporting may not safely handle folders. --> | ||
<NativeSymbolExt Condition="'$(_IsApplePlatform)' == 'true'">.dwarf</NativeSymbolExt> | ||
<DsymUtilOptions Condition="'$(_IsApplePlatform)' == 'true'">--flat</DsymUtilOptions> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(AotOrSingleFile)' == 'true' and '$(UseNativeAotForComponents)' != 'true'"> | ||
<PublishSingleFile>true</PublishSingleFile> | ||
<PublishReadyToRun>true</PublishReadyToRun> | ||
<!-- Disable crossgen on NetBSD, illumos, Solaris, and Haiku for now. This can be revisited when we have full support. --> | ||
<PublishReadyToRun Condition="'$(TargetOS)' == 'netbsd' Or '$(TargetOS)' == 'illumos' Or '$(TargetOS)' == 'solaris' Or '$(TargetOS)' == 'haiku'">false</PublishReadyToRun> | ||
<!-- Disable crossgen on FreeBSD when cross building from Linux. --> | ||
<PublishReadyToRun Condition="'$(TargetOS)' == 'freebsd' and '$(CrossBuild)' == 'true'">false</PublishReadyToRun> | ||
<PublishReadyToRunComposite>$(PublishReadyToRun)</PublishReadyToRunComposite> | ||
</PropertyGroup> | ||
|
||
<!-- Allow overriding the LKG ILCompiler package with a specific version. --> | ||
<PropertyGroup Condition="'$(UseNativeAotForComponents)' == 'true' and '$(PublishAot)' == 'true' and '$(MicrosoftDotNetILCompilerVersion)' != ''"> | ||
<SuppressGenerateILCompilerExplicitPackageReferenceWarning>true</SuppressGenerateILCompilerExplicitPackageReferenceWarning> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition="'$(UseNativeAotForComponents)' == 'true' and '$(PublishAot)' == 'true' and '$(MicrosoftDotNetILCompilerVersion)' != ''"> | ||
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="$(MicrosoftDotNetILCompilerVersion)" /> | ||
<PackageReference Include="runtime.$(ToolsRID).Microsoft.DotNet.ILCompiler" Version="$(MicrosoftDotNetILCompilerVersion)" /> | ||
</ItemGroup> | ||
|
||
<!-- Needed for the amd64 -> amd64 musl cross-build to pass the target flag. --> | ||
<Target Name="_FixIlcTargetTriple" | ||
AfterTargets="SetupOSSpecificProps" | ||
Condition="'$(CrossBuild)' == 'true' and '$(HostOS)' != 'windows'"> | ||
<!-- Compute CrossCompileRid, and copy the downstream logic as-is. --> | ||
<PropertyGroup> | ||
<CrossCompileRid>$(RuntimeIdentifier)</CrossCompileRid> | ||
|
||
<CrossCompileArch /> | ||
<CrossCompileArch Condition="$(CrossCompileRid.EndsWith('-x64'))">x86_64</CrossCompileArch> | ||
<CrossCompileArch Condition="$(CrossCompileRid.EndsWith('-arm64')) and '$(_IsApplePlatform)' != 'true'">aarch64</CrossCompileArch> | ||
<CrossCompileArch Condition="$(CrossCompileRid.EndsWith('-arm64')) and '$(_IsApplePlatform)' == 'true'">arm64</CrossCompileArch> | ||
|
||
<TargetTriple /> | ||
<TargetTriple Condition="'$(CrossCompileArch)' != ''">$(CrossCompileArch)-linux-gnu</TargetTriple> | ||
<TargetTriple Condition="'$(CrossCompileArch)' != '' and ($(CrossCompileRid.StartsWith('linux-musl')) or $(CrossCompileRid.StartsWith('alpine')))">$(CrossCompileArch)-alpine-linux-musl</TargetTriple> | ||
<TargetTriple Condition="'$(CrossCompileArch)' != '' and ($(CrossCompileRid.StartsWith('freebsd')))">$(CrossCompileArch)-unknown-freebsd12</TargetTriple> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<LinkerArg Include="--target=$(TargetTriple)" Condition="'$(TargetOS)' != 'osx' and '$(TargetTriple)' != ''" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<ItemGroup Condition="'$(NativeAotSupported)' == 'true'"> | ||
<CustomLinkerArg Condition="'$(CrossBuild)' == 'true' and '$(_hostArchitecture)' == '$(_targetArchitecture)' and '$(_hostOS)' != 'windows'" Include="--gcc-toolchain=$(ROOTFS_DIR)/usr" /> | ||
</ItemGroup> | ||
|
||
<Target Name="LocateNativeCompiler" | ||
Condition="'$(UseNativeAotForComponents)' == 'true' and '$(HostOS)' != 'windows'" | ||
BeforeTargets="SetupOSSpecificProps"> | ||
<PropertyGroup> | ||
<CppCompilerAndLinker Condition="'$(CppCompilerAndLinker)' == ''">clang</CppCompilerAndLinker> | ||
</PropertyGroup> | ||
|
||
<Exec Command="sh -c 'build_arch="$(TargetArchitecture)" compiler="$(CppCompilerAndLinker)" . "$(RepositoryEngineeringDir)/common/native/init-compiler.sh" && echo "$CC;$LDFLAGS"' 2>/dev/null" | ||
EchoOff="true" | ||
ConsoleToMsBuild="true" | ||
StandardOutputImportance="Low"> | ||
<Output TaskParameter="ConsoleOutput" PropertyName="_CC_LDFLAGS" /> | ||
</Exec> | ||
|
||
<PropertyGroup> | ||
<CppLinker>$(_CC_LDFLAGS.SubString(0, $(_CC_LDFLAGS.IndexOf(';'))))</CppLinker> | ||
<_LDFLAGS>$(_CC_LDFLAGS.SubString($([MSBuild]::Add($(_CC_LDFLAGS.IndexOf(';')), 1))))</_LDFLAGS> | ||
<LinkerFlavor Condition="$(_LDFLAGS.Contains('lld'))">lld</LinkerFlavor> | ||
</PropertyGroup> | ||
</Target> | ||
|
||
<!-- Cross-build settings --> | ||
<PropertyGroup> | ||
<LinkerFlavor Condition="'$(CrossBuild)' == 'true' and '$(TargetsLinux)' == 'true'">lld</LinkerFlavor> | ||
<SysRoot Condition="'$(CrossBuild)' == 'true' and '$(HostOS)' != 'windows'">$(ROOTFS_DIR)</SysRoot> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The comment is a bit misleading. Here the problem is not about target not supporting the self-contained, but rather we don't have community-supported platforms' SDK and LKG
Microsoft.NETCore.App.Runtime.linux-{platform}
in our CI, i.e.riscv64
,loongarch64
,freebsd-{x64,arm64}
,illumos-x64
etc.Also, armel should use arm (via
ToolsRID
) perruntime/src/coreclr/tools/Common/CommandLineHelpers.cs
Line 109 in 0ead293
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.
Since this is going to break other community platforms, maybe we should either exclude all community platforms (
Condition=<all official platforms>
) or keep them using the live build.Alternatively, we can simplify the relevant parts of the infrastructure and allow community platforms to provide their hook into the install script (dotnet/install-scripts#501). This way, we won't need to keep track of the distinction between community and official versions throughout the process. For example, switching to the LKG version will be straightforward, with no exceptions; since any "bring-your-own-platform-SDK" issues would have been resolved earlier in the infra bring-up work for that platform.
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 think this should be solved by the proposed two-phase build, but I'm not quite sure of the set up right now.
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.
Honestly, the easiest way to fix this is to just require that community builds publish a runtime pack in their LKG toolset. If their local SDK contains a
freebsd-x64
runtime pack, it will be used during the build.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.
Yes, something like that.
FreeBSD folks already have their own nuget feed https://github.com/Thefrank/dotnet-freebsd-crossbuild?tab=readme-ov-file#how-do-i-use-the-output. We just need to make a templated / example maybe using https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry, and then integrate it with source-build. The first round of port is bit patchy (check the current haiku or old illumos PRs), after that round, things get pretty smooth. We can let them provide their nuget feed and where to download the sdk tar.gz via install script.
My point was that this distinction of "official" vs. "community" is not necessary to sprinkle around the infra if we think about it. It is just an entry in pipeline matrix for machine building the signed release and a note in doc.
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.
If the CI builds for community targets were to take dependency on this, new LKG packages for community targets would have to be published in lock step with the Microsoft published ones. I do not think we want to be dealing with this moving part during LKG updates.
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 think there are options like this:
@dotnet-community-bot build LKG <version>
and it will trigger the same job which publishes for a given OfficialBuildId.