From d693228ff8022dbb5a7886d7cd45f09cde57c568 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Fri, 2 Feb 2024 18:38:41 +0100 Subject: [PATCH] Fix repo builds not getting propagated when using the minimal console log (#18501) Noticed in https://github.com/dotnet/installer/pull/18409 that errors aren't propagated which resulted in builds not to fail. The fix here is to use `OnError` in the correct target (but only when using the minimal console log feature) and not set `IgnoreStandardErrorWarningFormat=true` on the Exec task that invokes the repo build script. I also cleaned targets up as those introduced unnecessary complexity and logged in cases when they shouldn't (i.e. in dotnet.proj or package-source-build.proj). This affected runtime which errors after 30s of building because of RuntimeOS and BaseOS being passed in in-correctly. Regressed with https://github.com/dotnet/installer/commit/cca2b7bedef771c45eec62492017dde51199378d#diff-86602308e6bb519266bc2f224ea65e39589d273804d40ad0f9c6e0eea2a263dc. Fixed that in runtime.proj. Kudos to Alexander who made the fix. I just copied it in form his CI PR. --- .../repo-projects/Directory.Build.targets | 58 +++++++++---------- .../repo-projects/package-source-build.proj | 2 +- .../content/repo-projects/runtime.proj | 10 +++- .../content/repo-projects/sdk.proj | 5 -- .../source-build-reference-packages.proj | 2 +- 5 files changed, 39 insertions(+), 38 deletions(-) diff --git a/src/SourceBuild/content/repo-projects/Directory.Build.targets b/src/SourceBuild/content/repo-projects/Directory.Build.targets index d96d9edab..f541430d6 100644 --- a/src/SourceBuild/content/repo-projects/Directory.Build.targets +++ b/src/SourceBuild/content/repo-projects/Directory.Build.targets @@ -57,7 +57,6 @@ @@ -146,7 +145,6 @@ @@ -173,8 +171,7 @@ + Condition="'$(UpdateEngCommonFiles)' == 'true' or '$(DotNetBuildSourceOnly)' != 'true'"> @@ -187,7 +184,6 @@ @@ -268,31 +264,25 @@ StopOnFirstFailure="true" /> - + Outputs="$(BaseIntermediateOutputPath)Build.complete" + Condition="'$(BuildCommand)' != ''" + DependsOnTargets="BuildRepoReferences; + UpdateNuGetConfig; + UpdateGlobalJsonVersions; + CreateBuildInputProps; + UpdateEngCommonFiles; + SetSourceBuiltSdkOverrides"> - - - - - - - + + + + + - - - - - - - - - + EnvironmentVariables="@(EnvironmentVariables)" /> + + + + + + + + + + - + + + @@ -643,7 +644,6 @@ diff --git a/src/SourceBuild/content/repo-projects/package-source-build.proj b/src/SourceBuild/content/repo-projects/package-source-build.proj index 9703ad0c0..d95a7336f 100644 --- a/src/SourceBuild/content/repo-projects/package-source-build.proj +++ b/src/SourceBuild/content/repo-projects/package-source-build.proj @@ -13,7 +13,7 @@ + DependsOnTargets="CreateBuildInputProps;DetermineSourceBuiltSdkVersion"> diff --git a/src/SourceBuild/content/repo-projects/runtime.proj b/src/SourceBuild/content/repo-projects/runtime.proj index dc1110328..35bbd9b03 100644 --- a/src/SourceBuild/content/repo-projects/runtime.proj +++ b/src/SourceBuild/content/repo-projects/runtime.proj @@ -3,14 +3,20 @@ true + <_platformIndex>$(NETCoreSdkRuntimeIdentifier.LastIndexOf('-')) + $(NETCoreSdkRuntimeIdentifier.Substring(0, $(_platformIndex))) + + <_platformIndex>$(NETCoreSdkPortableRuntimeIdentifier.LastIndexOf('-')) + $(NETCoreSdkPortableRuntimeIdentifier.Substring(0, $(_platformIndex)))-$(TargetArchitecture) + $(ProjectDirectory)build$(ShellExtension) $(BuildArgs) $(FlagParameterPrefix)arch $(TargetArchitecture) $(BuildArgs) $(FlagParameterPrefix)os $(TargetOS) $(BuildArgs) /p:TargetRid=$(TargetRid) - $(BuildArgs) /p:RuntimeOS=$(TargetOS) - $(BuildArgs) /p:BaseOS=$(PortableRid) + $(BuildArgs) /p:RuntimeOS=$(RuntimeOS) + $(BuildArgs) /p:BaseOS=$(BaseOS) diff --git a/src/SourceBuild/content/repo-projects/sdk.proj b/src/SourceBuild/content/repo-projects/sdk.proj index b4b91ed27..69c6a2826 100644 --- a/src/SourceBuild/content/repo-projects/sdk.proj +++ b/src/SourceBuild/content/repo-projects/sdk.proj @@ -3,11 +3,6 @@ true - - <_platformIndex>$(NETCoreSdkPortableRuntimeIdentifier.LastIndexOf('-')) - <_baseOS>$(NETCoreSdkPortableRuntimeIdentifier.Substring(0, $(_platformIndex))) - <_baseOS Condition="'$(PortableBuild)' == 'true'">$(TargetOS) - $(BuildArgs) /p:PackageProjectUrl=https://github.com/dotnet/sdk $(BuildArgs) /p:PortableRid=$(PortableRid) $(BuildArgs) /p:TargetRid=$(TargetRid) diff --git a/src/SourceBuild/content/repo-projects/source-build-reference-packages.proj b/src/SourceBuild/content/repo-projects/source-build-reference-packages.proj index beeb213fd..a3bf43dae 100644 --- a/src/SourceBuild/content/repo-projects/source-build-reference-packages.proj +++ b/src/SourceBuild/content/repo-projects/source-build-reference-packages.proj @@ -20,7 +20,7 @@ + BeforeTargets="UpdateNuGetConfig">