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

Is it expected that the host.native subset fails on a fresh build (when the single file host isn't yet built)? #79144

Closed
ViktorHofer opened this issue Dec 2, 2022 · 8 comments · Fixed by #79565

Comments

@ViktorHofer
Copy link
Member

ViktorHofer commented Dec 2, 2022

The NativeAOT libraries linker tests don't require the singlefilehost but the apphost but building the host.native fails if the single file host isn't yet built. Is that intentional? If the singlefilehost is a strong dependency to build host.native then we should update the Subset description to indicate that.

cc @agocke @sbomer

C:\git\runtime2>build.cmd host.native -c Release
  Determining projects to restore...
  Tool 'coverlet.console' (version '3.1.2') was restored. Available commands: coverlet
  Tool 'dotnet-reportgenerator-globaltool' (version '5.0.2') was restored. Available commands: reportgenerator
  Tool 'microsoft.dotnet.xharness.cli' (version '1.0.0-prerelease.22566.1') was restored. Available commands: xharness
  Tool 'microsoft.visualstudio.slngen.tool' (version '8.5.17') was restored. Available commands: slngen
  Tool 'dotnet-format' (version '6.0.240501') was restored. Available commands: dotnet-format

  Restore was successful.
  All projects are up-to-date for restore.
  Determining projects to restore...
  All projects are up-to-date for restore.
  InjectResource -> C:\git\runtime2\artifacts\bin\coreclr\windows.x64.Release\InjectResource\InjectResource.dll
C:\git\runtime2\src\native\corehost\corehost.proj(48,5): error MSB3030: Could not copy the file "C:\git\runtime2\artifacts\bin\coreclr\windows.x64.Release\/corehost/si
nglefilehost.exe" because it was not found.
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Dec 2, 2022
@ghost
Copy link

ghost commented Dec 2, 2022

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

Issue Details

cc @agocke @sbomer

C:\git\runtime2>build.cmd host.native -c Release
  Determining projects to restore...
  Tool 'coverlet.console' (version '3.1.2') was restored. Available commands: coverlet
  Tool 'dotnet-reportgenerator-globaltool' (version '5.0.2') was restored. Available commands: reportgenerator
  Tool 'microsoft.dotnet.xharness.cli' (version '1.0.0-prerelease.22566.1') was restored. Available commands: xharness
  Tool 'microsoft.visualstudio.slngen.tool' (version '8.5.17') was restored. Available commands: slngen
  Tool 'dotnet-format' (version '6.0.240501') was restored. Available commands: dotnet-format

  Restore was successful.
  All projects are up-to-date for restore.
  Determining projects to restore...
  All projects are up-to-date for restore.
  InjectResource -> C:\git\runtime2\artifacts\bin\coreclr\windows.x64.Release\InjectResource\InjectResource.dll
C:\git\runtime2\src\native\corehost\corehost.proj(48,5): error MSB3030: Could not copy the file "C:\git\runtime2\artifacts\bin\coreclr\windows.x64.Release\/corehost/si
nglefilehost.exe" because it was not found.
Author: ViktorHofer
Assignees: -
Labels:

area-Infrastructure-coreclr

Milestone: -

@jkoritzinsky
Copy link
Member

The singlefilehost.exe file gets copied to the correct output directory and gets the (signed) DAC injected as a resource as part of the host.native build.

@ViktorHofer
Copy link
Member Author

ViktorHofer commented Dec 3, 2022

That explains the current state and what the project is responsible for. What I'm interested in knowing is, how can we build just the apphost (ie for the linker nativeaot tests) without requiring the singlefilehost and the runtime to be built?

EDIT: DNNE (invoked in NativeExports.csproj) is another component that uses the apphost but doesn't require the singlefilehost.

@agocke
Copy link
Member

agocke commented Dec 5, 2022

I think that the single file host is now a requirement. I believe host.native also includes hostpolicy and hostfxr, and those are now built with the runtime, since the singlefilehost now builds directly with the runtime.

@jkoritzinsky
Copy link
Member

The hostpolicy and hostfxr code is built twice, once as a static lib with the CoreCLR build for singlefilehost, and once in the host.native build for the shared libraries.

@ViktorHofer
Copy link
Member Author

Bringing this up again. Can we change the host.native subset (or to be more precise, corehost.proj) so that we can just build the apphost without the singlefilehost? The NativeAOT libraries tests don't need any of the clr.runtime stuff, so not building that would be preferred.

Presumably, the NativeAOT libraries tests don't even need the apphost but that's currently a requirement in the SDK (when building SelfContained, the UseAppHost switch must be true).

@agocke
Copy link
Member

agocke commented Dec 12, 2022

Can we change the host.native subset (or to be more precise, corehost.proj) so that we can just build the apphost without the singlefilehost?

If the current dependency is artificial then I’m supportive.

The NativeAOT libraries tests don't need any of the clr.runtime stuff

They’ll need the JIT. Not sure if there’s different subset for that.

@ViktorHofer
Copy link
Member Author

Yes there is clr.alljits which nativeaot already uses:

<DefaultNativeAotSubsets>clr.alljits+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime</DefaultNativeAotSubsets>

@agocke agocke added this to the 8.0.0 milestone Dec 12, 2022
@agocke agocke removed the untriaged New issue has not been triaged by the area owner label Dec 12, 2022
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Dec 12, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Dec 13, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jan 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants