runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Publish hostcommon static library

Open rseanhall opened this issue 2 years ago • 5 comments

The hostfxr static library can't be used without this.

rseanhall avatar Sep 19 '22 20:09 rseanhall

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

Issue Details

The hostfxr static library can't be used without this.

Author: rseanhall
Assignees: -
Labels:

area-Host

Milestone: -

ghost avatar Sep 19 '22 20:09 ghost

I don't know if there's anything that can be done with the build process, but it was harder than I would like to build this change. All I wanted was to build the Microsoft.NETCore.DotNetAppHost packages so I tried to run build -subset host. This failed with:

  InjectResource -> C:\src\dotnet-runtime\artifacts\bin\coreclr\windows.x64.Debug\InjectResource\InjectResource.dll
C:\src\dotnet-runtime\src\native\corehost\corehost.proj(48,5): error MSB3030: Could not copy the file "C:\src\dotnet-ru
ntime\artifacts\bin\coreclr\windows.x64.Debug\/corehost/singlefilehost.exe" because it was not found.

I ended up copying a dummy singlefilehost.exe into the right place and disabling the PrepareSingleFileHostWithEmbeddedDac target because I didn't want to build anything else.

rseanhall avatar Sep 19 '22 20:09 rseanhall

Microsoft.NETCore.DotNetAppHost package is bundled into the SDK and installed under c:\Program Files\dotnet\packs\Microsoft.NETCore.App.Host.win-x64. We are adding more stuff to it for niche scenarios that do not look like a good fit for default .NET SDK download.

Do we need to rethink the package structure?

jkotas avatar Sep 19 '22 22:09 jkotas

@jkotas That is not what I see. I added libhostfxr.lib to the package in .NET 6 and I don't see that file in the path you provided for .NET 6.0.8 or .NET 7 RC1.

Sometime later, the code was refactored and parts of hostfxr were moved into the hostcommon static lib. This is just adding the missing code. I would be fine with a custom host package, but it seems like changing the distribution of these assets seems to be low priority for everyone.

rseanhall avatar Sep 20 '22 14:09 rseanhall

@jkotas That is not what I see. I added libhostfxr.lib to the package in .NET 6 and I don't see that file in the path you provided for .NET 6.0.8 or .NET 7 RC1.

Ok, I got confused by the two very similar packages with overlapping content: Microsoft.NETCore.App.Host (bundled into SDK) and Microsoft.NETCore.DotNetAppHost (not bundled into SDK). This change is only adding this to Microsoft.NETCore.DotNetAppHost so my concern about SDK download size is moot.

@vitek-karas For my education: Why do have so much stuff in the package that is bundled into the SDK - how are we deciding what should go into each of these two package?

jkotas avatar Sep 20 '22 15:09 jkotas

BTW: A solution that was implemented in https://github.com/dotnet/runtime/pull/72896 for similar problem was to ship the relevant C/C++ sources in the nuget package. I expect we will prefer shipping C/C++ sources for these situations going forward. It avoids the problems with fragility of C/C++ .libs and compiler settings.

jkotas avatar Sep 20 '22 17:09 jkotas

runtime (Build Build OSX x64 release NativeAOT) failure
Building tests via "/Users/runner/work/1/s/eng/common/msbuild.sh"  --warnAsError false /Users/runner/work/1/s/src/tests/build.proj /t:TestBuild /p:TargetArchitecture=x64 /p:Configuration=Release /p:TargetOS=OSX /nodeReuse:false    /maxcpucount "/flp:Verbosity=normal;LogFile=/Users/runner/work/1/s/artifacts/log/TestBuild.OSX.x64.Release.log" "/flp1:WarningsOnly;LogFile=/Users/runner/work/1/s/artifacts/log/TestBuild.OSX.x64.Release.wrn" "/flp2:ErrorsOnly;LogFile=/Users/runner/work/1/s/artifacts/log/TestBuild.OSX.x64.Release.err" "/bl:/Users/runner/work/1/s/artifacts/log/TestBuild.OSX.x64.Release.binlog" /p:NUMBER_OF_PROCESSORS=4
/Users/runner/work/1/s/.dotnet/sdk/7.0.100-rc.1.22431.12/MSBuild.dll /nologo -maxcpucount /m /maxcpucount -verbosity:m /v:minimal /bl:/Users/runner/work/1/s/artifacts/log/TestBuild.OSX.x64.Release.binlog /clp:Summary /flp1:WarningsOnly;LogFile=/Users/runner/work/1/s/artifacts/log/TestBuild.OSX.x64.Release.wrn /flp2:ErrorsOnly;LogFile=/Users/runner/work/1/s/artifacts/log/TestBuild.OSX.x64.Release.err /flp:Verbosity=normal;LogFile=/Users/runner/work/1/s/artifacts/log/TestBuild.OSX.x64.Release.log /nr:true /nodeReuse:false /p:TreatWarningsAsErrors=false /p:ContinuousIntegrationBuild=false /p:TargetArchitecture=x64 /p:Configuration=Release /p:TargetOS=OSX /p:NUMBER_OF_PROCESSORS=4 /t:TestBuild /Users/runner/work/1/s/src/tests/build.proj
  [17:10:30.75] Restoring all packages...
    Determining projects to restore...
    Restored /Users/runner/work/1/s/src/tests/Common/test_dependencies_fs/test_dependencies.fsproj (in 30.52 sec).
    Determining projects to restore...
    Restored /Users/runner/work/1/s/src/tests/Common/test_dependencies/test_dependencies.csproj (in 10.14 sec).
/Users/runner/work/1/s/src/tests/build.proj(437,5): error MSB3073: The command ""/Users/runner/work/1/s/.dotnet/dotnet" restore -r osx-x64 Common/test_dependencies/test_dependencies.csproj  /p:SetTFMForRestore=true /p:TargetOS=OSX /p:TargetArchitecture=x64 /p:Configuration=Release /p:CrossBuild=" exited with code 1.

Build FAILED.

This is https://github.com/dotnet/runtime/issues/74328?

runtime (Build mono llvmfullaot Pri0 Runtime Tests Run Linux x64 release) failure
2022-10-10T17:37:44.1809505Z /__w/1/s/src/mono/msbuild/aot-compile.proj(19,9): error MSB3073: The command "/__w/1/s/artifacts/tests/coreclr/Linux.x64.Release/Tests/Core_Root/corerun /__w/1/s/artifacts/tests/coreclr/Linux.x64.Release/Tests/Core_Root/xunit.execution.dotnet.dll" exited with code 255.
2022-10-10T17:37:44.1810593Z BEGIN : coreclr_initialize failed - error : 0x80004005 [/__w/1/s/src/mono/msbuild/aot-compile.proj]
2022-10-10T17:37:44.1811488Z END : coreclr_initialize failed - error : 0x80004005 [/__w/1/s/src/mono/msbuild/aot-compile.proj]

I don't think this was caused by my change. If it were, I would expect the arm64 build to have failed as well.

rseanhall avatar Oct 11 '22 01:10 rseanhall

@vitek-karas @elinor-fung Any additional feedback?

jkotas avatar Oct 11 '22 02:10 jkotas

runtime (Build mono llvmfullaot Pri0 Runtime Tests Run Linux x64 release) failure

2022-10-10T17:37:44.1809505Z /__w/1/s/src/mono/msbuild/aot-compile.proj(19,9): error MSB3073: The command "/__w/1/s/artifacts/tests/coreclr/Linux.x64.Release/Tests/Core_Root/corerun /__w/1/s/artifacts/tests/coreclr/Linux.x64.Release/Tests/Core_Root/xunit.execution.dotnet.dll" exited with code 255.
2022-10-10T17:37:44.1810593Z BEGIN : coreclr_initialize failed - error : 0x80004005 [/__w/1/s/src/mono/msbuild/aot-compile.proj]
2022-10-10T17:37:44.1811488Z END : coreclr_initialize failed - error : 0x80004005 [/__w/1/s/src/mono/msbuild/aot-compile.proj]

I don't think this was caused by my change. If it were, I would expect the arm64 build to have failed as well.

I think this is https://github.com/dotnet/runtime/issues/72114.

elinor-fung avatar Oct 11 '22 05:10 elinor-fung