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

Enable build check #15514

Merged
merged 16 commits into from
Mar 18, 2025
Merged

Enable build check #15514

merged 16 commits into from
Mar 18, 2025

Conversation

YuliiaKovalova
Copy link
Member

@YuliiaKovalova YuliiaKovalova commented Feb 13, 2025

Context

Enable MSBuild BuildCheck feature to enforce various best practices embracing for the build scripts.

To double check:

@YuliiaKovalova YuliiaKovalova marked this pull request as ready for review March 18, 2025 13:22
@YuliiaKovalova YuliiaKovalova enabled auto-merge (squash) March 18, 2025 15:52
@ViktorHofer ViktorHofer requested a review from mmitche March 18, 2025 16:03
@ViktorHofer
Copy link
Member

@mmitche we are going to promote a new .NET SDK as the msbuild team would like to have build checks enabled by default for some dogfooding data. PTAL and approve if the changes look good to you.

@YuliiaKovalova YuliiaKovalova merged commit d4e7991 into main Mar 18, 2025
15 checks passed
@YuliiaKovalova YuliiaKovalova deleted the dev/ykovalova/enable_build_check branch March 18, 2025 16:09
@mmitche
Copy link
Member

mmitche commented Mar 19, 2025

@YuliiaKovalova HItting issues in the official build https://dev.azure.com/dnceng/internal/_build/results?buildId=2666445&view=logs&j=316d5c15-0c50-544e-8051-e6b14a1ab674&t=07ca70a5-a94b-5cc6-71a7-0d6ee493dd78&l=189

##[error].dotnet\sdk\10.0.100-preview.3.25153.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.CSharp.props(26,14): error BC0202: (NETCORE_ENGINEERING_TELEMETRY=Restore) https://aka.ms/buildcheck/codes#BC0202 - Property: 'ImplicitUsings' first declared/initialized at D:\a\_work\1\s\src\Microsoft.DotNet.XUnitAssert\src\Microsoft.DotNet.XUnitAssert.csproj (7,5) used before it was initialized.
D:\a\_work\1\s\.dotnet\sdk\10.0.100-preview.3.25153.2\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(33,5): error BC0202: https://aka.ms/buildcheck/codes#BC0202 - Property: 'Description' first declared/initialized at D:\a\_work\1\s\src\Microsoft.DotNet.XUnitAssert\src\Microsoft.DotNet.XUnitAssert.csproj (10,5) used before it was initialized. [D:\a\_work\1\s\src\Microsoft.DotNet.XUnitAssert\src\Microsoft.DotNet.XUnitAssert.csproj]
##[error].dotnet\sdk\10.0.100-preview.3.25153.2\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(33,5): error BC0202: (NETCORE_ENGINEERING_TELEMETRY=Restore) https://aka.ms/buildcheck/codes#BC0202 - Property: 'Description' first declared/initialized at D:\a\_work\1\s\src\Microsoft.DotNet.XUnitAssert\src\Microsoft.DotNet.XUnitAssert.csproj (10,5) used before it was initialized.
D:\a\_work\1\s\.packages\microsoft.dotnet.arcade.sdk\10.0.0-beta.25164.6\tools\ExcludeFromBuild.BeforeCommonTargets.targets(31,18): error BC0202: https://aka.ms/buildcheck/codes#BC0202 - Property: 'IsTestUtilityProject' first declared/initialized at D:\a\_work\1\s\src\Microsoft.DotNet.XUnitAssert\src\Microsoft.DotNet.XUnitAssert.csproj (11,5) used before it was initialized. [D:\a\_work\1\s\src\Microsoft.DotNet.XUnitAssert\src\Microsoft.DotNet.XUnitAssert.csproj]
##[error].packages\microsoft.dotnet.arcade.sdk\10.0.0-beta.25164.6\tools\ExcludeFromBuild.BeforeCommonTargets.targets(31,18): error BC0202: (NETCORE_ENGINEERING_TELEMETRY=Restore) https://aka.ms/buildcheck/codes#BC0202 - Property: 'IsTestUtilityProject' first declared/initialized at D:\a\_work\1\s\src\Microsoft.DotNet.XUnitAssert\src\Microsoft.DotNet.XUnitAssert.csproj (11,5) used before it was initialized.
D:\a\_work\1\s\.dotnet\sdk\10.0.100-preview.3.25153.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(37,24): error BC0202: https://aka.ms/buildcheck/codes#BC0202 - Property: 'IsTrimmable' first declared/initialized at D:\a\_work\1\s\src\Microsoft.DotNet.XUnitAssert\src\Microsoft.DotNet.XUnitAssert.csproj (13,5) used before it was initialized. [D:\a\_work\1\s\src\Microsoft.DotNet.XUnitAssert\src\Microsoft.DotNet.XUnitAssert.csproj]
##[error].dotnet\sdk\10.0.100-preview.3.25153.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(37,24): error BC0202: (NETCORE_ENGINEERING_TELEMETRY=Restore) https://aka.ms/buildcheck/codes#BC0202 - Property: 'IsTrimmable' first declared/initialized at D:\a\_work\1\s\src\Microsoft.DotNet.XUnitAssert\src\Microsoft.DotNet.XUnitAssert.csproj (13,5) used before it was initialized.
D:\a\_work\1\s\src\Microsoft.DotNet.CMake.Sdk\Microsoft.DotNet.CMake.Sdk.csproj(7,5): message BC0203: https://aka.ms/buildcheck/codes#BC0203 - Property: 'PackageType' was declared/initialized, but it was never used.

@mmitche
Copy link
Member

mmitche commented Mar 19, 2025

It's also making my local build sad:

PS C:\r\arcade> .\Build.cmd
GET https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.ps1
  Attempting to install 'sdk v10.0.100-preview.3.25153.2' from public location.
dotnet-install: Remote file https://ci.dot.net/public/Sdk/10.0.100-preview.3.25153.2/dotnet-sdk-10.0.100-preview.3.25153.2-win-x64.zip size is 282471658 bytes.
dotnet-install: Downloaded file https://ci.dot.net/public/Sdk/10.0.100-preview.3.25153.2/dotnet-sdk-10.0.100-preview.3.25153.2-win-x64.zip size is 282471658 bytes.
dotnet-install: The remote and local file sizes are equal.
dotnet-install: Extracting the archive.
dotnet-install: Adding to current process PATH: "C:\r\arcade\.dotnet\". Note: This change will not be visible if PowerShell was run as a child process.
dotnet-install: Note that the script does not ensure your Windows version is supported during the installation.
dotnet-install: To check the list of supported versions, go to https://learn.microsoft.com/dotnet/core/install/windows#supported-versions
dotnet-install: Installed version is 10.0.100-preview.3.25153.2
dotnet-install: Installation finished

Build succeeded in 0.5s
MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Node 1 does not have a provider.
   at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Object[] args)
   at Microsoft.Build.BackEnd.NodeManager.SendData(Int32 node, INodePacket packet)
   at Microsoft.Build.Execution.BuildManager.PerformSchedulingActions(IEnumerable`1 responses)
   at Microsoft.Build.Execution.BuildManager.ProcessPacket(Int32 node, INodePacket packet)
   at Microsoft.Build.Execution.BuildManager.ProcessWorkQueue(Action action)
--- End of stack trace from previous location ---
   at Microsoft.Build.Execution.BuildManager.EndBuild()
   at Microsoft.Build.Execution.BuildManager.EndBuild()
   at Microsoft.Build.Execution.BuildManager.EndBuild()
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsNotAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, ProjectIsolationMode isolateProjects, GraphBuildOptions graphBuildOptions, Boolean lowPriority, Boolean question, Boolean isBuildCheckEnabled, String[] inputResultsCaches, String outputResultsCache, Boolean saveProjectResult, BuildResult& result, String[] commandLine)

MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Node 1 does not have a provider.
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsNotAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, ProjectIsolationMode isolateProjects, GraphBuildOptions graphBuildOptions, Boolean lowPriority, Boolean question, Boolean isBuildCheckEnabled, String[] inputResultsCaches, String outputResultsCache, Boolean saveProjectResult, BuildResult& result, String[] commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
Unhandled exception: Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Node 1 does not have a provider.
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsNotAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, ProjectIsolationMode isolateProjects, GraphBuildOptions graphBuildOptions, Boolean lowPriority, Boolean question, Boolean isBuildCheckEnabled, String[] inputResultsCaches, String outputResultsCache, Boolean saveProjectResult, BuildResult& result, String[] commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)
   at Microsoft.DotNet.Cli.Utils.MSBuildForwardingAppWithoutLogging.ExecuteInProc(String[] arguments)
Build failed with exit code -532462766. Check errors above.

@YuliiaKovalova
Copy link
Member Author

Hi @mmitche,

Sorry to hear that, looking at the issues.
If I don't workaround them ,I will revert the change today.

@YuliiaKovalova
Copy link
Member Author

@mmitche please look at this fix: #15658

mmitche added a commit to mmitche/arcade that referenced this pull request Mar 20, 2025
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.

3 participants