From f7c07844d126e95cde90d50c864228a11efa4ff3 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Wed, 10 Feb 2021 11:34:39 -0500 Subject: [PATCH] WIP: Enable source-build through arcade This enables 'source-build', which makes it easier to build the entire shipping .NET SDK from source. This is the first and second step of arcade-powered-source-build: https://github.com/dotnet/source-build/blob/master/Documentation/planning/arcade-powered-source-build/README.md See dotnet/sourcelink#692 for a similar PR, that this is based on. The `LICENSE` to `LICENSE.txt` rename is hack to work around https://github.com/NuGet/Home/issues/7601 for now. --- LICENSE => LICENSE.txt | 0 build.cmd | 2 +- build.sh | 2 +- eng/Build.props | 17 +++++++++++++++++ eng/SourceBuild.props | 8 ++++++++ eng/SourceBuildPrebuiltBaseline.xml | 5 +++++ eng/Version.Details.xml | 9 +++++++++ eng/azure-pipelines.yml | 17 +++++++++++++++++ src/linker/Mono.Linker.csproj | 2 ++ 9 files changed, 60 insertions(+), 2 deletions(-) rename LICENSE => LICENSE.txt (100%) create mode 100644 eng/Build.props create mode 100644 eng/SourceBuild.props create mode 100644 eng/SourceBuildPrebuiltBaseline.xml diff --git a/LICENSE b/LICENSE.txt similarity index 100% rename from LICENSE rename to LICENSE.txt diff --git a/build.cmd b/build.cmd index e21182c8ad77..675fdf83f6a0 100644 --- a/build.cmd +++ b/build.cmd @@ -1,2 +1,2 @@ @echo off -powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -projects """%~dp0illink.sln""" -restore -build %*" +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -restore -build %*" diff --git a/build.sh b/build.sh index 228566129d25..8477d5af8817 100755 --- a/build.sh +++ b/build.sh @@ -13,4 +13,4 @@ while [[ -h $source ]]; do done scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" -"$scriptroot/eng/common/build.sh" --projects "$scriptroot/illink.sln" --build --restore $@ +"$scriptroot/eng/common/build.sh" --build --restore $@ diff --git a/eng/Build.props b/eng/Build.props new file mode 100644 index 000000000000..737c13e43e44 --- /dev/null +++ b/eng/Build.props @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props new file mode 100644 index 000000000000..80661de2fec1 --- /dev/null +++ b/eng/SourceBuild.props @@ -0,0 +1,8 @@ + + + + linker + true + + + diff --git a/eng/SourceBuildPrebuiltBaseline.xml b/eng/SourceBuildPrebuiltBaseline.xml new file mode 100644 index 000000000000..c1b6dfbf0538 --- /dev/null +++ b/eng/SourceBuildPrebuiltBaseline.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 51e27c78ee70..c4f857a66e37 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -6,14 +6,23 @@ https://github.com/dotnet/arcade fc83e59329203724d4a63c4f6c843be62983a35e + https://github.com/dotnet/arcade fc83e59329203724d4a63c4f6c843be62983a35e + https://github.com/dotnet/runtime a66b4e3bf5e3c5ecb2e9fba771f69b177bd3844e + diff --git a/eng/azure-pipelines.yml b/eng/azure-pipelines.yml index 43b625e1cb58..6fdbb8f08c89 100644 --- a/eng/azure-pipelines.yml +++ b/eng/azure-pipelines.yml @@ -44,6 +44,8 @@ stages: testResultsFormat: vstest enablePublishBuildAssets: true # generate build manifests and publish to BAR in internal builds enableMicrobuild: true # only affects internal builds + # See https://github.com/dotnet/source-build/issues/2049 + # enableSourceBuild: true jobs: @@ -84,6 +86,21 @@ stages: ${{ if eq(variables.officialBuild, 'true') }}: displayName: Build and publish illink.sln $(_BuildConfig) + - job: SourceBuild_Managed + displayName: Source-Build (Managed) + pool: + vmImage: ubuntu-20.04 + container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343' + workspace: + clean: all + variables: + - name: _BuildConfig + value: Release + steps: + - checkout: self + submodules: true + - template: /eng/common/templates/steps/source-build.yml + - ${{ if eq(variables.officialBuild, 'false') }}: - job: Linux condition: eq(variables.officialBuild, 'false') diff --git a/src/linker/Mono.Linker.csproj b/src/linker/Mono.Linker.csproj index 4817c8751f38..fddfd3277203 100644 --- a/src/linker/Mono.Linker.csproj +++ b/src/linker/Mono.Linker.csproj @@ -2,6 +2,8 @@ Exe + + false disable true