GithubHelp home page GithubHelp logo

shushanhf / source-build Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dotnet/source-build

0.0 0.0 0.0 7.69 MB

A repository to track efforts to produce a source tarball of the .NET Core SDK and all its components

License: MIT License

source-build's Introduction

.NET Source-Build

Join the chat at https://gitter.im/dotnet/source-build

This repo is the starting point for building .NET 6 from source. Instructions for building other .NET versions are provided near the end of this document.

Prerequisites

The dependencies for building .NET 6.0 from source can be found here.

Building

.NET 6.0 is built from source using the dotnet/installer repo. The steps to build vary slightly depending on your distro. The following set of instructions walk through how to build on Fedora 33.

  1. Clone the repo and check out the tag for the desired release.

    git clone https://github.com/dotnet/installer
    cd installer/
    git switch -c v6.0.100 v6.0.100
  2. Create a .NET source tarball.

    ./build.sh /p:ArcadeBuildTarball=true /p:TarballDir=/path/to/place/complete/dotnet/sources

    This fetches the complete .NET source code and creates a tarball at artifacts/packages/<Release|Debug>/Shipping/. The extracted source code is also placed at /path/to/place/complete/dotnet/sources. The source directory should be outside (and not somewhere under) the installer directory.

  3. Prep the source to build on your distro.

    cd /path/to/complete/dotnet/sources
    ./prep.sh

    This downloads a .NET SDK and a number of .NET packages needed to build .NET from source.

    On Linux distros other than Fedora 33, an additional bootstrapping step is required. After running prep.sh above, run the following:

    mkdir ./privateSourceBuiltArtifacts
    cd ./privateSourceBuiltArtifacts
    tar xf ../packages/archive/Private.SourceBuilt.Artifacts.*.tar.gz
    sed -i -E 's|<MicrosoftNETHostModelPackageVersion>6.0.0-rtm.21521.1</|<MicrosoftNETHostModelPackageVersion>6.0.0-rtm.21521.4</|' PackageVersions.props
    sed -i -E 's|<MicrosoftNETHostModelVersion>6.0.0-rtm.21521.1</|<MicrosoftNETHostModelVersion>6.0.0-rtm.21521.4</|' PackageVersions.props
    tar czf ../packages/archive/Private.SourceBuilt.Artifacts.*.tar.gz *
    cd ..
    rm -r ./privateSourceBuiltArtifacts
    ./prep.sh --bootstrap

    This issue is being tracked here.

  4. Build the .NET SDK

    ./build.sh

    This builds the entire .NET SDK from source. The resulting SDK is placed at artifacts/x64/Release/dotnet-sdk-6.0.100-fedora.33-x64.tar.gz.

  5. (Optional) Unpack and install the .NET SDK

    mkdir -p $HOME/dotnet
    tar zxf artifacts/x64/Release/dotnet-sdk-6.0.100-fedora.33-x64.tar.gz -C $HOME/dotnet
    ln -s $HOME/dotnet/dotnet /usr/bin/dotnet

    To test your source-built SDK, run the following:

    dotnet --info

.NET 5.0 and .NET Core 3.1

To build older versions of the .NET SDK from source, pick a specific Git tag with your desired version, or use a release branch to build the latest servicing release of that version. Refer to the tag/branch's README for build instructions:

The source-build repository doesn't currently support Windows. See source-build#1190.

Source-build goals

The key goal of source-build is to satisfy the official packaging rules of commonly used Linux distributions, such as Fedora and Debian. Many Linux distributions have similar rules. These rules tend to have two main principles: consistent reproducibility, and source code for everything.

A secondary goal of source-build is to allow .NET contributors to build a .NET SDK with coordinated changes in multiple repositories. However, the developer experience is significantly better in individual repositories and, if possible, contributors should make and test changes in the target repo, not source-build.

What does the source-build infrastructure do?

Source-build solves common challenges that most developers encounter when trying to build the whole .NET SDK from source.

  • .NET is composed of many repositories that need to be built at a specific combination of commits.
  • Each repository's build output needs to flow into the next repository's build.
  • By default, most .NET repositories download prebuilt binary dependencies from online sources. These are forbidden by typical Linux distribution rules, and interfere with build output flow.
  • Nearly all .NET repositories require the .NET SDK to build. This is a circular dependency, which presents a bootstrapping problem.

Starting with .NET 6, the core source-build infrastructure is integrated into the dotnet/installer repo. The main branch on this repo now contains the tooling needed to build .NET's external dependencies from source.

License

This repo is licensed under the MIT license.

source-build's People

Contributors

dagood avatar crummel avatar dseefeld avatar dotnet-maestro[bot] avatar ellismg avatar michaelsimons avatar weshaggard avatar eerhardt avatar karajas avatar chcosta avatar adaggarwal avatar nikolamilosavljevic avatar omajid avatar dotnet-bot avatar safern avatar tmds avatar dotnet-maestro-bot avatar janvorli avatar nguerrera avatar jaredpar avatar lbussell avatar am11 avatar brettfo avatar leecow avatar mmitche avatar sdmaclea avatar tannergooding avatar wfurt avatar tmat avatar trevorgrayson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.