Repository navigation
[main] Source code updates from dotnet/msbuild - #7406
Conversation
|
Note PRs from original repository included in this codeflow update:
💡 You may consult the FAQ for more information or tag @dotnet/prodconsvcs for assistance. |
SB_Offline Failure AnalysisThe Symptom: runtime's Suspected root cause: The new Filed: dotnet/msbuild#14190 This PR should not be merged until the msbuild regression is resolved. /cc @dotnet/msbuild-maintainers |
|
Note PRs from original repository included in this codeflow update: 💡 You may consult the FAQ for more information or tag @dotnet/prodconsvcs for assistance. |
…calls (#14191) ## Summary `FindPublicMethodBySignature` (introduced in #14079) uses `_receiverType.GetMethods()` without binding flags, which returns all public methods including static ones. When resolving an instance call like `String.Equals` with types `[string, string]`, it incorrectly matches the **static** `String.Equals(String, String)` overload instead of falling through to `CoerceArguments` which would parse the enum string argument (`"StringComparison.InvariantCulture"`) correctly. The old `Type.GetMethod(name, bindingFlags, null, types, null)` respected `BindingFlags.Instance` and excluded static methods, so it returned null and correctly fell through to enum coercion. ## Fix Pass `_bindingFlags` to `GetMethods()` so it filters by instance/static correctly, matching the behavior of the replaced code. ## Reproduction The bug breaks any MSBuild condition using instance methods with enum parameters passed as strings. For example, runtime's `Directory.Build.targets`: ```xml Condition="!$(TargetOS.Equals($(TargetOS.ToLower()), StringComparison.InvariantCulture))" ``` This fires an error claiming `TargetOS='linux'` is not lowercase, because `String.Equals("linux", "StringComparison.InvariantCulture")` (static, ordinal comparison) returns `false`. Reproduced locally by building MSBuild from commit 161f9ea and running against a minimal test project. Fix verified. ## Impact This regression blocks the msbuild flow PR to the VMR (dotnet/dotnet#7406) — the `SB_CentOSStream10_Offline` leg fails because it's the first consumer of the newly-built MSBuild. Fixes #14190 --------- Co-authored-by: Copilot <[email protected]>
|
Note PRs from original repository included in this codeflow update:
💡 You may consult the FAQ for more information or tag @dotnet/prodconsvcs for assistance. |
|
This pull request only contains source updates from https://github.com/dotnet/msbuild between commits 33d17672fac4c26656a201774f9894dff51a4e78 and f795830904f855e65ef5bb47cc33bba363b4b7a5. |
|
looks like building the analyzer caused some prebuilts: |
|
msbuild depends on roslyn when building source only: https://github.com/dotnet/dotnet/blob/main/repo-projects/msbuild.proj#L13 All the dependencies are compile-time only:
|
|
@ViktorHofer I don't think we have very hard roslyn dependencies here - it should be able to be latest for source build. I'd expect this to only matter for running the analyzer on the source-build SDK itself - end users of a source-built SDK would instead prefer to use the package from NuGet.org, yeah? |
[[ commit created by automation ]]
|
Note PRs from original repository included in this codeflow update:
💡 You may consult the FAQ for more information or tag @dotnet/prodconsvcs for assistance. |
|
This pull request only contains source updates from https://github.com/dotnet/msbuild between commits 33d17672fac4c26656a201774f9894dff51a4e78 and b2bc777aa3afa4660ee77c78af5ab133aee52d94. |
|
Producing the package when building msbuild from source is just so that you don't have condition its usage out when building other repositories source-only. The package that will eventually reach nuget.org (when we decide to make it a shipping asset) will come from msbuild's main vertical (win-x64) same as other packages like Microsoft.Build.Framework. If we would ever decide to put the analyzer inbox into the msbuild shipping assets in the SDK then that should be fine either as the compiler would be latest there as well (for pretty much all scenarios except design-time afaik). So yes, previously-source-built-artifacts (PSB) is very likely the way to go here. As noted above that means defining the dependencies in msbuild's Version.Details.xml and Version.Details.props files. |
[[ commit created by automation ]]
|
Note PRs from original repository included in this codeflow update:
💡 You may consult the FAQ for more information or tag @dotnet/prodconsvcs for assistance. |
|
This pull request only contains source updates from https://github.com/dotnet/msbuild between commits 33d17672fac4c26656a201774f9894dff51a4e78 and 0d172d97d0d7de3c1d4d8d9c7d2b0257c9089930. |
…n.Details for source-build Cherry-pick of dotnet/msbuild#14247 (commit e6072821c1) into src/msbuild to validate the source-build prebuilt fix in the VMR before the msbuild PR merges. Declares Microsoft.CodeAnalysis.CSharp/.CSharp.Workspaces (4.12.0) and Microsoft.CodeAnalysis.Analyzers (3.11.0) in eng/Version.Details.xml (empty Sha) so source-build redirects them to the live source-built Roslyn, avoiding the prebuilt package violation from src/TaskAnalyzer. Co-authored-by: Copilot <[email protected]>
|
@mthalman IIRC you solved similar analyzer <--> compiler issues in the past in other repositories. Can you please take a look at the failure and recommend a path forward? The issue right now is that we defined roslyn dependencies in msbuild's Version.Details.xml which makes the analyzers come from PSB (with a 5.10.0.0 assembly version) while the compiler is older (5.8.0.0). Do we need to somehow flow the PSB version in and use that? |
…d Version.Details for source-build" This reverts commit 5730288.
…4209) Remove src/TaskAnalyzer/TaskAnalyzer.csproj from MSBuild.SourceBuild.slnf. Building the analyzer in source-build pulls Roslyn analyzer packages that are either prebuilt violations or (once redirected to source-built Roslyn) reference a newer compiler than the bootstrap compiler (CS9057). Backing out #14209 in the VMR unblocks codeflow; the analyzer source-build support will be revisited with the source-build team. This revert will flow back to dotnet/msbuild. Co-authored-by: Copilot <[email protected]>
|
Reverted dotnet/msbuild#14209 to unblock. |
[main] Source code updates from nuget/nuget.client - Fix CS8602/CS8600 in TemplateEngine NuGet helpers after nuget.client dotnet#7406 NuGet/NuGet.Client PR dotnet#7406 ("Enable nullable for NuGet.Protocol repository abstractions") changed SourceRepository.GetResourceAsync<T> to return Task<T?>, matching the long-standing XML doc contract ("Null if the resource does not exist"). Consumers in sdk's TemplateEngine NuGet helpers were storing the result in non-nullable locals and dereferencing immediately, producing CS8600/CS8602 under nullable-enabled compilation with TreatWarningsAsErrors=true. Mirror the same pattern nuget.client now uses internally (SourceRepository.GetFeedType): throw InvalidOperationException if a provider cannot produce the requested resource, then proceed with a non-null value. Fixed 4 call sites across 2 files: src/Cli/Microsoft.TemplateEngine.Cli/NuGet/NugetApiManager.cs - GetResourceAsync<PackageMetadataResource> - GetResourceAsync<PackageSearchResource> test/TemplateEngine/Microsoft.TemplateEngine.TestHelper/PackageManager.cs - GetResourceAsync<FindPackageByIdResource> - GetResourceAsync<PackageMetadataResource> Co-authored-by: Copilot <[email protected]> - Fix CS8600/CS8602/CS8618 in NugetPackProvider after nuget.client dotnet#7406 Repository.GetResource<T>() is now annotated to return T? (matching the documented null-on-missing behavior). The TemplateSearch.TemplateDiscovery tool dereferences the result and stores it in a non-nullable field, so the build fails with CS8600/CS8602/CS8618. Throw InvalidOperationException when the source does not provide the requested resource, matching the pattern used in NugetApiManager.cs and PackageManager.cs (and mirroring nuget.client's own internal SourceRepository.GetFeedType adoption). Co-authored-by: Copilot <[email protected]> - Fix CS8600 in NugetPackProvider.GetPackageInfoAsync after nuget.client dotnet#7406 GetResourceAsync<PackageMetadataResource> now returns Task<T?> — add null check with InvalidOperationException, matching the pattern used elsewhere. Co-authored-by: Copilot <[email protected]>
…t#6927) [release/10.0.4xx] Source code updates from nuget/nuget.client - Fix CS8602/CS8600 in TemplateEngine NuGet helpers after nuget.client dotnet#7406 NuGet/NuGet.Client PR dotnet#7406 ("Enable nullable for NuGet.Protocol repository abstractions") changed SourceRepository.GetResourceAsync<T> to return Task<T?>, matching the long-standing XML doc contract ("Null if the resource does not exist"). Consumers in sdk's TemplateEngine NuGet helpers were storing the result in non-nullable locals and dereferencing immediately, producing CS8600/CS8602 under nullable-enabled compilation with TreatWarningsAsErrors=true. Mirror the same pattern nuget.client now uses internally (SourceRepository.GetFeedType): throw InvalidOperationException if a provider cannot produce the requested resource, then proceed with a non-null value. Fixed 4 call sites across 2 files: src/Cli/Microsoft.TemplateEngine.Cli/NuGet/NugetApiManager.cs - GetResourceAsync<PackageMetadataResource> - GetResourceAsync<PackageSearchResource> test/TemplateEngine/Microsoft.TemplateEngine.TestHelper/PackageManager.cs - GetResourceAsync<FindPackageByIdResource> - GetResourceAsync<PackageMetadataResource> Co-authored-by: Copilot <[email protected]>

Note
This is a codeflow update. It may contain both source code changes from
the source repo
as well as dependency updates. Learn more here.
This pull request brings the following source code changes
From https://github.com/dotnet/msbuild
Diff the source with this PR branch