Граф коммитов

8687 Коммитов

Автор SHA1 Сообщение Дата
dotnet-maestro[bot] b2d769c9f4
Update dependencies from https://github.com/dotnet/arcade build 20240624.1 (#10285)
Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.24311.3 -> To Version 8.0.0-beta.24324.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2024-06-24 18:24:19 +02:00
Jenny Bai c028e44472
Add the missing help messages for some switches (#9719) 2024-06-24 14:03:21 +02:00
Farhad Alizada c260ac1537
Add build status badged public and internal (#10275) 2024-06-21 09:16:09 +02:00
AR-May 9e681905e3
Version 17.12 (#10268)
* Bump version

* Update API baseline package version

* Delete CompatibilitySuppressions file
2024-06-20 18:30:14 +02:00
Rainer Sigwald 48003ed205
Nullable annotations for ErrorUtilities (#10272)
This will help with using these from new code that's nullable-
aware. The biggest helpful bit is the `[NotNull]` ones that let the
compiler know to assume that parameter is non-null in the rest
of the method, which should eliminate the need for some `!`s
after calling `VerifyThrowArgumentNull(whatever)`.
2024-06-20 10:30:31 -05:00
AR-May 3c12d57711
Disable CustomAnalyzerTest (#10278) 2024-06-20 16:52:17 +02:00
Surayya Huseyn Zada 856f50eee0
Fix bug: No visible message when replaying analyzed build (#10265)
* add BuildCheck.UnitTests to slnf

* add test for replaying binlog of analyzed build

* fixed buf for BuildCheckResultWarning

* changed the test for error case

* fixed bug for BuildCheckResultError

* set RawMessage for BuilCheck results instead of speacial casing in BuildEventArgsWriter

* remove using

* add skip back to the flaky test;
add skip to the new test
2024-06-20 12:28:24 +00:00
Farhad Alizada e1ff6dcf62
Add the configuration file for merge flow (#10257) 2024-06-20 12:55:10 +02:00
Rainer Sigwald 61dcbf07b6
Additional Guardian baselining (#10271)
These results are uninteresting since drop.app is not something MSBuild ships or
redistributes, and BinSkim is currently breaking the build. Add to the baseline to get the
build working while Arcade is working to update to a new drop.app.
2024-06-19 17:03:10 -05:00
Jan Provazník 4a45d56330
Log Registry LongPathsEnabled in v:diagnostic (#10223)
* Add a message for LongPathsEnabled

* refactor LongPathsEnabled logic to a ternary enum

* Elaborate and comment the resource string

* translations

* add state for registry not set

* deduplicate
2024-06-18 16:25:07 +02:00
David Federman 0a3683cf7b
Update Microsoft.BuildXL.Processes to 0.1.0-20240606.3 (#10255) 2024-06-18 08:43:59 +00:00
dotnet-maestro[bot] 39f2edb9bd
[main] Update dependencies from dotnet/roslyn, nuget/nuget.client (#10252)
* Update dependencies from https://github.com/dotnet/roslyn build 20240613.9

Microsoft.Net.Compilers.Toolset
 From Version 4.11.0-3.24307.2 -> To Version 4.11.0-3.24313.9

* Update dependencies from https://github.com/nuget/nuget.client build 6.11.0.101

NuGet.Build.Tasks
 From Version 6.11.0-rc.87 -> To Version 6.11.0-rc.101

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2024-06-18 13:55:33 +08:00
dotnet-maestro[bot] 8060da46b5
Update dependencies from https://github.com/dotnet/arcade build 20240611.3 (#10253)
Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.24270.4 -> To Version 8.0.0-beta.24311.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2024-06-18 13:54:06 +08:00
Rainer Sigwald 5b5222d77d
Manual thread safety in RedirectConsoleWriter (#10231)
Initially, this delegated thread safety to a `SyncTextWriter`, but the
object graph was hard to understand, so it was replaced with a has-a
`SyncTextWriter` relationship, but this lost the timer-based call to
`Flush()` to send the output to the client.

The docs on `MethodImplOptions.Synchronized` also advise that it can be
risky due to locking on the object itself, so manage the syncronization
with an explicit lock object over the underlying `StringWriter` instead.

Fixes #10013.
2024-06-17 13:39:46 -05:00
Rainer Sigwald 0b6e073b18
Drop MSBuildTaskHost resources from ARM64 (#10230)
These resources were added to the ARM64 subfolder in #10023,
but I don't think they're needed: there's no .NET Framework 3.5
for ARM64 and `MSBuildTaskHost.exe` isn't in the ARM64 folder
itself, so I think we can remove these files.

There was also a build race condition involving the .resources.dll
files, which is how I found this. The `Arm64ProjectReference`
wasn't enough to get them built.

---------

Co-authored-by: Jenny Bai <v-jennybai@microsoft.com>
2024-06-17 12:09:10 +02:00
dotnet bot fd0c96255e
Localized file check-in by OneLocBuild Task: Build definition ID 9434: Build ID 9736500 (#10247)
* Localized file check-in by OneLocBuild Task: Build definition ID 9434: Build ID 9736500

* Localized file check-in by OneLocBuild Task: Build definition ID 9434: Build ID 9736500

* Localized file check-in by OneLocBuild Task: Build definition ID 9434: Build ID 9736500
2024-06-17 02:35:07 -07:00
Jan Provazník b100f12cd8
Normalize paths when extracting them from properties in BuildCheck (#10238)
* add an extension method for getting paths from dictionaries, use it in BuildCheck
2024-06-17 09:32:02 +02:00
Jan Krivanek a9efffc4de
Fix xml comments (#10233) 2024-06-14 16:37:58 +02:00
YuliiaKovalova 8761bb7677
Extend BuildCheck-feature-threat-model.md (#10221) 2024-06-14 12:53:29 +00:00
Jan Provazník 8f2286275c
Move LockCheck to Utilities (#10218)
* move LockCheck to Utilities and make it public, update resources

* add doc comments

* refactor windows condition inside LockCheck

* use LockCheck in other Tasks which delete/modify files

* improve method summary

Co-authored-by: Rainer Sigwald <raines@microsoft.com>

---------
2024-06-14 09:47:36 +02:00
dotnet-maestro[bot] 80c02d0129
[main] Update dependencies from dotnet/roslyn, nuget/nuget.client (#10217)
* Update dependencies from https://github.com/dotnet/roslyn build 20240607.2

Microsoft.Net.Compilers.Toolset
 From Version 4.11.0-3.24301.1 -> To Version 4.11.0-3.24307.2

* Update dependencies from https://github.com/nuget/nuget.client build 6.11.0.87

NuGet.Build.Tasks
 From Version 6.11.0-preview.2.76 -> To Version 6.11.0-rc.87

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2024-06-14 10:52:13 +08:00
Jan Krivanek b36ff85c52
Bugfix SharedOutputPath analyzer (#10236) 2024-06-13 14:01:19 +02:00
Jakub Jareš 63f447bf81
Add a way to write output (#10203) 2024-06-13 12:40:27 +02:00
Jan Provazník 3deec2fe6b
Add a binlog message in case of failure to add an embedded file (#10212)
* Add logging of exceptions when reading a file in BinaryLogger

* Narrow exception types

* Add argument name

* Log flattened exception messages
2024-06-12 16:35:34 +02:00
Roman Konecny 36c5352263
Comment for null ás warning or error in SDK result (#10094) 2024-06-12 12:14:09 +02:00
Jenny Bai 9ead13b2d7
Enable ca2000 for tests and fix the leaks (#10161)
* Enable CA2000 in tests

* Fix the process ca2000 error

* disabel the warning CA2000 in StartToolProcess

* Refactor the XmlReader create

* Fix new CA2000 after merge

* Fix the typo error

* Fix the indent

---------

Co-authored-by: Gang Wang <v-gaw@microsoft.com>
2024-06-12 08:13:43 +02:00
Ladi Prosek 74e23a98d1
[BuildCheck] Implement double writes analyzer (#10184)
Fixes #9881

### Context

We believe there is value in flagging cases where the same file is written by more than one task during a build. https://github.com/dotnet/source-build/issues/4390 is an example of a recent hard-to-diagnose build issue that could have been prevented by this analyzer.

### Changes Made

This PR adds a new built-in analyzer and makes a few supporting changes.

### Testing

- Existing and new unit tests.
- Built a few larger repos with the analyzer enabled.

### Notes

The changes contain a fix/workaround for #10176.
2024-06-10 09:13:03 +02:00
Jan Krivanek 969e24d04d
Document MSBuild Logging (#10158)
* Document MSBuild Logging

* Adjust whitespaces format

* Update based on review

* Apply suggestions from code review

Co-authored-by: AR-May <67507805+AR-May@users.noreply.github.com>
Co-authored-by: Rainer Sigwald <raines@microsoft.com>

* Reflecting PR review comments

---------

Co-authored-by: AR-May <67507805+AR-May@users.noreply.github.com>
Co-authored-by: Rainer Sigwald <raines@microsoft.com>
2024-06-09 21:13:46 +02:00
dotnet bot 98c28cc33d
Localized file check-in by OneLocBuild Task: Build definition ID 9434: Build ID 9675539 (#10202) 2024-06-07 13:56:45 +00:00
Jan Krivanek da5a94252e
unGAC stringtools (#10210) 2024-06-07 14:57:35 +02:00
AR-May b8e5cce93e
Disable SampleAnalyzerIntegrationTest (#10207) 2024-06-06 20:22:50 +02:00
SGreen 9bea8026aa
Revert "Support lazy instantiation of ProjectInstance values when CPS Evaluation cache is used (#10030)" (#10205)
This reverts commit eade7200e9.
2024-06-04 21:20:01 +00:00
Mariana Dematte 4b522b0238
Added deprecation messages (#10198)
We are working on actually deprecating the projects under the deprecated folder. For now adding the deprecation message to public classes.
2024-06-04 10:01:03 -07:00
dotnet-maestro[bot] 644d340ad1
[main] Update dependencies from dotnet/roslyn, nuget/nuget.client (#10200)
* Update dependencies from https://github.com/dotnet/roslyn build 20240601.1

Microsoft.Net.Compilers.Toolset
 From Version 4.11.0-2.24274.2 -> To Version 4.11.0-3.24301.1

* Update dependencies from https://github.com/nuget/nuget.client build 6.11.0.76

NuGet.Build.Tasks
 From Version 6.11.0-preview.2.66 -> To Version 6.11.0-preview.2.76

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2024-06-04 17:41:54 +02:00
dotnet bot 6f91876c7e
Localized file check-in by OneLocBuild Task: Build definition ID 9434: Build ID 9660737 (#10196) 2024-06-04 17:41:35 +02:00
YuliiaKovalova db79545e59
Use System.AccessToken to access drops (#10190)
* Temporary disable CreateExpMSBuild due to configuration issues

* use System.AccessToken to access drops
2024-05-31 15:17:31 +00:00
Jan Krivanek 49afd89738
Remove redundant creation of Forwarding logger with NullLogger (#10125)
* Remove redundant creation of NullLogger

* Fine tune the removal of redundant forwarder logger

* Cleanup

* Fix condition
2024-05-31 14:52:27 +02:00
Ladi Prosek b963c24ef3
Fix NRE in target batching (#10185)
Fixes #10180

### Context

#10102 made certain batching scenarios fail with a null-ref exception.

### Changes Made

Moved the call to `LogTargetBatchFinished` to make sure that the loop doesn't exit with null `targetLoggingContext`.

### Testing

New unit test with a repro project.
2024-05-29 12:47:10 +00:00
YuliiaKovalova 7ae92ce46f
Add PreferNativeArm64 flag (#10134) 2024-05-29 08:23:52 +02:00
dotnet-maestro[bot] 18773f232a
[main] Update dependencies from dotnet/roslyn, nuget/nuget.client (#10178)
* Update dependencies from https://github.com/dotnet/roslyn build 20240524.2

Microsoft.Net.Compilers.Toolset
 From Version 4.10.0-3.24259.10 -> To Version 4.11.0-2.24274.2

* Update dependencies from https://github.com/nuget/nuget.client build 6.11.0.66

NuGet.Build.Tasks
 From Version 6.10.0-preview.2.97 -> To Version 6.11.0-preview.2.66

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2024-05-28 07:33:54 -07:00
dotnet-maestro[bot] 09d75ab5d5
Update dependencies from https://github.com/dotnet/arcade build 20240520.4 (#10179)
Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.24266.3 -> To Version 8.0.0-beta.24270.4

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2024-05-28 07:04:15 -07:00
dotnet bot 3c039cbcf5
Localized file check-in by OneLocBuild Task: Build definition ID 9434: Build ID 9637316 (#10174) 2024-05-28 02:48:58 -07:00
Jenny Bai 2d924ca8c2
pack template for custom analyzer (#10155)
Fixes #9915

Context
#9789 added a template for custom analyzer.
In order for that to be usable by our customers - we need to be publishing this to nuget feed along with our other binaries. So we should have the package produced from our repo - ideally as part of our build script

Changes Made
Create a template package project with property <GeneratePackageOnBuild>true</GeneratePackageOnBuild>that pack the templates into a nuget package when build. Add the package project in the msbuild solution in order to build the project.

Testing
https://dev.azure.com/devdiv/DevDiv/_build/results?buildId=9602998&view=artifacts&pathAsName=false&type=publishedArtifacts in the packageArtifacts folder.

image
2024-05-27 14:24:46 +08:00
dotnet bot d11496b952
Localized file check-in by OneLocBuild Task: Build definition ID 9434: Build ID 9634972 (#10170)
Localized file check-in by OneLocBuild Task: Build definition ID 9434: Build ID 9634972
This is the pull request automatically created by the OneLocBuild task in the build process to check-in localized files generated based upon translation source files (.lcl files) handed-back from the downstream localization pipeline. If there are issues in translations, visit https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is https://aka.ms/onelocbuild and the localization process in general is documented at https://aka.ms/AllAboutLoc.
2024-05-27 14:16:22 +08:00
YuliiaKovalova 6c74871869
Wrap DumpExceptionToFile with try/catch for outofmemory (#10165)
* Wrap DumpExceptionToFile with try/catch for outofmemory

* add empty catch

Co-authored-by: Rainer Sigwald <raines@microsoft.com>

* add comment

* Update src/Shared/ExceptionHandling.cs

Co-authored-by: Rainer Sigwald <raines@microsoft.com>

---------

Co-authored-by: Rainer Sigwald <raines@microsoft.com>
2024-05-25 09:05:00 +00:00
AR-May 72f42c4155
Fix the crash in Terminal Logger shutdown. (#10163)
Fixes #9662

Context
When we use TL, we save the console output encoding to a variable, change the encoding
to UTF8 for the logging duration and attempt to set it back to the previous value during the Terminal Logger shutdown. It fails in some terminal emulators. It seems to be either a bug of the terminal emulator or Console.OutputEncoding property.

Changes Made
Wrapped the setting of the console output in try-catch block.

Testing
Unit tests
2024-05-24 17:07:28 +02:00
YuliiaKovalova 0b3caf7f8f
Handle the case for unsuccessful custom analyzer registration + change e2e tests (#10117) 2024-05-24 16:58:33 +02:00
Rainer Sigwald 4efbed43f7
Tweak release-process docs (#9958)
* Initial PR checklist content

Snapshot of the now-current release https://github.com/dotnet/msbuild/issues/9914.

* Uncheck!

* Section headers

* Variables for the releases

* Clarifications and update stale version

* fixup! Variables for the releases

* Clarify ff instructions

* Crispen OptProf

* fixup! Variables for the releases

* More tweaks
2024-05-24 15:42:27 +02:00
SGreen eade7200e9
Support lazy instantiation of ProjectInstance values when CPS Evaluation cache is used (#10030)
### Context
This PR targets the specific scenario of constructing a ProjectInstance object from the evaluation data stored in CPS's evaluation cache, with the goal of saving memory and execution time during Solution Load.

In a previous change (2a789cd8bd), I modified the ProjectInstance logic to rely on virtualized collections that are wrappers around the CPS evaluation cache's collection. The ProjectPropertyInstance, ProjectItemInstance, etc. objects were created ahead of time and associated with the corresponding CPS object, such that only one copy of the collections needed to exist.

In this PR, the goal is to extend that further such that the ProjectPropertyInstance, ProjectItemInstance, etc. values are only created when they're actually needed, and some new logic is introduced for reading Property values and Metadata values that allows avoiding creating the ProjectPropertyInstance and ProjectMetadataInstance when all that's sought is the EscapedValue string.

### Changes Made
The collections for ProjectInstance's _properties, _itemDefinitions, _items, _itemsByEvaluatedInclude, _globalProperties, _targets, _importPaths, and _importPathsincludingDuplicates collections are replaced with specialized virtualizing collections that wrap the associated CPS collection. These collections create the ProjectPropertyInstance et al objects only when a caller requests them. Additionally, the ProjectItemDefinitionInstance's metadata collection, and the ProjectItemInstance's ItemDefinition and Metadata collections are all similarly replaced by a virtualizing collection.

ProjectInstance's _environmentVariableProperties still relies on the ProjectCollection's EnvironmentVariables, but a new SharedReadOnlyEnvironmentProperties collection is introduced that does not hand out copies of the PropertyDictionary, but instead the same PropertyDictionary instance whose backing collection has been made read only.

### Testing
Manual verification of impacted scenarios and performance measurements.
2024-05-24 09:12:40 +02:00
Ladi Prosek 147ecadd19
Add ParameterName and PropertyName to TaskParameterEventArgs (#10130)
Contributes to #9881

### Context

When `TaskParameterEventArgs` represents an output parameter of a task, it currently does not capture the name of the parameter. This information is generally useful as multiple output parameters can be assigned to the same item, and it's important for the BuildCheck infrastructure to provide a consistent object model to build analyzers.

Additionally, output parameters that are assigned to properties are currently logged as textual log messages `Output Property: {0}={1}` which miss the name of the parameter as well.

### Changes Made

Added two new properties on the `TaskParameterEventArgs` class, including the requisite serialization support. Updated logging to populate the properties with the name of the task parameter and the name of the build property, respectively, and updated BuildCheck infra to expose it to analyzers subscribed to task parameter events.

All task parameters are now logged as the structured `TaskParameterEventArgs` and the kind of parameter (input, output to property, output to item) can be determined by examining the args.

### Testing

- Tweaked existing unit test and updated the relevant BuildCheck test.
- Verified that when using the standard console logger, the resulting textual log is identical.
- Verified that binlog viewer without the corresponding changes displays the forward-compat warning about unknown data.

### Notes

- Complementary binlog viewer PR: https://github.com/KirillOsenkov/MSBuildStructuredLog/pull/780
- The change is behind a changewave because it is technically a breaking change for third party loggers.

Co-authored-by: Rainer Sigwald <raines@microsoft.com>
2024-05-23 09:05:47 +02:00