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

Use live apphost build in crossgen2 #66866

Closed
am11 opened this issue Mar 18, 2022 · 4 comments
Closed

Use live apphost build in crossgen2 #66866

am11 opened this issue Mar 18, 2022 · 4 comments

Comments

@am11
Copy link
Member

am11 commented Mar 18, 2022

CG2 sets AppHostRuntimeIdentifier which tells SDK to use specific platform apphost from prebuilt NuGet packages.

<AppHostRuntimeIdentifier>$(Crossgen2PackageRID)</AppHostRuntimeIdentifier>

The non-MSFT package maintainers have option to build custom apphost package and push it to their nuget feed (e.g. local file system or organization nuget server), then add that feed in NuGet.config to use the custom apphost.
<!--

On community-supported platforms, such as FreeBSD, similar approach is used to build CG2 binary (since there is no microsoft.netcore.app.crossgen2.freebsd-x64.<version>.nupkg availabe in runtime's official nuget feed). However, when cross-compiling CG2 on FreeBSD in CI, we have disabled CG2 because we don't use multi-stage build (i.e. first build apphost, publish it to local nuget feed, then build the product with that apphost).

Therefore, if we use live-build of apphost in CG2 build, at least on community platforms; similar to what was done for testhost:

<UseLiveBuiltDotNetHost Condition="'$(TargetArchitecture)' == 's390x' or '$(TargetArchitecture)' == 'armv6'">true</UseLiveBuiltDotNetHost>

we can avoid the multi-stage build overhead and bring community platforms on the same plan as the official ones (as far as CG2 is concerned).

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Mar 18, 2022
@ghost
Copy link

ghost commented Mar 18, 2022

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

Issue Details

CG2 sets AppHostRuntimeIdentifier which tells SDK to use specific platform apphost from prebuilt NuGet packages.

<AppHostRuntimeIdentifier>$(Crossgen2PackageRID)</AppHostRuntimeIdentifier>

The non-MSFT package maintainers have option to build custom apphost package and push it to their nuget feed (e.g. local file system or organization nuget server), then add that feed in NuGet.config to use the custom apphost.
<!--

On community-supported platforms, such as FreeBSD, similar approach is used to build CG2 binary (since there is no microsoft.netcore.app.crossgen2.freebsd-x64.<version>.nupkg availabe in runtime's official nuget feed). However, when cross-compiling CG2 on FreeBSD in CI, we have disabled CG2 because we don't use multi-stage build (i.e. first build apphost, publish it to local nuget feed, then build the product with that apphost).

Therefore, if we use live-build of apphost in CG2 build, at least on community platforms; similar to what was done for testhost:

<UseLiveBuiltDotNetHost Condition="'$(TargetArchitecture)' == 's390x' or '$(TargetArchitecture)' == 'armv6'">true</UseLiveBuiltDotNetHost>

we can avoid the multi-stage build overhead and bring community platforms on the same plan as the official ones (as far as CG2 is concerned).

Author: am11
Assignees: -
Labels:

area-Infrastructure-coreclr

Milestone: -

@MichalStrehovsky
Copy link
Member

bring community platforms on the same plan as the official ones (as far as CG2 is concerned).

Just a note that the north star is to build crossgen2 with NativeAOT: #65948 is already enabling this for some platforms. No apphost needed for NativeAOT.

@am11
Copy link
Member Author

am11 commented Mar 20, 2022

Great! Looks like even for platforms which currently do not support NativeAOT, with #65948 crossgen2 will be published as a self-contained, single file, application with live corehost which will essentially fix this issue.

@agocke
Copy link
Member

agocke commented Jun 16, 2022

I believe this is fixed now

@agocke agocke closed this as completed Jun 16, 2022
@agocke agocke moved this to Done in Runtime Infra Jun 16, 2022
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jun 16, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jul 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

3 participants