From f4840654ec35a797897ac6a7c1e3c0a67dcad792 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Mon, 16 Dec 2024 22:29:51 +0100 Subject: [PATCH 1/8] temp --- docs/project/library-servicing.md | 2 +- eng/DotNetBuild.props | 3 +-- eng/build.ps1 | 5 ++--- eng/build.sh | 10 ++++------ eng/packaging.targets | 9 ++------- eng/pipelines/global-build.yml | 7 +++---- eng/pipelines/runtime-official.yml | 8 ++++---- eng/pipelines/runtime-richnav.yml | 2 +- eng/pipelines/runtime.yml | 6 +++--- eng/pipelines/runtimelab-official.yml | 2 +- eng/pipelines/runtimelab.yml | 2 +- .../Microsoft.NET.HostModel.csproj | 1 - 12 files changed, 23 insertions(+), 34 deletions(-) diff --git a/docs/project/library-servicing.md b/docs/project/library-servicing.md index 8422d9becbfba..560ff2247ac93 100644 --- a/docs/project/library-servicing.md +++ b/docs/project/library-servicing.md @@ -14,7 +14,7 @@ Keep in mind that we still need package authoring in .NET 8 and older versions. Develop and test your change as normal. For packages, you may want to test them outside the repo infrastructure. To do so, execute the following steps: -1. From a clean copy of your branch, run `build.cmd/sh libs -allconfigurations` +1. From a clean copy of your branch, run `build.cmd/sh libs -pack` 2. Check in `artifacts\bin\packages\Debug` for the existence of your package, with the appropriate package version. diff --git a/eng/DotNetBuild.props b/eng/DotNetBuild.props index 86f8ce3b0fff4..237985472c753 100644 --- a/eng/DotNetBuild.props +++ b/eng/DotNetBuild.props @@ -50,14 +50,13 @@ Properties that control flags from the VMR build, and the expected output for the VMR build should be added to this file. --> - $(InnerBuildArgs) $(FlagParameterPrefix)restore $(FlagParameterPrefix)build $(FlagParameterPrefix)publish + $(InnerBuildArgs) $(FlagParameterPrefix)restore $(FlagParameterPrefix)build $(FlagParameterPrefix)pack $(FlagParameterPrefix)publish $(InnerBuildArgs) $(FlagParameterPrefix)sign $(InnerBuildArgs) $(FlagParameterPrefix)arch $(TargetArch) $(InnerBuildArgs) $(FlagParameterPrefix)os $(TargetOS) $(InnerBuildArgs) $(FlagParameterPrefix)cross $(InnerBuildArgs) $(FlagParameterPrefix)configuration $(Configuration) - $(InnerBuildArgs) $(FlagParameterPrefix)allconfigurations $(InnerBuildArgs) $(FlagParameterPrefix)verbosity $(LogVerbosity) $(InnerBuildArgs) $(FlagParameterPrefix)nodereuse $(ArcadeFalseBoolBuildArg) $(InnerBuildArgs) $(FlagParameterPrefix)warnAsError $(ArcadeFalseBoolBuildArg) diff --git a/eng/build.ps1 b/eng/build.ps1 index 0d6f010ad4214..e38be81d660ec 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -1,13 +1,13 @@ [CmdletBinding(PositionalBinding=$false)] Param( [switch][Alias('h')]$help, + [switch]$pack, [switch][Alias('t')]$test, [ValidateSet("Debug","Release","Checked")][string[]][Alias('c')]$configuration = @("Debug"), [string][Alias('f')]$framework, [string]$vs, [string][Alias('v')]$verbosity = "minimal", [ValidateSet("windows","linux","osx","android","browser","wasi")][string]$os, - [switch]$allconfigurations, [switch]$coverage, [string]$testscope, [switch]$testnobuild, @@ -77,7 +77,6 @@ function Get-Help() { Write-Host "" Write-Host "Libraries settings:" - Write-Host " -allconfigurations Build packages for all build configurations." Write-Host " -coverage Collect code coverage when testing." Write-Host " -framework (-f) Build framework: net10.0 or net48." Write-Host " [Default: net10.0]" @@ -312,7 +311,7 @@ foreach ($argument in $PSBoundParameters.Keys) "hostConfiguration" { $arguments += " /p:HostConfiguration=$((Get-Culture).TextInfo.ToTitleCase($($PSBoundParameters[$argument])))" } "framework" { $arguments += " /p:BuildTargetFramework=$($PSBoundParameters[$argument].ToLowerInvariant())" } "os" { $arguments += " /p:TargetOS=$($PSBoundParameters[$argument])" } - "allconfigurations" { $arguments += " /p:BuildAllConfigurations=true" } + "pack" { $arguments += " -pack /p:BuildAllConfigurations=true" } "properties" { $arguments += " " + $properties } "verbosity" { $arguments += " -$argument " + $($PSBoundParameters[$argument]) } "cmakeargs" { $arguments += " /p:CMakeArgs=`"$($PSBoundParameters[$argument])`"" } diff --git a/eng/build.sh b/eng/build.sh index fe0e880252818..440e52f58430c 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -65,7 +65,6 @@ usage() echo "" echo "Libraries settings:" - echo " --allconfigurations Build packages for all build configurations." echo " --coverage Collect code coverage when testing." echo " --framework (-f) Build framework: net10.0 or net48." echo " [Default: net10.0]" @@ -308,11 +307,6 @@ while [[ $# > 0 ]]; do shift 2 ;; - -allconfigurations) - arguments="$arguments /p:BuildAllConfigurations=true" - shift 1 - ;; - -testscope) if [ -z ${2+x} ]; then echo "No test scope supplied. See help (--help) for supported test scope values." 1>&2 @@ -553,6 +547,10 @@ if [[ "${TreatWarningsAsErrors:-}" == "false" ]]; then arguments="$arguments -warnAsError false" fi +if [[ ! -z "$pack" ]]; then + arguments="$arguments /p:BuildAllConfigurations=true" +fi + # disable terminal logger for now: https://github.com/dotnet/runtime/issues/97211 arguments="$arguments -tl:false" diff --git a/eng/packaging.targets b/eng/packaging.targets index 131e5825a8fbb..5e1e3bbf264bc 100644 --- a/eng/packaging.targets +++ b/eng/packaging.targets @@ -27,15 +27,10 @@ PACKAGE.md $(BeforePack);ValidatePackageReadmeExists - - + true - true + true false diff --git a/eng/pipelines/global-build.yml b/eng/pipelines/global-build.yml index cd63a904a20e5..3739929fbb9f7 100644 --- a/eng/pipelines/global-build.yml +++ b/eng/pipelines/global-build.yml @@ -82,8 +82,7 @@ extends: eq(variables['isRollingBuild'], true)) # - # Build Libraries AllConfigurations. This exercises the code path where we build libraries for all - # configurations on a non Windows operating system. + # Build Libraries (all TFMs) and create packages on a non Windows operating system. # - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -92,8 +91,8 @@ extends: platforms: - linux_x64_dev_innerloop jobParameters: - nameSuffix: Libraries_AllConfigurations - buildArgs: -subset libs -allconfigurations + nameSuffix: Libraries_WithPackages + buildArgs: -subset libs -pack timeoutInMinutes: 120 condition: or( diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml index 9647fca1e8c9d..92ec42cb04651 100644 --- a/eng/pipelines/runtime-official.yml +++ b/eng/pipelines/runtime-official.yml @@ -454,7 +454,7 @@ extends: name: MonoRuntimePacks # - # Build libraries AllConfigurations for packages + # Build libraries (all TFMs) and packages # - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -464,13 +464,13 @@ extends: - windows_x64 jobParameters: templatePath: 'templates-official' - buildArgs: -s tools+libs -allConfigurations -c $(_BuildConfig) /p:TestAssemblies=false /p:TestPackages=true - nameSuffix: Libraries_AllConfigurations + buildArgs: -s tools+libs -pack -c $(_BuildConfig) /p:TestAssemblies=false /p:TestPackages=true + nameSuffix: Libraries_WithPackages isOfficialBuild: ${{ variables.isOfficialBuild }} postBuildSteps: - template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml parameters: - name: Libraries_AllConfigurations + name: Libraries_WithPackages timeoutInMinutes: 95 # # Build SourceBuild packages diff --git a/eng/pipelines/runtime-richnav.yml b/eng/pipelines/runtime-richnav.yml index 683ec86fa99c8..965a6f6cfd487 100644 --- a/eng/pipelines/runtime-richnav.yml +++ b/eng/pipelines/runtime-richnav.yml @@ -39,7 +39,7 @@ extends: richCodeNavigationLanguage: "csharp" nameSuffix: Libs timeoutInMinutes: 240 - buildArgs: -s libs.sfx+libs.oob -allConfigurations + buildArgs: -s libs.sfx+libs.oob -pack preBuildSteps: - script: dotnet.cmd nuget add source -n richnav "https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/nuget/v3/index.json" displayName: Add richnav NuGet feed diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 79cea0258a7fd..0fa94bf453bb9 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -1225,7 +1225,7 @@ extends: eq(variables['isRollingBuild'], true)) # - # Build and test libraries AllConfigurations + # Build and test libraries for all TFMs and create packages # - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -1234,8 +1234,8 @@ extends: platforms: - windows_x64 jobParameters: - buildArgs: -test -s tools+libs+libs.tests -allConfigurations -c $(_BuildConfig) /p:TestAssemblies=false /p:TestPackages=true - nameSuffix: Libraries_AllConfigurations + buildArgs: -test -s tools+libs+libs.tests -pack -c $(_BuildConfig) /p:TestAssemblies=false /p:TestPackages=true + nameSuffix: Libraries_WithPackages timeoutInMinutes: 150 condition: >- or( diff --git a/eng/pipelines/runtimelab-official.yml b/eng/pipelines/runtimelab-official.yml index 84a8bd69258d5..ceee4b7025d76 100644 --- a/eng/pipelines/runtimelab-official.yml +++ b/eng/pipelines/runtimelab-official.yml @@ -64,7 +64,7 @@ extends: - windows_x64 jobParameters: templatePath: 'templates-official' - buildArgs: -s tools+libs -allConfigurations -c $(_BuildConfig) /p:TestAssemblies=false /p:TestPackages=true + buildArgs: -s tools+libs -allConfigurations -c $(_BuildConfig) /p:BuildAllConfigurations=true /p:TestAssemblies=false /p:TestPackages=true nameSuffix: Libraries_AllConfigurations isOfficialBuild: true postBuildSteps: diff --git a/eng/pipelines/runtimelab.yml b/eng/pipelines/runtimelab.yml index d833780f24f8e..b23aeaf52743a 100644 --- a/eng/pipelines/runtimelab.yml +++ b/eng/pipelines/runtimelab.yml @@ -103,7 +103,7 @@ extends: platforms: - windows_x64 jobParameters: - buildArgs: -test -s tools+libs+libs.tests -allConfigurations -c $(_BuildConfig) /p:TestAssemblies=false /p:TestPackages=true + buildArgs: -test -s tools+libs+libs.tests -c $(_BuildConfig) /p:BuildAllConfigurations=true /p:TestAssemblies=false /p:TestPackages=true nameSuffix: Libraries_AllConfigurations timeoutInMinutes: 150 extraVariablesTemplates: diff --git a/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj b/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj index 28915bb45ed6e..96d7cf2353e42 100644 --- a/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj +++ b/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj @@ -5,7 +5,6 @@ Abstractions for modifying .NET host binaries false true - true true true true From a52143f9b4ef5d648f53b9285f111de4812c0305 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 17 Dec 2024 12:05:35 +0100 Subject: [PATCH 2/8] Fix pack on Unix --- eng/build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/build.sh b/eng/build.sh index 440e52f58430c..baa9a51560981 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -307,6 +307,10 @@ while [[ $# > 0 ]]; do shift 2 ;; + -pack) + arguments="$arguments --pack /p:BuildAllConfigurations=true" + ;; + -testscope) if [ -z ${2+x} ]; then echo "No test scope supplied. See help (--help) for supported test scope values." 1>&2 @@ -547,10 +551,6 @@ if [[ "${TreatWarningsAsErrors:-}" == "false" ]]; then arguments="$arguments -warnAsError false" fi -if [[ ! -z "$pack" ]]; then - arguments="$arguments /p:BuildAllConfigurations=true" -fi - # disable terminal logger for now: https://github.com/dotnet/runtime/issues/97211 arguments="$arguments -tl:false" From 70ec9db3f269c3baa771bc9b7fc4ea4c50751df6 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 17 Dec 2024 12:20:07 +0100 Subject: [PATCH 3/8] fixesss --- eng/Publishing.props | 4 ++-- eng/packaging.targets | 4 ++-- eng/pipelines/official/stages/publish.yml | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/eng/Publishing.props b/eng/Publishing.props index 562fc45c8c118..0d0ff3a2e39e1 100644 --- a/eng/Publishing.props +++ b/eng/Publishing.props @@ -77,14 +77,14 @@ PACKAGE.md $(BeforePack);ValidatePackageReadmeExists - + true - true + true false diff --git a/eng/pipelines/official/stages/publish.yml b/eng/pipelines/official/stages/publish.yml index 9553baae305f2..83b059ffc32a6 100644 --- a/eng/pipelines/official/stages/publish.yml +++ b/eng/pipelines/official/stages/publish.yml @@ -1,6 +1,5 @@ parameters: PublishRidAgnosticPackagesFromPlatform: windows_x64 - publishingInfraVersion: 3 stages: @@ -28,7 +27,6 @@ stages: # Stages-based publishing entry point - template: /eng/common/templates-official/post-build/post-build.yml parameters: - publishingInfraVersion: ${{ parameters.publishingInfraVersion }} validateDependsOn: - PrepareForPublish # The following checks are run after the build in the validation and release pipelines From a50db2030ce0085b0401d12142e34e7b9adc8cea Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 17 Dec 2024 12:21:25 +0100 Subject: [PATCH 4/8] fix pack flag on Unix --- eng/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/build.sh b/eng/build.sh index baa9a51560981..7d5d64b3d1fc5 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -309,6 +309,7 @@ while [[ $# > 0 ]]; do -pack) arguments="$arguments --pack /p:BuildAllConfigurations=true" + shift 1 ;; -testscope) From b9742408970928b97fd650480258cf648fd2c75b Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 17 Dec 2024 12:23:11 +0100 Subject: [PATCH 5/8] Enable package generation on build --- .../Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj b/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj index 96d7cf2353e42..28915bb45ed6e 100644 --- a/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj +++ b/src/installer/managed/Microsoft.NET.HostModel/Microsoft.NET.HostModel.csproj @@ -5,6 +5,7 @@ Abstractions for modifying .NET host binaries false true + true true true true From 5b65a4342be9d18a6faed253e70e91f3946e6dba Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 17 Dec 2024 14:59:24 +0100 Subject: [PATCH 6/8] Default Pack to true --- eng/Subsets.props | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/Subsets.props b/eng/Subsets.props index a50fd3e80025e..14a4a79c1ab0f 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -219,7 +219,6 @@ false - false false false From b488d0c865a9d0ce3df9977cf9c1f6fb31bfc9bb Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Wed, 18 Dec 2024 14:07:23 +0100 Subject: [PATCH 7/8] Use Traversal Sdk --- src/libraries/oob.proj | 4 ++-- src/libraries/sfx.proj | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libraries/oob.proj b/src/libraries/oob.proj index 96cddf78dc877..d91d9bcc86aef 100644 --- a/src/libraries/oob.proj +++ b/src/libraries/oob.proj @@ -1,4 +1,4 @@ - + $(NetCoreAppCurrent)-$(TargetOS) @@ -69,7 +69,7 @@ + AfterTargets="Pack"> diff --git a/src/libraries/sfx.proj b/src/libraries/sfx.proj index 15c4d25c43dbf..4f2f1e9385b60 100644 --- a/src/libraries/sfx.proj +++ b/src/libraries/sfx.proj @@ -1,4 +1,4 @@ - + From a0609dbcd64d44c6c6a15f501e72942d4eba8254 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Mon, 23 Dec 2024 11:36:15 +0100 Subject: [PATCH 8/8] Only import shared framework sdk's BuildTasks.props --- src/libraries/pretest.proj | 8 ++------ src/libraries/sfx.proj | 3 +-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/libraries/pretest.proj b/src/libraries/pretest.proj index e868134671603..1796316a8dc2e 100644 --- a/src/libraries/pretest.proj +++ b/src/libraries/pretest.proj @@ -1,5 +1,6 @@ - + + @@ -8,10 +9,6 @@ true - - false - - true