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

Single-File: Move bundle-processing code into the framework #32821

Closed
swaroop-sridhar opened this issue Feb 25, 2020 · 0 comments · Fixed by #34274
Closed

Single-File: Move bundle-processing code into the framework #32821

swaroop-sridhar opened this issue Feb 25, 2020 · 0 comments · Fixed by #34274
Assignees
Milestone

Comments

@swaroop-sridhar
Copy link
Contributor

swaroop-sridhar commented Feb 25, 2020

Implement bundle-processing as described in:
https://github.com/dotnet/designs/blob/master/accepted/2020/single-file/design.md#startup

@swaroop-sridhar swaroop-sridhar added this to the 5.0 milestone Feb 25, 2020
@swaroop-sridhar swaroop-sridhar self-assigned this Feb 25, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Feb 25, 2020
@swaroop-sridhar swaroop-sridhar removed the untriaged New issue has not been triaged by the area owner label Feb 28, 2020
swaroop-sridhar added a commit to swaroop-sridhar/runtime that referenced this issue Apr 4, 2020
This change implements the host changes proposed in the [design](https://github.com/dotnet/designs/blob/master/accepted/2020/single-file/design.md#startup)

The main changes for single-file bundles are:
* Bundle processing code is moved from apphost to hostpolicy
* HostFxr and HostPolicy process deps.json and runtimeconfig.json files directly from the bundle.
* HostPolicy performs verification wrt deps.json based on the contents of the single-file bundle.
* AppContext.BaseDirectory is set as explained [here](https://github.com/dotnet/designs/blob/master/accepted/2020/single-file/design.md#appcontextbasedirectory)

Currently, all files except deps.json and runtimeconfig.json are extracted to disk.
Once the runtime is able to processing assemblies directly from the bundle, they will no longer be extracted.

Notable details:
* The bundle driver (formarly runner.cpp) is divided into two parts:
   * bundle::info which describes basic information about the bundle available from the headers only
   * bundle::runner which has information about all embedded files, and the ability to drive extraction
  This facilitates linking only parts of the bundle handling code with hostfxr, while all code is linked with hostpolicy.
* The AppHost only links with bundle_marker to identify itself as a single-file bundle.
* If the AppHost is a single-file bundle, it notifies hostfxr using the new hostfxr_main_bundle_startup_info() API
* The HostFxr comminucates the single-file-information with HostPolicy using the host_interface_t structure.

Fixes dotnet#32821
swaroop-sridhar added a commit that referenced this issue Apr 8, 2020
* Single-File: Process bundles in the framework

This change implements the host changes proposed in the [design](https://github.com/dotnet/designs/blob/master/accepted/2020/single-file/design.md#startup)

The main changes for single-file bundles are:
* Bundle processing code is moved from apphost to hostpolicy
* HostFxr and HostPolicy process deps.json and runtimeconfig.json files directly from the bundle.
* HostPolicy performs verification wrt deps.json based on the contents of the single-file bundle.
* AppContext.BaseDirectory is set as explained [here](https://github.com/dotnet/designs/blob/master/accepted/2020/single-file/design.md#appcontextbasedirectory)

Currently, all files except deps.json and runtimeconfig.json are extracted to disk.
Once the runtime is able to processing assemblies directly from the bundle, they will no longer be extracted.

Notable details:
* The bundle driver (formarly runner.cpp) is divided into two parts:
   * bundle::info which describes basic information about the bundle available from the headers only
   * bundle::runner which has information about all embedded files, and the ability to drive extraction
  This facilitates linking only parts of the bundle handling code with hostfxr, while all code is linked with hostpolicy.
* The AppHost only links with bundle_marker to identify itself as a single-file bundle.
* If the AppHost is a single-file bundle, it notifies hostfxr using the new hostfxr_main_bundle_startup_info() API
* The HostFxr comminucates the single-file-information with HostPolicy using the host_interface_t structure.

Fixes #32821
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
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.

2 participants