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

7737 Коммитов

Автор SHA1 Сообщение Дата
Rainer Sigwald d95c8c3e3b
Deemphasize MSBUILDDEBUGENGINE in binlog doc (#8712)
At least one person skimmed over the section we wanted to emphasize (`-bl`) and focused on `MSBUILDDEBUGENGINE`, sharing lower-fidelity logs that are harder to understand.

Remove the "Preferred way" callout--it's preferred in that section but not in general. Add a section header for command-line builds. Add some samples there.
2023-05-01 13:38:38 -07:00
Rainer Sigwald 0d84706024
Colorize TF instead of enclosing it in brackets (#8715)
Example:

 Recording.2023-04-28.103416.mp4 
I like this both because it highlights the TF more clearly and because it saves two characters of line width.
2023-05-01 13:32:07 -07:00
Thefrank d6fe2b00a1
Use env for bash path (#8716)
Fixes source building under FreeBSD where a symlink has not been made for bash

Context
/bin/bash is standard under OSes that ship with bash installed by default. FreeBSD does not have bash as a default shell.

Changes Made
For portability /usr/bin/env bash is used on the shebang line. This also bring it inline with other dotnet repos.

Testing
none needed?

Notes
env is standard at this point. I have been unable to find a non-historic UNIX-like system that places env in a location exclusively that is not /usr/bin/
2023-05-01 13:31:08 -07:00
dotnet-maestro[bot] 1c51978fdf
[vs17.2] Update dependencies from dotnet/arcade (#8302)
Update dependencies from https://github.com/dotnet/arcade build 20230411.7

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.XUnitExtensions
 From Version 6.0.0-beta.22531.5 -> To Version 6.0.0-beta.23211.7
2023-04-27 09:46:52 -07:00
github-actions[bot] 81da5a20f7
[vs17.2] Temporary turn off static graph restore. (#8697)
Turn off static graph restore.

(Backport of #8498 to vs17.2)
2023-04-26 10:17:54 -07:00
Rainer Sigwald 0dbc421eaa Merge remote-tracking branch 'upstream/vs17.6' 2023-04-26 10:19:03 -05:00
Roman Konecny 83ce3529b2
Adding placeholder for TFM (#8706) 2023-04-26 10:46:07 +02:00
Rainer Sigwald 093fbaf7bc
Emit relative path to output (#8692)
A top comment from the folks who've seen this is that the absolute paths take up a bunch of space and making them relative would be a UX nicety. This is the simplest possible approach for that: string prefix truncation with no path normalization or attempt to construct a relative path.
2023-04-25 23:13:52 +00:00
David Federman 07e2947214
Emulate AssignProjectConfiguration behavior in graph construction (#8625)
Summary
The for sln-based builds, the AssignProjectConfiguration task ends up using the Configuration and Platform defined in the sln rather than passing through the global properties from the referencing project or attempting to do dynamic platform negotiation. This change adds equivalent functionality to graph construction.

A concrete scenario this fixes for graph-based builds using an sln file is that most csproj define the "x86" platform while most vcxproj define "Win32". Previously for a graph build, if the csproj referenced the vcxproj, the platform passed to vcxproj would be x86, not Win32. Even worse, the vcxproj would be an entry point anyway, so it would double-build with both x86 AND Win32, which leads to race conditions.

Customer Impact
Microsoft-internal customer using sln-based builds will be able to opt-into graph builds

Regression?
No

Testing
Manual validation in the customer repo, as well as added unit tests

Risk
Low. Graph builds are a less-used feature, and this adds parity to what non-graph builds and VS-based builds do. It's unlikely that any behavioral change would be impactful due to those other scenarios presumably working for customers who may be using graph builds.
2023-04-25 22:56:35 +00:00
Roman Konecny 662a36f1f2
Using URI file schema for Live Logger hyperlinks (#8702)
Some terminal emulators handle `file://` links but not bare paths.
2023-04-25 13:03:47 -05:00
Rainer Sigwald 5738af0774
Include placeholder for TF in loc strings (#8705)
The double-bracing around this was missed in #8682.
2023-04-25 13:00:38 -05:00
Roman Konecny 6300d22b25
[LiveLogger ] Localize strings (#8682)
Partly Fixes #8391

Context
Ensure all new strings used in the logger are localizable

Changes Made
introduce strings in resx
using such resource strings
modify code to allow better localization (from write(part1); write(part2); write(part3) into str = formastringfromresources(); write(str)
Testing
local
unit tests
2023-04-25 16:04:20 +08:00
Roman Konecny c6e6cd447a
Fix outputIsScreen on non-windows OS. (#8689)
Detected while working on #8413

Context
outputIsScreen is always falls on on non-windows OS causing /tl:auto to reject live logger

Changes Made
see files

Testing
locally

Notes
would affect MSB server VT100 output coloring as well.
2023-04-24 18:05:52 +08:00
Rainer Sigwald ce39dd4094
Add readonly to struct methods (#8656)
In recent dogfood VS builds we've gotten many IDE0251 suggestions, some warnings escalated to errors in StringTools. Follow many of those suggestions, but bump the rule down to suggestion always, like the related IDE0250.
2023-04-24 17:24:27 +08:00
Drew Noakes 457218b330
GetReferenceAssemblyPaths continues on error in design-time builds (#8660)
Contributes to dotnet/sdk#19506

This fixes an issue where VS design-time builds would fail when reference assemblies could not be found.

By allowing the design-time build to continue, the .NET Project System will the nominate a restore which may bring in a package that provides those reference assemblies.

Without this addition, the task will fail and the build will end early, such that the restore does not occur and progress is not made.

This helps when users do not have targeting packs installed (such as for out-of-support versions of .NET Framework, like v4.5). With this change, a reference assembly package (like Microsoft.NETFramework.ReferenceAssemblies.net45) may be downloaded for the user to compile against.

Tested locally. See discussion in linked issue for further details.
2023-04-24 16:35:20 +08:00
dotnet-maestro[bot] b3ac0807c1
[main] Update dependencies from dotnet/arcade (#8658)
This pull request updates the following dependencies

From https://github.com/dotnet/arcade
Subscription: fc4faec0-9ee6-43b9-bc7a-08da8607f4c7
Build: 20230421.7
Date Produced: April 21, 2023 7:07:19 PM UTC
Commit: 3d9c9a4d3d893e903bb3295fd5b55b8e40699888
Branch: refs/heads/release/6.0
Updates:
Microsoft.DotNet.Arcade.Sdk: from 6.0.0-beta.23167.1 to 6.0.0-beta.23221.7
Microsoft.DotNet.XUnitExtensions: from 6.0.0-beta.23167.1 to 6.0.0-beta.23221.7
2023-04-24 14:30:16 +08:00
dotnet-maestro[bot] f7c806d1e8
Update dependencies from https://github.com/nuget/nuget.client build 6.7.0.16 (#8675)
NuGet.Build.Tasks
 From Version 6.5.0-rc.149 -> To Version 6.7.0-preview.1.16

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Forgind <12969783+Forgind@users.noreply.github.com>
2023-04-23 15:57:43 +08:00
Jan Krivanek fbbcaf80df
Document references peculiarities (#8494)
Relates to:
#4795
#8405

Context
Documenting some aspect of tailoring behavior of references. Capturing as well resolution/workarounds for the listed comunity reported issues

---------

Co-authored-by: Rainer Sigwald <raines@microsoft.com>
2023-04-23 15:55:43 +08:00
Forgind f6feb85d91
Revert "Issue8273 corrupt nu get cache (#8275)" (#8686)
This reverts commit a93882f.

This is a temporary fix for #8684

The current plan is to revert #8275 in 17.6, as it caused some difficulties, and try to bring it back in 17.7 via #8685.

Summary

#8275 fixed a longstanding confusing and unfortunate behavior in MSBuild in which passing the Copy task a symlink as its destination would copy the source file onto the destination of the symlink rather than overwriting the symlink. Unfortunately, it also introduced a new issue in which copying a file onto itself could often just delete the file instead of copying anything. Customers reported this issue.

Customer Impact

Projects that copy a file onto itself using the Copy task without passing identical paths for source and destination instead delete the file without necessarily even logging an error.

Regression?
Yes, from #8275.

Testing

Unit tests and manually tested that the repro described in #8684 no longer works.

Risk
Minimal (straight revert of the commit that caused the bug)
---------

Co-authored-by: Forgind <Forgind@users.noreply.github.com>
2023-04-23 15:44:54 +08:00
Jared Parsons 10a1f7a10d
Update Providing-Binary-Logs.md (#8690)
Need to include `""` around the path in the Powershell case
2023-04-23 15:41:28 +08:00
Jan Krivanek a04edfd6d3
Ensure metadata location when created from xml element with known location (#8599)
Fixes #8579

Context
MetadataElement of an ItemElement doesn't have line&col of Location set despite those are created from known xml.
This way errors referencing the Location from metadata would end up pointing to location (0, 0) in the file.

Reason
This happens only to XmlElementWithLocation (as opposed to XmlAttributeWithLocation) during creating XmlElementWithLocation from scratch (during parsing phase that doesn't have the reader with locations already available) from an existing XmlAttributeWithLocation (that has the proper location intitialized from Load phase). Due to the need to keep the constructors contract (we override existing XmlElement), we cannot pass the additional info in the constructor.

Changes Made
Making the Location property of XmlElementWithLocation writable - so that it can be properly rewritten if constructed from an existing node with available location info.

Testing
Hand testing plus applying the changfe to the other PR: #8581, solved the issue with (0, 0) warnings location

Note
This or #8581 PR (whichever is merged later) should remove the workaround https://github.com/dotnet/msbuild/pull/8581/files#diff-e289ba4ce7fa0e72cf63049cce595eafcad1e7b2034ccb3305cd0f06c2f822b8R196-R197
2023-04-23 15:07:10 +08:00
Rainer Sigwald 684efac3e9
NoProfile in ToolTaskThatTimeoutAndRetry test (#8659)
This failed for me in an unrelated PR and on my dev box and at least on my dev box it was because sometimes my PowerShell profile took longer than 1 second to process.

Pass -NoProfile to avoid that time entirely when it's not necessary.

In addition, save the engine's log to the test log to give some clues if the test fails again.
2023-04-23 14:35:49 +08:00
Marc Paine ac3f5ad89f
Add tsa config file to enable validation pipeline (#8666)
Context
MSBuild had been added to the code validation pipeline but was missing the tsa config file. Per the instructions here and after talking to Matt, adding this file

Changes Made
Added a tsa config file by copying from SDK

Testing
Not sure how to test this. I pushed an internal build but the checks didn't run as I'm told they run nightly in a separate pipeline.

Notes
Validation pipeline: https://dev.azure.com/dnceng/internal/_build/results?buildId=2157183&view=results
2023-04-21 15:40:43 +08:00
Jan Krivanek b1223ce6ba
Do not call MatchCount when count is not needed (#8680)
Relates to https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1728887/

Context
ItemSpecFragment.MatchCount result is thrown away when called from ItemExpressionFragment.MatchCount (it just needs to get info about existing match).

The mentioned codepath is on the stack of the detected UI delay. While it might not be the rootcause, it doesn't hurt to improve this behavior.

Thanks @davkean for specific suggestions pointers during ivestigation
2023-04-21 15:00:16 +08:00
Matt Mitchell d634ea0c4e
Enable prebuilt detection (#8678)
* Enable prebuilt detection
- Baseline a 7.0 dependencies until msbuild targets net8.0 and uses an 8.0 arcade and an arcade fix comes in
- Add SBRP dependencies (with subscription) and source build tags
2023-04-19 20:13:40 +00:00
Rainer Sigwald 40975df1a0
Revert "Avoid package dependencies on inbox libraries (#8669)" (#8679)
This reverts commit 8326396cb4 because it causes component governance alerts.
2023-04-19 14:23:04 +00:00
Rainer Sigwald ac0b9a2a5b
Revert ".NET projects produce a reference assembly by default (#8571)" (#8677)
This reverts commit 6487653406.
2023-04-19 08:46:36 -05:00
Viktor Hofer 8326396cb4
Avoid package dependencies on inbox libraries (#8669)
System.Security.Principal.Windows is inbox since net6.0
System.Net.Http is inbox since netcoreapp2.0
System.Reflection.Metadata is inbox since netcoreapp2.0
System.Threading.Tasks.Dataflow is inbox since netcoreapp2.0
Remove System.Net.Http package references which aren't needed as they underlying assembly is inbox on both .NETFramework and .NETCoreApp.
By avoiding the dependencies, we minimize the dependency graph and with that the attack surface.

cc @MichaelSimons (removes netstandard1.x dependencies)
2023-04-19 09:49:45 +08:00
Dmitriy Shepelev 65a40415b7
Update `ProjectReference` docs (#8434)
Update documentation given the merge of #8249, #8257, and #8330.

---------

Co-authored-by: Rainer Sigwald <raines@microsoft.com>
2023-04-19 09:42:28 +08:00
Rainer Sigwald 2cbc8b6aef
Unify "used response file" messages (#8665)
In #8608 I introduced a new string for this, but it's redundant with the one we already had that we only used to log to the console.

Dropping the "log directly to console" approach because we now (18 years later) have deferred messages, the engine API that someone didn't want to add.
2023-04-17 10:41:20 +08:00
Jenny Bai 8697ca39de
Update sdk version to bump pulled runtime 2023-04-17 09:45:56 +08:00
Jan Krivanek cc55017f88
Log item self-expansion (#8581)
Fixes #8527

Context
Self referencing item metadata in an item definition within the target leads to possible unintended expansion (and cross-applying of pre-existing item instances).

This behavior is not a bug - it's the implication of the target batching feature - but might be confusing. So detection and warning is added here

Changes Made
A self reference (qualified or unqualified) of metadata within the item defeiniton (which is within a target) is detected and high importance message is issued.

Testing
Tests added for a warning case and for a non-warning case (self-referencing metadata outside of target context)

Doc
https://github.com/MicrosoftDocs/visualstudio-docs-pr/pull/11034

Possible impact
It's unfortunately hard to obtain data on prevalence of this pattern due to limitations of available code searches (github search doesn't support '@' sign and no escaping option; SourceGraph, grep.app doesn't support regex lookaheads). So I cannot quantify (I'll try again later on).
But there are some sparse evidence of usage:

https://github.com/JeremyAnsel/JeremyAnsel.HLSL.Targets/blob/master/JeremyAnsel.HLSL.Targets/JeremyAnsel.HLSL.Targets/JeremyAnsel.HLSL.Targets.csproj#L49
https://github.com/neuecc/MessagePack-CSharp/blob/master/src/MessagePack.MSBuild.Tasks/MessagePack.MSBuild.Tasks.csproj#L35
https://github.com/dotnet/aspnetcore/blob/main/eng/AfterSigning.targets#L22
all of those seem to be doing something else then intended (the variable part of path is empty, so it gets just the base directory), but they do not break.

tl;dr;: unless we are able to better quantify, we might resort to demote the warning to a message Demoted to Message severity
2023-04-14 12:06:27 +08:00
Jan Krivanek cb5e760644
Add diagnostics to symlink embedding unittest (#8653)
Adding diagnostics to flaky test - to have more data on future repro
(logging the actual list of embedded files)
2023-04-12 17:23:14 -05:00
Drew Noakes 6487653406
.NET projects produce a reference assembly by default (#8571)
In general we want to produce reference assemblies whenever possible, as they improve incremental build performance.

Making them work end-to-end requires support from other components, such as fast up-to-date checks in VS. While support was originally added for SDK-style projects, it was not present for legacy `.csproj` files. Accordingly, `ProduceReferenceAssemblies` was set `true` only when the target framework was `net5.0` or later for C#/VB projects. Similarly, F# added support during `net7.0`, so a similar check was added for F# projects.

VS 17.5 ships support for reference assemblies in the legacy CSPROJ fast up-to-date check, so all C#/VB projects are supported. Similarly, F# has full support. Consequently, it is now safe to enable the production and consumption of reference assemblies across all .NET project types, including .NET Framework, .NET Standard, .NET Core and .NET.

This commit changes the default `ProduceReferenceAssembly` value to `true` for all .NET projects that don't set `ProduceOnlyReferenceAssembly`.
2023-04-12 17:22:51 -05:00
Rainer Sigwald a478b9dda0 Merge remote-tracking branch 'vs17.6' 2023-04-12 12:20:11 -05:00
Rainer Sigwald 78cc219f08 Regression test for #8645
Add a test task with properties like the failing WiX tasks to prevent
regressions of #8645.
2023-04-12 12:17:45 -05:00
Rainer Sigwald 073c84ec2b
Merge pull request #8619 from dotnet/livelogger
Re-implemented LiveLogger based on the https://www.github.com/rainersigwald/tortillachip prototype. Since the visual design is not yet finalized, the strings are still hardcoded in source files.
2023-04-12 11:25:11 -05:00
Ladi Prosek 6b0a1c0fd4 Add LiveLogger to MSBuild.exe as well 2023-04-12 16:40:29 +02:00
Rainer Sigwald 8ffc3fe3dc
Avoid overly-specific cast in bulk metadata copy (#8646)
The return value of `ITaskItem.CloneCustomMetadata` is an `IDictionary`,
which is generally (in modern MSBuild) backed by a
`Dictionary<string, string>`, but can be (when given an item from a
net35 taskhost) a `Hashtable`. In the latter situation, casting entries
to `KeyValuePair<,>` fails, because they conform only to
`DictionaryEntry`.

Use that less-well-typed approach--the casts were present in the pre-
bulk-edit version of the code. Fixes #8645.
2023-04-11 12:36:40 -05:00
Ladi Prosek 3a6a34d243 Merge remote-tracking branch 'dotnet/main' into livelogger 2023-04-11 12:33:10 +02:00
Ladi Prosek 2caea922c0 Print project names without extension 2023-04-11 12:29:07 +02:00
Rainer Sigwald 11df683c8e Track restore via node status
This is more responsive and keeps the counter on screen
at all times at the cost of giving up any hope of understanding
what's going on within the restore.
2023-04-10 13:53:01 -05:00
Rainer Sigwald 4c88a51aba Try to tone down the emoji
Use variation selector to try to display as a symbol instead of an emoji.
2023-04-10 10:14:56 -05:00
Rainer Sigwald 6941938440 Mark node idle when it finishes a project
I was noticing a bunch of nodes that seemed "stuck" on targets that shouldn't take a long time--turns out they were done with that + idle but never got marked as such so they kept counting up confusingly.
2023-04-10 10:06:09 -05:00
dotnet bot c75672a6e7
Localized file check-in by OneLocBuild Task: Build definition ID 9434: Build ID 7598404 (#8648) 2023-04-07 20:19:13 +00:00
Jonathan Dodds e2fa2d70f5
Add bit shift intrinsic functions (#8569)
* add LeftShift, RightShift, RightShiftUnsigned intrinsic functions

* Add "fast path" for all bit operator functions; change unit test to use Shouldly because fail messages will show the name of the failing function

* Update to standardize on invoking IntrinsicFunctions methods, and add missing Modulo

* Add IntrinsicFunctions.Unescape
2023-04-07 14:17:23 -05:00
Jonathan Dodds 1af12df6e8
Don't build a solution when -preprocess or -targets is passed on the command line (#8588)
The -preprocess or -targets options are not supported for .sln files and, when these options are supplied, the .sln is built.

With this change the .sln will not be built.
2023-04-07 14:15:31 -05:00
Ladi Prosek 66dace7d55
Delete src/MSBuild/Properties/launchSettings.json (#8637)
`src/MSBuild/Properties/launchSettings.json` was added to the repo as part of #8012 by mistake.
2023-04-07 14:12:20 -05:00
Rainer Sigwald 00ef5435a2
Doc commments for ParameterizedSwitchInfo (#8644)
These comments were hidden where they didn't helpfully show when I was adding a new `ParameterizedSwitchInfo`.
2023-04-07 14:11:47 -05:00
David Federman 5fbc2955e8
Fix static graph restore functionality for the bootstrap (#8488)
Today the bootstrap doesn't have `NuGet.RestoreEx.targets` (or `NuGet.Build.Tasks.Console.exe` even), so it falls back to the "regular" restore. This change brings in those bits via the `NuGet.Build.Tasks.Console` package.
2023-04-07 14:04:25 -05:00