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

Add Engineering Plan for Linux Distros #789

Merged
merged 2 commits into from Oct 24, 2018
Merged

Add Engineering Plan for Linux Distros #789

merged 2 commits into from Oct 24, 2018

Conversation

dseefeld
Copy link
Contributor

Add Engineering Plan for including .NET Core in Linux Distro Repositories

skip ci please

Add Engineering Plan for including .NET Core in Linux Distro Repositories

skip ci please
Each distro has specific packaging guidelines along with a well-defined review process. These guidelines are similar across distros, with one of the main guidelines being that the source provided contain no pre-built binaries. This is the biggest obstacle to getting .NET Core into distro archives. .NET Core is included in the Red Hat distro today even though the source-build process requires a large number of pre-builts in order to successfully build. Red Hat has given exceptions for us to be able to be included in their distro.

### Toolset for Building .NET Core ###
There is one exception to the *"no prebuilt binaries rule"* for the case of bootstrapping a toolset. This is an exception that .NET Core will need to take advantage of. This boostrap process is illustrated below. An exsting toolset is used to build a toolset from source. The existing toolset is then thrown away and the newly built toolset is used for the actual build of the assemblies that go into the archive. The source is the same for each stage of the build.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo - exsting

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also typo: boostrap

3. Prebuilts that have a version built with source-build - The source-build process should be modified to get repos to use the source-built version of the package. Many of these are older
4. Prebuilts containing reference assemblies - These prebuilts can be delivered as IL-only code and re-compiled as reference assemblies.
5. First party prebuilts - If there are dependencies on 1st party packages that are not built as part of source-build, we should investigate including them in source-build if possible or eliminating the dependency.
6. Third party prebuilts - Steps should be taken to remove any dependencies on 3rd party packages.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another possible way to deal with 5 and 6 is to package them up as separate (distro) packages. When building for a distro, it should be perfectly fine to use a dependency that's available in the distribution. This is the case for native code already (clang, lldb, lttng, openssl). Theoretically, we should be able to do the same with .NET packages as well. We could then have a dependency on the already built packages.

### Toolset for Building .NET Core ###
There is one exception to the *"no prebuilt binaries rule"* for the case of bootstrapping a toolset. This is an exception that .NET Core will need to take advantage of. This boostrap process is illustrated below. An exsting toolset is used to build a toolset from source. The existing toolset is then thrown away and the newly built toolset is used for the actual build of the assemblies that go into the archive. The source is the same for each stage of the build.

Toolset bootstrapping is different than runtime bootstapping provided in https://github.com/dotnet/source-build/blob/master/scripts/bootstrap/buildbootstrapcli.sh. This script is only needed when starting with a new distro on which .NET Core has never built. For the distros being discussed in this document, there are already existing .NET Core runtime and SDK builds available. For that reason, runtime bootstrapping is outside the scope of this document.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pin URL to commit to avoid 404 in case the sh script moves? Maybe shorten link like scripts/bootstrap/buildbootstrapcli.sh?

### Toolset for Building .NET Core ###
There is one exception to the *"no prebuilt binaries rule"* for the case of bootstrapping a toolset. This is an exception that .NET Core will need to take advantage of. This boostrap process is illustrated below. An exsting toolset is used to build a toolset from source. The existing toolset is then thrown away and the newly built toolset is used for the actual build of the assemblies that go into the archive. The source is the same for each stage of the build.

Toolset bootstrapping is different than runtime bootstapping provided in https://github.com/dotnet/source-build/blob/master/scripts/bootstrap/buildbootstrapcli.sh. This script is only needed when starting with a new distro on which .NET Core has never built. For the distros being discussed in this document, there are already existing .NET Core runtime and SDK builds available. For that reason, runtime bootstrapping is outside the scope of this document.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph doesn't feel like it's in the right place. The next paragraph picks up with "This is discussed in the Fedora packaging guidelines as an exception...", and at first I think "This" refers to runtime bootstrapping but after reading the full sentence it's referring to toolset boostrapping.

Maybe move this after the image, even put it in a block quote to distinguish it as a clarification?


### Runtime vs. SDK ###

In the requirements doc above, it is suggested that we *Reduce the problem space and get in the door. Deliver the runtime first.* The full toolset is required to build both the runtime and the SDK. Delivering runtime first doesn't necessarily reduce the problem space because of this requirement to create a bootstrap toolset, first.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider making the requirements doc a "reference-style link" so you can link it in both places without duplicating the github issue URL.


## Work Breakdown ##
With this partnership, there are four main area of focus to get .NET Core ready for inclusion into Fedora's package archive:
1. Prove out and define process for toolset bootstrapping.(https://github.com/dotnet/source-build/issues/724)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space in bootstrapping.(https

Source-build changes will be ported to `release/2.2` and `master` on a regular basis to keep those branches up to date. The desire is to have `release/2.2` and `master` updated and ready to be included in other distros when they are ready to be released.

### Toolset Bootstrapping ##
This work requires setting up scripts to build the .NET Core toolset from source and then using the result to build source-build. This is to define the process and to ensure that it works consistently by adding CI. It also will require working out issues that we've encountered building source-build with the same version that is being built. See https://github.com/dotnet/source-build/issues/606. This will also track work with source-building buildTools and the eventual move to Arcade, if it is ported to the `release/2.1` branch for any repos.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

source-building buildTools => source-building [dotnet/BuildTools](https://github.com/dotnet/buildtools)? (I included dotnet/ because there's an aspnet/buildtools too.)

Link for Arcade, too?

This work requires setting up scripts to build the .NET Core toolset from source and then using the result to build source-build. This is to define the process and to ensure that it works consistently by adding CI. It also will require working out issues that we've encountered building source-build with the same version that is being built. See https://github.com/dotnet/source-build/issues/606. This will also track work with source-building buildTools and the eventual move to Arcade, if it is ported to the `release/2.1` branch for any repos.

### Runtime / SDK Split ###
The main part of this work is to split and isolate the runtime and sdk builds into separate directories with separate build scripts in source-build. The result of the runtime build should be input to the sdk build. Each should be able to be built independently.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure separate directories is the best way to handle this, but I think this is just an implementation detail. Maybe leave that specific bit out from this doc and link to an issue here?

### Prebuilt Binary Elimination ###

There are 6 categories of prebuilts to eliminate:
1. Prebuilts that end up in the built product. - These must be eliminated and a process must be put into place to detect and track these to make sure they don't happen again.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this list would be easier to read if the subpoints were put into nested bullets, or the category name bolded:

  1. Prebuilts that end up in the built product.
    • These must be eliminated and a process must be put into place to detect and track these to make sure they don't happen again.
  2. Prebuilts loaded in unneccessary functionality
    • These are prebuilts that are loaded by a repo's source even though the functionality for the source is not included in source-build. The main group of these are test assemblies, since source-build does not build tests.
  3. Prebuilts that have a version built with source-build
    • The source-build process should be modified to get repos to use the source-built version of the package. Many of these are older

There are 6 categories of prebuilts to eliminate:
1. Prebuilts that end up in the built product. - These must be eliminated and a process must be put into place to detect and track these to make sure they don't happen again.
2. Prebuilts loaded in unneccessary functionality - These are prebuilts that are loaded by a repo's source even though the functionality for the source is not included in source-build. The main group of these are test assemblies, since source-build does not build tests.
3. Prebuilts that have a version built with source-build - The source-build process should be modified to get repos to use the source-built version of the package. Many of these are older
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing period, or incomplete sentence? "Many of these are older"

1. Prebuilts that end up in the built product. - These must be eliminated and a process must be put into place to detect and track these to make sure they don't happen again.
2. Prebuilts loaded in unneccessary functionality - These are prebuilts that are loaded by a repo's source even though the functionality for the source is not included in source-build. The main group of these are test assemblies, since source-build does not build tests.
3. Prebuilts that have a version built with source-build - The source-build process should be modified to get repos to use the source-built version of the package. Many of these are older
4. Prebuilts containing reference assemblies - These prebuilts can be delivered as IL-only code and re-compiled as reference assemblies.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prebuilts containing only reference assemblies?

* Be visible and accessible to source-build team members, partners and management.
* Identify the category of prebuilt, if possible.

### Coordidinate with DotNet SIG ###
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "Coordidinate" => "Coordinate"

@dseefeld dseefeld merged commit 7d2031a into master Oct 24, 2018
@dseefeld dseefeld deleted the AddDistroReposDoc branch October 24, 2018 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants