[release/5.0.1xx-preview4] Single-File: Fix GenerateBundle Task#11502
[release/5.0.1xx-preview4] Single-File: Fix GenerateBundle Task#11502swaroop-sridhar wants to merge 1 commit into
Conversation
…sing extraction Customer Scenario Self-contained Apps published as a single-file fail at run-time. Problem Single-file bundles are now processed in the framework rather than the apphost (dotnet/runtime#34274). This means that hostpolicy and hostfxr DLLs are excluded from being bundled themselves. In the case of self-contained single-file apps, these files need to be separate files until static-apphost is available. This needs to be ensured by the SDK; otherwise app execution will fail. Solution This change fixes the problem by adapting the SDK to: * Pass the correct target-OS settings (otherwise cross-targetting builds will not work correctly) * Copy files excluded by the Bundler to the publish directory. The stage-0 netcoreapp is updated to preview4, because preview2 apphost is not compatible with preview4 bundler. Risk Low
dsplaisted
left a comment
There was a problem hiding this comment.
Did we have no coverage for running single file apps before this? Once this is inserted into dotnet/installer, I think we should add these new tests to the integration tests that are run there.
Also, if hostpolicy and hostfxr are no longer part of the bundle, does this mean that "single file apps" are now a minimum of 3 files?
|
|
||
| protected override void ExecuteCore() | ||
| { | ||
| OSPlatform targetOS = RuntimeIdentifier.StartsWith("win") ? OSPlatform.Windows : |
There was a problem hiding this comment.
Should this be walking the RuntimeIdentifier graph instead of checking what the RuntimeIdentifier starts with?
Yes HostPolicy and HostFxr need to be separate files temporarily, until the work to link these components into the apphost (dotnet/runtime#35368) and consume them from the SDK is completed.
Tests to run single-file apps are in the runtime repo, while the ones here were testing publishing, checking the files generated, etc. But this is not sufficient coverage. I'll follow up on the integration changes. |
|
@dsplaisted I'll close this PR, because it was preferred to revert the original change that processes bundles from framework. I'll open a new PR to make this change in master branch, |
Customer Scenario
Self-contained Apps published as a single-file fail at run-time.
Problem
Single-file bundles are now processed in the framework rather than the apphost (dotnet/runtime#34274).
This means that hostpolicy and hostfxr DLLs are excluded from being bundled themselves.
In the case of self-contained single-file apps, these files need to be separate files until static-apphost is available.
This needs to be ensured by the SDK; otherwise app execution will fail.
Solution
This change fixes the problem by adapting the SDK to:
The stage-0 netcoreapp is updated to preview4, because preview2 apphost is not compatible with preview4 bundler.
Risk
Low
Alternatives
The alternative to taking this change in preview 4 is to revert the bundle processing change from runtime preview 4 branch.
This fix can then be performed in master branch.