From bc18a62d2d9364e0c50967ce6e072e5dd903308f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sat, 17 May 2025 02:03:06 +0000 Subject: [PATCH 1/2] =?UTF-8?q?[roslyn]=20Source=20update=20015a854=20?= =?UTF-8?q?=E2=86=92=20a1b9c9b=20Diff:=20https://github.com/dotnet/roslyn/?= =?UTF-8?q?compare/015a854ffc3fc7660eca31b0ffe168ea8d1d65a0..a1b9c9b6b820e?= =?UTF-8?q?1267893d090fce4392c6cd7c50f?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: https://github.com/dotnet/roslyn/commit/015a854ffc3fc7660eca31b0ffe168ea8d1d65a0 To: https://github.com/dotnet/roslyn/commit/a1b9c9b6b820e1267893d090fce4392c6cd7c50f [[ commit created by automation ]] --- prereqs/git-info/roslyn.props | 6 +- src/roslyn/SpellingExclusions.dic | 11 +- .../CSharp/Portable/CodeGen/EmitExpression.cs | 7 - .../Symbols/Source/SourceModuleSymbol.cs | 8 + .../Test/Emit/Emit/EmitMetadataTests.cs | 149 +++++++++++------- .../{BinlogNamer.cs => BinLogPathProvider.cs} | 11 +- .../FileBasedProgramsProjectSystem.cs | 4 +- ...leBasedProgramsWorkspaceProviderFactory.cs | 5 +- .../LanguageServerProjectLoader.cs | 10 +- .../LanguageServerProjectSystem.cs | 4 +- .../HostWorkspace/VirtualProject.cs | 140 +++++++++++----- .../Core/MSBuild/BuildHostProcessManager.cs | 10 +- .../Core/MSBuild/IBinLogPathProvider.cs | 15 ++ .../Test/BuildHostProcessManagerTests.cs | 6 +- src/source-manifest.json | 6 +- 15 files changed, 259 insertions(+), 133 deletions(-) rename src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/{BinlogNamer.cs => BinLogPathProvider.cs} (83%) create mode 100644 src/roslyn/src/Workspaces/MSBuild/Core/MSBuild/IBinLogPathProvider.cs diff --git a/prereqs/git-info/roslyn.props b/prereqs/git-info/roslyn.props index 986dc499579..8b252a4c3fd 100644 --- a/prereqs/git-info/roslyn.props +++ b/prereqs/git-info/roslyn.props @@ -1,8 +1,8 @@  - 015a854ffc3fc7660eca31b0ffe168ea8d1d65a0 - 20250515.6 - 5.0.0-1.25265.6 + a1b9c9b6b820e1267893d090fce4392c6cd7c50f + 20250516.2 + 5.0.0-1.25266.2 \ No newline at end of file diff --git a/src/roslyn/SpellingExclusions.dic b/src/roslyn/SpellingExclusions.dic index 3d49d6e1f80..6bcf960f73f 100644 --- a/src/roslyn/SpellingExclusions.dic +++ b/src/roslyn/SpellingExclusions.dic @@ -1,7 +1,6 @@ -stackalloc +stackalloc awaitable -Refactorings -Infos -cref -binlog -Namer +Refactorings +Infos +cref +binlog \ No newline at end of file diff --git a/src/roslyn/src/Compilers/CSharp/Portable/CodeGen/EmitExpression.cs b/src/roslyn/src/Compilers/CSharp/Portable/CodeGen/EmitExpression.cs index c1191eba65e..f54ef8c0535 100644 --- a/src/roslyn/src/Compilers/CSharp/Portable/CodeGen/EmitExpression.cs +++ b/src/roslyn/src/Compilers/CSharp/Portable/CodeGen/EmitExpression.cs @@ -3487,13 +3487,6 @@ private void EmitConstantExpression(TypeSymbol type, ConstantValue constantValue } else { - // TODO: use-site dependencies are not reported to UsedAssemblyReferences https://github.com/dotnet/roslyn/issues/78172 - if (constantValue.IsString && constantValue.StringValue.Length > _module.Compilation.DataSectionStringLiteralThreshold) - { - _ = Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_Text_Encoding__get_UTF8, _diagnostics, syntax: syntaxNode); - _ = Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_Text_Encoding__GetString, _diagnostics, syntax: syntaxNode); - } - _builder.EmitConstantValue(constantValue, syntaxNode); } } diff --git a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Source/SourceModuleSymbol.cs b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Source/SourceModuleSymbol.cs index 1018ea9ba53..0dcce524cce 100644 --- a/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Source/SourceModuleSymbol.cs +++ b/src/roslyn/src/Compilers/CSharp/Portable/Symbols/Source/SourceModuleSymbol.cs @@ -244,6 +244,14 @@ internal override void ForceComplete(SourceLocation? locationOpt, Predicate "abc";""")] + [InlineData("""public static void M(string s) { switch (s) { case "abc": break; } }""")] + public void DataSectionStringLiterals_UsedAssemblyReferences(string code) + { + var source1 = """ + namespace System + { + public class Object; + public class String + { + public static bool op_Equality(string a, string b) => false; + } + public class ValueType; + public struct Void; + public struct Byte; + public struct Int16; + public struct Int32; + public struct Int64; + public struct Boolean; + public class Attribute; + public class Enum; + public enum AttributeTargets; + public class AttributeUsageAttribute + { + public AttributeUsageAttribute(AttributeTargets validOn) { } + public bool AllowMultiple { get; set; } + public bool Inherited { get; set; } + } + } + """; + var ref1 = CreateEmptyCompilation(source1, assemblyName: "MinimalCoreLib").VerifyDiagnostics().EmitToImageReference(); + + var source2 = """ + namespace System.Text + { + public class Encoding + { + public static Encoding UTF8 => null; + public unsafe string GetString(byte* bytes, int byteCount) => null; + } + } + """; + var ref2 = CreateEmptyCompilation(source2, [ref1], options: TestOptions.UnsafeDebugDll, assemblyName: "Encoding") + .VerifyDiagnostics().EmitToImageReference(); + + var source3 = $$""" + public static class C + { + {{code}} + } + """; + var comp = CreateEmptyCompilation(source3, [ref1, ref2], assemblyName: "Lib1"); + AssertEx.SetEqual([ref1], comp.GetUsedAssemblyReferences()); + comp.VerifyEmitDiagnostics(); + + comp = CreateEmptyCompilation(source3, [ref1, ref2], assemblyName: "Lib2", + parseOptions: TestOptions.Regular.WithFeature("experimental-data-section-string-literals", "0")); + AssertEx.SetEqual([ref1, ref2], comp.GetUsedAssemblyReferences()); + comp.VerifyEmitDiagnostics(); + } + [Fact] public void DataSectionStringLiterals_InvalidUtf8() { @@ -3561,8 +3591,7 @@ public class InvalidOperationException(); """; var parseOptions = TestOptions.RegularPreview - .WithNoRefSafetyRulesAttribute() - .WithFeature("experimental-data-section-string-literals", "0"); + .WithNoRefSafetyRulesAttribute(); CompileAndVerify(CreateEmptyCompilation(source, parseOptions: parseOptions), verify: Verification.Skipped, @@ -3587,6 +3616,16 @@ public class InvalidOperationException(); .VerifyDiagnostics( // warning CS8021: No value for RuntimeMetadataVersion found. No assembly containing System.Object was found nor was a value for RuntimeMetadataVersion specified through options. Diagnostic(ErrorCode.WRN_NoRuntimeMetadataVersion).WithLocation(1, 1)); + + // NOTE: If the feature is enabled by default in the future, it should not fail in case of missing Encoding members + // (it should be automatically disabled instead and could warn) to avoid regressing the scenario above. + CreateEmptyCompilation(source, + parseOptions: parseOptions.WithFeature("experimental-data-section-string-literals", "0")) + .VerifyDiagnostics( + // error CS0656: Missing compiler required member 'System.Text.Encoding.get_UTF8' + Diagnostic(ErrorCode.ERR_MissingPredefinedMember).WithArguments("System.Text.Encoding", "get_UTF8").WithLocation(1, 1), + // error CS0656: Missing compiler required member 'System.Text.Encoding.GetString' + Diagnostic(ErrorCode.ERR_MissingPredefinedMember).WithArguments("System.Text.Encoding", "GetString").WithLocation(1, 1)); } [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/76707")] diff --git a/src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/BinlogNamer.cs b/src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/BinLogPathProvider.cs similarity index 83% rename from src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/BinlogNamer.cs rename to src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/BinLogPathProvider.cs index c2535e2923d..05958b1a0a7 100644 --- a/src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/BinlogNamer.cs +++ b/src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/BinLogPathProvider.cs @@ -4,14 +4,15 @@ using System.Composition; using Microsoft.CodeAnalysis.Host.Mef; +using Microsoft.CodeAnalysis.MSBuild; using Microsoft.CodeAnalysis.Options; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.Composition; namespace Microsoft.CodeAnalysis.LanguageServer.HostWorkspace; -[Export(typeof(BinlogNamer)), Shared] -internal sealed class BinlogNamer +[Export(typeof(IBinLogPathProvider)), Shared] +internal sealed class BinLogPathProvider : IBinLogPathProvider { /// /// The suffix to use for the binary log name; incremented each time we have a new build. Should be incremented with . @@ -28,13 +29,13 @@ internal sealed class BinlogNamer [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public BinlogNamer(IGlobalOptionService globalOptionService, ILoggerFactory loggerFactory) + public BinLogPathProvider(IGlobalOptionService globalOptionService, ILoggerFactory loggerFactory) { _globalOptionService = globalOptionService; - _logger = loggerFactory.CreateLogger(); + _logger = loggerFactory.CreateLogger(); } - internal string? GetMSBuildBinaryLogPath() + public string? GetNewLogPath() { if (_globalOptionService.GetOption(LanguageServerProjectSystemOptionsStorage.BinaryLogPath) is not string binaryLogDirectory) return null; diff --git a/src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileBasedProgramsProjectSystem.cs b/src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileBasedProgramsProjectSystem.cs index 4b229d8497a..f60b31557ee 100644 --- a/src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileBasedProgramsProjectSystem.cs +++ b/src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileBasedProgramsProjectSystem.cs @@ -41,7 +41,7 @@ public FileBasedProgramsProjectSystem( IAsynchronousOperationListenerProvider listenerProvider, ProjectLoadTelemetryReporter projectLoadTelemetry, ServerConfigurationFactory serverConfigurationFactory, - BinlogNamer binlogNamer) + IBinLogPathProvider binLogPathProvider) : base( workspaceFactory.FileBasedProgramsProjectFactory, workspaceFactory.TargetFrameworkManager, @@ -52,7 +52,7 @@ public FileBasedProgramsProjectSystem( listenerProvider, projectLoadTelemetry, serverConfigurationFactory, - binlogNamer) + binLogPathProvider) { _lspServices = lspServices; _logger = loggerFactory.CreateLogger(); diff --git a/src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileBasedProgramsWorkspaceProviderFactory.cs b/src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileBasedProgramsWorkspaceProviderFactory.cs index d7c63e9f2ae..de90d3175e2 100644 --- a/src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileBasedProgramsWorkspaceProviderFactory.cs +++ b/src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/FileBasedProgramsWorkspaceProviderFactory.cs @@ -8,6 +8,7 @@ using Microsoft.CodeAnalysis.LanguageServer.Handler; using Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.ProjectTelemetry; using Microsoft.CodeAnalysis.MetadataAsSource; +using Microsoft.CodeAnalysis.MSBuild; using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.ProjectSystem; using Microsoft.CodeAnalysis.Shared.TestHooks; @@ -33,10 +34,10 @@ internal sealed class FileBasedProgramsWorkspaceProviderFactory( IAsynchronousOperationListenerProvider listenerProvider, ProjectLoadTelemetryReporter projectLoadTelemetry, ServerConfigurationFactory serverConfigurationFactory, - BinlogNamer binlogNamer) : ILspMiscellaneousFilesWorkspaceProviderFactory + IBinLogPathProvider binLogPathProvider) : ILspMiscellaneousFilesWorkspaceProviderFactory { public ILspMiscellaneousFilesWorkspaceProvider CreateLspMiscellaneousFilesWorkspaceProvider(ILspServices lspServices, HostServices hostServices) { - return new FileBasedProgramsProjectSystem(lspServices, metadataAsSourceFileService, workspaceFactory, fileChangeWatcher, globalOptionService, loggerFactory, listenerProvider, projectLoadTelemetry, serverConfigurationFactory, binlogNamer); + return new FileBasedProgramsProjectSystem(lspServices, metadataAsSourceFileService, workspaceFactory, fileChangeWatcher, globalOptionService, loggerFactory, listenerProvider, projectLoadTelemetry, serverConfigurationFactory, binLogPathProvider); } } diff --git a/src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectLoader.cs b/src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectLoader.cs index d97745c2edb..b16e6c6ccf0 100644 --- a/src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectLoader.cs +++ b/src/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectLoader.cs @@ -43,7 +43,7 @@ internal abstract class LanguageServerProjectLoader protected readonly ILoggerFactory LoggerFactory; private readonly ILogger _logger; private readonly ProjectLoadTelemetryReporter _projectLoadTelemetryReporter; - private readonly BinlogNamer _binlogNamer; + private readonly IBinLogPathProvider _binLogPathProvider; protected readonly ImmutableDictionary AdditionalProperties; /// @@ -98,7 +98,7 @@ protected LanguageServerProjectLoader( IAsynchronousOperationListenerProvider listenerProvider, ProjectLoadTelemetryReporter projectLoadTelemetry, ServerConfigurationFactory serverConfigurationFactory, - BinlogNamer binlogNamer) + IBinLogPathProvider binLogPathProvider) { ProjectFactory = projectFactory; _targetFrameworkManager = targetFrameworkManager; @@ -108,7 +108,7 @@ protected LanguageServerProjectLoader( LoggerFactory = loggerFactory; _logger = loggerFactory.CreateLogger(nameof(LanguageServerProjectLoader)); _projectLoadTelemetryReporter = projectLoadTelemetry; - _binlogNamer = binlogNamer; + _binLogPathProvider = binLogPathProvider; var workspace = projectFactory.Workspace; var razorDesignTimePath = serverConfigurationFactory.ServerConfiguration?.RazorDesignTimePath; @@ -145,9 +145,7 @@ private async ValueTask ReloadProjectsAsync(ImmutableSegmentedList Path.ChangeExtension(documentFilePath, ".csproj"); + #region TODO: Copy-pasted from dotnet run-api. Delete when run-api is adopted. + // See https://github.com/dotnet/sdk/blob/b5dbc69cc28676ac6ea615654c8016a11b75e747/src/Cli/Microsoft.DotNet.Cli.Utils/Sha256Hasher.cs#L10 + private static class Sha256Hasher + { + public static string Hash(string text) + { + byte[] bytes = Encoding.UTF8.GetBytes(text); + byte[] hash = SHA256.HashData(bytes); +#if NET9_0_OR_GREATER + return Convert.ToHexStringLower(hash); +#else + return Convert.ToHexString(hash).ToLowerInvariant(); +#endif + } + + public static string HashWithNormalizedCasing(string text) + { + return Hash(text.ToUpperInvariant()); + } + } + + // TODO: this is a copy of SDK run-api code. Must delete when adopting run-api. + // See https://github.com/dotnet/sdk/blob/5a4292947487a9d34f4256c1d17fb3dc26859174/src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs#L449 + internal static string GetArtifactsPath(string entryPointFileFullPath) + { + // We want a location where permissions are expected to be restricted to the current user. + string directory = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) + ? Path.GetTempPath() + : Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); + + // Include entry point file name so the directory name is not completely opaque. + string fileName = Path.GetFileNameWithoutExtension(entryPointFileFullPath); + string hash = Sha256Hasher.HashWithNormalizedCasing(entryPointFileFullPath); + string directoryName = $"{fileName}-{hash}"; + + return Path.Join(directory, "dotnet", "runfile", directoryName); + } + #endregion + internal static (string virtualProjectXml, bool isFileBasedProgram) MakeVirtualProjectContent(string documentFilePath, SourceText text) { Contract.ThrowIfFalse(PathUtilities.IsAbsolute(documentFilePath)); @@ -30,48 +72,74 @@ internal static (string virtualProjectXml, bool isFileBasedProgram) MakeVirtualP var root = tree.GetRoot(); var isFileBasedProgram = root.GetLeadingTrivia().Any(SyntaxKind.IgnoredDirectiveTrivia) || root.ChildNodes().Any(node => node.IsKind(SyntaxKind.GlobalStatement)); + var artifactsPath = GetArtifactsPath(documentFilePath); + + var targetFramework = Environment.GetEnvironmentVariable("DOTNET_RUN_FILE_TFM") ?? "net10.0"; + var virtualProjectXml = $""" - + + + + false + {SecurityElement.Escape(artifactsPath)} + - - Exe - net8.0 - enable - enable - $(Features);FileBasedProgram - false - + + + + Exe + {SecurityElement.Escape(targetFramework)} + enable + enable + + + + false + + + + preview + + + + $(Features);FileBasedProgram + + + + + + + + + + + + + + + + + + - + <_RestoreProjectPathItems Include="@(FilteredRestoreGraphProjectInputItems)" /> + + + + + - - - - - - - - - - - <_RestoreProjectPathItems Include="@(FilteredRestoreGraphProjectInputItems)" /> - - - - - - """; diff --git a/src/roslyn/src/Workspaces/MSBuild/Core/MSBuild/BuildHostProcessManager.cs b/src/roslyn/src/Workspaces/MSBuild/Core/MSBuild/BuildHostProcessManager.cs index 057a90fafd4..5600ee46d9a 100644 --- a/src/roslyn/src/Workspaces/MSBuild/Core/MSBuild/BuildHostProcessManager.cs +++ b/src/roslyn/src/Workspaces/MSBuild/Core/MSBuild/BuildHostProcessManager.cs @@ -25,15 +25,15 @@ internal sealed class BuildHostProcessManager : IAsyncDisposable private readonly ImmutableDictionary _globalMSBuildProperties; private readonly ILoggerFactory? _loggerFactory; private readonly ILogger? _logger; - private readonly string? _binaryLogPath; + private readonly IBinLogPathProvider? _binaryLogPathProvider; private readonly SemaphoreSlim _gate = new(initialCount: 1); private readonly Dictionary _processes = []; - public BuildHostProcessManager(ImmutableDictionary? globalMSBuildProperties = null, string? binaryLogPath = null, ILoggerFactory? loggerFactory = null) + public BuildHostProcessManager(ImmutableDictionary? globalMSBuildProperties = null, IBinLogPathProvider? binaryLogPathProvider = null, ILoggerFactory? loggerFactory = null) { _globalMSBuildProperties = globalMSBuildProperties ?? ImmutableDictionary.Empty; - _binaryLogPath = binaryLogPath; + _binaryLogPathProvider = binaryLogPathProvider; _loggerFactory = loggerFactory; _logger = loggerFactory?.CreateLogger(); } @@ -244,10 +244,10 @@ private void AppendBuildHostCommandLineArgumentsConfigureProcess(ProcessStartInf AddArgument(processStartInfo, globalMSBuildProperty.Key + '=' + globalMSBuildProperty.Value); } - if (_binaryLogPath is not null) + if (_binaryLogPathProvider?.GetNewLogPath() is string binaryLogPath) { AddArgument(processStartInfo, "--binlog"); - AddArgument(processStartInfo, _binaryLogPath); + AddArgument(processStartInfo, binaryLogPath); } AddArgument(processStartInfo, "--locale"); diff --git a/src/roslyn/src/Workspaces/MSBuild/Core/MSBuild/IBinLogPathProvider.cs b/src/roslyn/src/Workspaces/MSBuild/Core/MSBuild/IBinLogPathProvider.cs new file mode 100644 index 00000000000..d2a47962f4d --- /dev/null +++ b/src/roslyn/src/Workspaces/MSBuild/Core/MSBuild/IBinLogPathProvider.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CodeAnalysis.MSBuild; + +internal interface IBinLogPathProvider +{ + /// + /// Returns a new log path. Each call will return a new name, so that way we don't have collisions if multiple processes are writing to different logs. + /// + /// A new path, or null if no logging is currently wanted. An instance is allowed to switch between return null and returning non-null if + /// the user changes configuration. + string? GetNewLogPath(); +} diff --git a/src/roslyn/src/Workspaces/MSBuild/Test/BuildHostProcessManagerTests.cs b/src/roslyn/src/Workspaces/MSBuild/Test/BuildHostProcessManagerTests.cs index 8db19e288e2..c89105505db 100644 --- a/src/roslyn/src/Workspaces/MSBuild/Test/BuildHostProcessManagerTests.cs +++ b/src/roslyn/src/Workspaces/MSBuild/Test/BuildHostProcessManagerTests.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Collections.Immutable; +using Moq; using Roslyn.Test.Utilities; using Xunit; @@ -65,7 +66,10 @@ internal void ProcessStartInfo_PassesBinLogPath(BuildHostProcessKind buildHostKi { const string BinaryLogPath = "test.binlog"; - var processStartInfo = new BuildHostProcessManager(binaryLogPath: BinaryLogPath) + var binLogPathProviderMock = new Mock(MockBehavior.Strict); + binLogPathProviderMock.Setup(m => m.GetNewLogPath()).Returns(BinaryLogPath); + + var processStartInfo = new BuildHostProcessManager(binaryLogPathProvider: binLogPathProviderMock.Object) .CreateBuildHostStartInfo(buildHostKind, pipeName: ""); #if NET diff --git a/src/source-manifest.json b/src/source-manifest.json index 377d95aef87..9e1c5829cc1 100644 --- a/src/source-manifest.json +++ b/src/source-manifest.json @@ -92,11 +92,11 @@ "commitSha": "6352a3201c903ffe907d9c7d2eb3a10507f1bd4e" }, { - "packageVersion": "5.0.0-1.25265.6", - "barId": 268491, + "packageVersion": "5.0.0-1.25266.2", + "barId": 268686, "path": "roslyn", "remoteUri": "https://github.com/dotnet/roslyn", - "commitSha": "015a854ffc3fc7660eca31b0ffe168ea8d1d65a0" + "commitSha": "a1b9c9b6b820e1267893d090fce4392c6cd7c50f" }, { "packageVersion": "10.0.0-preview.25263.1", From aa7a2f4357ea4f68e80bcffd7d600e17613bdf1d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sun, 18 May 2025 02:02:38 +0000 Subject: [PATCH 2/2] =?UTF-8?q?[roslyn]=20Source=20update=20a1b9c9b=20?= =?UTF-8?q?=E2=86=92=20c3c7ad6=20Diff:=20https://github.com/dotnet/roslyn/?= =?UTF-8?q?compare/a1b9c9b6b820e1267893d090fce4392c6cd7c50f..c3c7ad6a866dd?= =?UTF-8?q?0b857ad14ce683987c39d2b8fe0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: https://github.com/dotnet/roslyn/commit/a1b9c9b6b820e1267893d090fce4392c6cd7c50f To: https://github.com/dotnet/roslyn/commit/c3c7ad6a866dd0b857ad14ce683987c39d2b8fe0 [[ commit created by automation ]] --- prereqs/git-info/roslyn.props | 6 +- src/roslyn/Compilers.slnf | 4 +- src/roslyn/Roslyn.sln | 31 +++-- .../Core/MSBuildTask/Directory.Build.props | 71 ++++++++++++ .../Core/MSBuildTask/Directory.Build.targets | 34 ++++++ .../Microsoft.Build.Tasks.CodeAnalysis.csproj | 15 +++ .../Core/MSBuildTask/ManagedToolTask.cs | 59 +++------- .../Microsoft.Build.Tasks.CodeAnalysis.csproj | 108 ------------------ .../Microsoft.Managed.Core.targets | 8 +- .../src/Compilers/Core/MSBuildTask/README.md | 17 +++ ...rosoft.Build.Tasks.CodeAnalysis.Sdk.csproj | 26 +++++ .../Core/MSBuildTask/TaskTestHost.cs | 21 ---- .../Core/MSBuildTaskTests/CscTests.cs | 102 ----------------- .../MSBuildManagedToolTests.cs | 36 ++++++ ....Build.Tasks.CodeAnalysis.UnitTests.csproj | 2 +- ...ld.Tasks.CodeAnalysis.Sdk.UnitTests.csproj | 25 ++++ .../Core/SdkTaskTests/SdkManagedToolTests.cs | 42 +++++++ .../Roslyn.Compilers.Extension.csproj | 2 +- .../Extensions/ProtocolConversions.cs | 2 +- .../ProtocolUnitTests/Hover/HoverTests.cs | 42 +++++++ ...osoft.Net.Compilers.Toolset.Package.csproj | 7 +- .../Microsoft.Net.Compilers.Toolset.props | 1 + .../DesktopCompilerArtifacts.targets | 19 ++- ...Compilers.Toolset.Framework.Package.csproj | 2 +- ...Net.Compilers.Toolset.Arm64.Package.csproj | 2 +- .../VS.Tools.Roslyn.Package.csproj | 2 +- .../CompilersPackage/CompilersPackage.targets | 2 +- .../BuildBoss/CompilerNuGetCheckerUtil.cs | 2 +- src/source-manifest.json | 6 +- 29 files changed, 389 insertions(+), 307 deletions(-) create mode 100644 src/roslyn/src/Compilers/Core/MSBuildTask/Directory.Build.props create mode 100644 src/roslyn/src/Compilers/Core/MSBuildTask/Directory.Build.targets create mode 100644 src/roslyn/src/Compilers/Core/MSBuildTask/MSBuild/Microsoft.Build.Tasks.CodeAnalysis.csproj delete mode 100644 src/roslyn/src/Compilers/Core/MSBuildTask/Microsoft.Build.Tasks.CodeAnalysis.csproj create mode 100644 src/roslyn/src/Compilers/Core/MSBuildTask/Sdk/Microsoft.Build.Tasks.CodeAnalysis.Sdk.csproj delete mode 100644 src/roslyn/src/Compilers/Core/MSBuildTask/TaskTestHost.cs create mode 100644 src/roslyn/src/Compilers/Core/MSBuildTaskTests/MSBuildManagedToolTests.cs create mode 100644 src/roslyn/src/Compilers/Core/SdkTaskTests/Microsoft.Build.Tasks.CodeAnalysis.Sdk.UnitTests.csproj create mode 100644 src/roslyn/src/Compilers/Core/SdkTaskTests/SdkManagedToolTests.cs diff --git a/prereqs/git-info/roslyn.props b/prereqs/git-info/roslyn.props index 8b252a4c3fd..c5092ee9493 100644 --- a/prereqs/git-info/roslyn.props +++ b/prereqs/git-info/roslyn.props @@ -1,8 +1,8 @@  - a1b9c9b6b820e1267893d090fce4392c6cd7c50f - 20250516.2 - 5.0.0-1.25266.2 + c3c7ad6a866dd0b857ad14ce683987c39d2b8fe0 + 20250516.4 + 5.0.0-1.25266.4 \ No newline at end of file diff --git a/src/roslyn/Compilers.slnf b/src/roslyn/Compilers.slnf index e73b1562e7b..49acd2063d5 100644 --- a/src/roslyn/Compilers.slnf +++ b/src/roslyn/Compilers.slnf @@ -20,7 +20,9 @@ "src\\Compilers\\Core\\AnalyzerDriver\\AnalyzerDriver.shproj", "src\\Compilers\\Core\\CodeAnalysisTest\\Microsoft.CodeAnalysis.UnitTests.csproj", "src\\Compilers\\Core\\MSBuildTaskTests\\Microsoft.Build.Tasks.CodeAnalysis.UnitTests.csproj", - "src\\Compilers\\Core\\MSBuildTask\\Microsoft.Build.Tasks.CodeAnalysis.csproj", + "src\\Compilers\\Core\\SdkTaskTests\\Microsoft.Build.Tasks.CodeAnalysis.Sdk.UnitTests.csproj", + "src\\Compilers\\Core\\MSBuildTask\\MSBuild\\Microsoft.Build.Tasks.CodeAnalysis.csproj", + "src\\Compilers\\Core\\MSBuildTask\\Sdk\\Microsoft.Build.Tasks.CodeAnalysis.Sdk.csproj", "src\\Compilers\\Core\\Portable\\Microsoft.CodeAnalysis.csproj", "src\\Compilers\\Core\\RebuildTest\\Microsoft.CodeAnalysis.Rebuild.UnitTests.csproj", "src\\Compilers\\Core\\Rebuild\\Microsoft.CodeAnalysis.Rebuild.csproj", diff --git a/src/roslyn/Roslyn.sln b/src/roslyn/Roslyn.sln index 58cfacb5e57..701f568ef6a 100644 --- a/src/roslyn/Roslyn.sln +++ b/src/roslyn/Roslyn.sln @@ -263,8 +263,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Remo EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Remote.ServiceHub", "src\Workspaces\Remote\ServiceHub\Microsoft.CodeAnalysis.Remote.ServiceHub.csproj", "{80FDDD00-9393-47F7-8BAF-7E87CE011068}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Build.Tasks.CodeAnalysis", "src\Compilers\Core\MSBuildTask\Microsoft.Build.Tasks.CodeAnalysis.csproj", "{7AD4FE65-9A30-41A6-8004-AA8F89BCB7F3}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Roslyn.VisualStudio.Next.UnitTests", "src\VisualStudio\Core\Test.Next\Roslyn.VisualStudio.Next.UnitTests.csproj", "{2E1658E2-5045-4F85-A64C-C0ECCD39F719}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BuildBoss", "src\Tools\BuildBoss\BuildBoss.csproj", "{9C0660D9-48CA-40E1-BABA-8F6A1F11FE10}" @@ -729,6 +727,12 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Microsoft.CodeAnalysis.Exte EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Extensions.Package", "src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Microsoft.CodeAnalysis.Extensions.Package.csproj", "{EEFAB994-3778-9C0D-1E88-C0ABB1D3DE43}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Build.Tasks.CodeAnalysis", "src\Compilers\Core\MSBuildTask\MSBuild\Microsoft.Build.Tasks.CodeAnalysis.csproj", "{1B4AC233-B345-123F-E004-DAA28DE1CB08}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Build.Tasks.CodeAnalysis.Sdk", "src\Compilers\Core\MSBuildTask\Sdk\Microsoft.Build.Tasks.CodeAnalysis.Sdk.csproj", "{91F9EAA4-ACA2-87EE-868E-6CC3B73D6A11}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Build.Tasks.CodeAnalysis.Sdk.UnitTests", "src\Compilers\Core\SdkTaskTests\Microsoft.Build.Tasks.CodeAnalysis.Sdk.UnitTests.csproj", "{5399BBCC-417F-C710-46DE-EB0C0074C34D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1119,10 +1123,6 @@ Global {80FDDD00-9393-47F7-8BAF-7E87CE011068}.Debug|Any CPU.Build.0 = Debug|Any CPU {80FDDD00-9393-47F7-8BAF-7E87CE011068}.Release|Any CPU.ActiveCfg = Release|Any CPU {80FDDD00-9393-47F7-8BAF-7E87CE011068}.Release|Any CPU.Build.0 = Release|Any CPU - {7AD4FE65-9A30-41A6-8004-AA8F89BCB7F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7AD4FE65-9A30-41A6-8004-AA8F89BCB7F3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7AD4FE65-9A30-41A6-8004-AA8F89BCB7F3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7AD4FE65-9A30-41A6-8004-AA8F89BCB7F3}.Release|Any CPU.Build.0 = Release|Any CPU {2E1658E2-5045-4F85-A64C-C0ECCD39F719}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2E1658E2-5045-4F85-A64C-C0ECCD39F719}.Debug|Any CPU.Build.0 = Debug|Any CPU {2E1658E2-5045-4F85-A64C-C0ECCD39F719}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -1795,6 +1795,18 @@ Global {EEFAB994-3778-9C0D-1E88-C0ABB1D3DE43}.Debug|Any CPU.Build.0 = Debug|Any CPU {EEFAB994-3778-9C0D-1E88-C0ABB1D3DE43}.Release|Any CPU.ActiveCfg = Release|Any CPU {EEFAB994-3778-9C0D-1E88-C0ABB1D3DE43}.Release|Any CPU.Build.0 = Release|Any CPU + {1B4AC233-B345-123F-E004-DAA28DE1CB08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1B4AC233-B345-123F-E004-DAA28DE1CB08}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1B4AC233-B345-123F-E004-DAA28DE1CB08}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1B4AC233-B345-123F-E004-DAA28DE1CB08}.Release|Any CPU.Build.0 = Release|Any CPU + {91F9EAA4-ACA2-87EE-868E-6CC3B73D6A11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {91F9EAA4-ACA2-87EE-868E-6CC3B73D6A11}.Debug|Any CPU.Build.0 = Debug|Any CPU + {91F9EAA4-ACA2-87EE-868E-6CC3B73D6A11}.Release|Any CPU.ActiveCfg = Release|Any CPU + {91F9EAA4-ACA2-87EE-868E-6CC3B73D6A11}.Release|Any CPU.Build.0 = Release|Any CPU + {5399BBCC-417F-C710-46DE-EB0C0074C34D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5399BBCC-417F-C710-46DE-EB0C0074C34D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5399BBCC-417F-C710-46DE-EB0C0074C34D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5399BBCC-417F-C710-46DE-EB0C0074C34D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1915,7 +1927,6 @@ Global {C1930979-C824-496B-A630-70F5369A636F} = {C2D1346B-9665-4150-B644-075CF1636BAA} {F822F72A-CC87-4E31-B57D-853F65CBEBF3} = {55A62CFA-1155-46F1-ADF3-BEEE51B58AB5} {80FDDD00-9393-47F7-8BAF-7E87CE011068} = {55A62CFA-1155-46F1-ADF3-BEEE51B58AB5} - {7AD4FE65-9A30-41A6-8004-AA8F89BCB7F3} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9} {2E1658E2-5045-4F85-A64C-C0ECCD39F719} = {8DBA5174-B0AA-4561-82B1-A46607697753} {9C0660D9-48CA-40E1-BABA-8F6A1F11FE10} = {FD0FAF5F-1DED-485C-99FA-84B97F3A8EEC} {21A01C2D-2501-4619-8144-48977DD22D9C} = {38940C5F-97FD-4B2A-B2CD-C4E4EF601B05} @@ -2136,6 +2147,9 @@ Global {6C816C16-D563-884A-D65B-5E68C6FB6659} = {8977A560-45C2-4EC2-A849-97335B382C74} {02BCC112-0A29-43AA-84FA-C71C18A9486C} = {7A69EA65-4411-4CD0-B439-035E720C1BD3} {EEFAB994-3778-9C0D-1E88-C0ABB1D3DE43} = {7A69EA65-4411-4CD0-B439-035E720C1BD3} + {1B4AC233-B345-123F-E004-DAA28DE1CB08} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9} + {91F9EAA4-ACA2-87EE-868E-6CC3B73D6A11} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9} + {5399BBCC-417F-C710-46DE-EB0C0074C34D} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {604E6B91-7BC0-4126-AE07-D4D2FEFC3D29} @@ -2150,6 +2164,7 @@ Global src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis.Utilities.projitems*{0a1267e9-52ff-b8de-8522-802be55f41da}*SharedItemsImports = 5 src\Dependencies\Contracts\Microsoft.CodeAnalysis.Contracts.projitems*{0c2e1633-1462-4712-88f4-a0c945bad3a8}*SharedItemsImports = 5 src\Dependencies\PooledObjects\Microsoft.CodeAnalysis.PooledObjects.projitems*{0c2e1633-1462-4712-88f4-a0c945bad3a8}*SharedItemsImports = 5 + src\Dependencies\Contracts\Microsoft.CodeAnalysis.Contracts.projitems*{1b4ac233-b345-123f-e004-daa28de1cb08}*SharedItemsImports = 5 src\Analyzers\Core\CodeFixes\CodeFixes.projitems*{1b6c4a1a-413b-41fb-9f85-5c09118e541b}*SharedItemsImports = 13 src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 5 src\Dependencies\CodeAnalysis.Debugging\Microsoft.CodeAnalysis.Debugging.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 5 @@ -2211,7 +2226,6 @@ Global src\RoslynAnalyzers\Utilities\Workspaces\Workspaces.Utilities.projitems*{7005dd7b-d3b6-1360-313b-975974aa6254}*SharedItemsImports = 5 src\ExpressionEvaluator\VisualBasic\Source\ResultProvider\BasicResultProvider.projitems*{76242a2d-2600-49dd-8c15-fea07ecb1843}*SharedItemsImports = 5 src\Analyzers\Core\Analyzers\Analyzers.projitems*{76e96966-4780-4040-8197-bde2879516f4}*SharedItemsImports = 13 - src\Dependencies\Contracts\Microsoft.CodeAnalysis.Contracts.projitems*{7ad4fe65-9a30-41a6-8004-aa8f89bcb7f3}*SharedItemsImports = 5 src\Analyzers\VisualBasic\Tests\VisualBasicAnalyzers.UnitTests.projitems*{7b7f4153-ae93-4908-b8f0-430871589f83}*SharedItemsImports = 13 src\RoslynAnalyzers\Utilities\Compiler\Analyzer.Utilities.projitems*{8087bde4-6707-05a5-5f84-dfe6628e8ec8}*SharedItemsImports = 5 src\RoslynAnalyzers\Utilities\Workspaces\Workspaces.Utilities.projitems*{8087bde4-6707-05a5-5f84-dfe6628e8ec8}*SharedItemsImports = 5 @@ -2223,6 +2237,7 @@ Global src\Dependencies\Contracts\Microsoft.CodeAnalysis.Contracts.projitems*{8e2a252e-a140-45a6-a81a-2652996ea589}*SharedItemsImports = 5 src\Dependencies\PooledObjects\Microsoft.CodeAnalysis.PooledObjects.projitems*{8e2a252e-a140-45a6-a81a-2652996ea589}*SharedItemsImports = 5 src\Dependencies\Threading\Microsoft.CodeAnalysis.Threading.projitems*{8e2a252e-a140-45a6-a81a-2652996ea589}*SharedItemsImports = 5 + src\Dependencies\Contracts\Microsoft.CodeAnalysis.Contracts.projitems*{91f9eaa4-aca2-87ee-868e-6cc3b73d6a11}*SharedItemsImports = 5 src\RoslynAnalyzers\Utilities\Compiler\Analyzer.Utilities.projitems*{923e34ba-ca8a-971e-7ff7-51dd346394a1}*SharedItemsImports = 5 src\RoslynAnalyzers\Utilities\Workspaces\Workspaces.Utilities.projitems*{923e34ba-ca8a-971e-7ff7-51dd346394a1}*SharedItemsImports = 5 src\Analyzers\VisualBasic\Analyzers\VisualBasicAnalyzers.projitems*{94faf461-2e74-4dbb-9813-6b2cde6f1880}*SharedItemsImports = 13 diff --git a/src/roslyn/src/Compilers/Core/MSBuildTask/Directory.Build.props b/src/roslyn/src/Compilers/Core/MSBuildTask/Directory.Build.props new file mode 100644 index 00000000000..6c4c27e3282 --- /dev/null +++ b/src/roslyn/src/Compilers/Core/MSBuildTask/Directory.Build.props @@ -0,0 +1,71 @@ + + + + + + en-US + true + true + + + false + + + $(NoWarn);CA1819 + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + true + None + true + contentFiles\any\any + + + diff --git a/src/roslyn/src/Compilers/Core/MSBuildTask/Directory.Build.targets b/src/roslyn/src/Compilers/Core/MSBuildTask/Directory.Build.targets new file mode 100644 index 00000000000..5579a307979 --- /dev/null +++ b/src/roslyn/src/Compilers/Core/MSBuildTask/Directory.Build.targets @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + PreserveNewest + true + None + true + contentFiles\any\any + + + + + + <_CompilerApiVersion>$([System.Version]::Parse($(VersionPrefix)).Major).$([System.Version]::Parse($(VersionPrefix)).Minor) + <_CompilerVersionTargetsFileContent> + + roslyn$(_CompilerApiVersion) + +]]> + + + + + \ No newline at end of file diff --git a/src/roslyn/src/Compilers/Core/MSBuildTask/MSBuild/Microsoft.Build.Tasks.CodeAnalysis.csproj b/src/roslyn/src/Compilers/Core/MSBuildTask/MSBuild/Microsoft.Build.Tasks.CodeAnalysis.csproj new file mode 100644 index 00000000000..56fe58e6caa --- /dev/null +++ b/src/roslyn/src/Compilers/Core/MSBuildTask/MSBuild/Microsoft.Build.Tasks.CodeAnalysis.csproj @@ -0,0 +1,15 @@ + + + + + Library + Microsoft.CodeAnalysis.BuildTasks + $(NetRoslynSourceBuild);net472 + + + + + + + + diff --git a/src/roslyn/src/Compilers/Core/MSBuildTask/ManagedToolTask.cs b/src/roslyn/src/Compilers/Core/MSBuildTask/ManagedToolTask.cs index e292ca94505..356ba7a0719 100644 --- a/src/roslyn/src/Compilers/Core/MSBuildTask/ManagedToolTask.cs +++ b/src/roslyn/src/Compilers/Core/MSBuildTask/ManagedToolTask.cs @@ -16,7 +16,22 @@ namespace Microsoft.CodeAnalysis.BuildTasks { public abstract class ManagedToolTask : ToolTask { - private static bool DefaultIsSdkFrameworkToCoreBridgeTask { get; } = CalculateIsSdkFrameworkToCoreBridgeTask(); + /// + /// A copy of this task, compiled for .NET Framework, is deployed into the .NET SDK. It is a bridge task + /// that is loaded into .NET Framework MSBuild but launches the .NET Core compiler. This task necessarily + /// has different behaviors than the standard build task compiled for .NET Framework and loaded into the + /// .NET Framework MSBuild. + /// + /// + /// The reason this task is a different assembly is to allow both the MSBuild and .NET SDK copy to be loaded + /// into the same MSBuild process. + /// + internal static bool IsSdkFrameworkToCoreBridgeTask { get; } = +#if NETFRAMEWORK && SDK_TASK + true; +#else + false; +#endif /// /// Is the builtin tool being used here? When false the developer has specified a custom tool @@ -31,21 +46,10 @@ public abstract class ManagedToolTask : ToolTask /// protected bool UsingBuiltinTool => string.IsNullOrEmpty(ToolPath) && ToolExe == ToolName; - /// - /// A copy of this task, compiled for .NET Framework, is deployed into the .NET SDK. It is a bridge task - /// that is loaded into .NET Framework MSBuild but launches the .NET Core compiler. This task necessarily - /// has different behaviors than the standard build task compiled for .NET Framework and loaded into the - /// .NET Framework MSBuild. - /// - /// - /// This is mutable to facilitate testing - /// - internal bool IsSdkFrameworkToCoreBridgeTask { get; init; } = DefaultIsSdkFrameworkToCoreBridgeTask; - /// /// Is the builtin tool executed by this task running on .NET Core? /// - internal bool IsBuiltinToolRunningOnCoreClr => RuntimeHostInfo.IsCoreClrRuntime || IsSdkFrameworkToCoreBridgeTask; + internal static bool IsBuiltinToolRunningOnCoreClr => RuntimeHostInfo.IsCoreClrRuntime || IsSdkFrameworkToCoreBridgeTask; internal string PathToBuiltInTool => Path.Combine(GetToolDirectory(), ToolName); @@ -176,7 +180,7 @@ protected static ITaskItem[] GenerateCommandLineArgsTaskItems(List comma return items; } - private string GetToolDirectory() + private static string GetToolDirectory() { var buildTask = typeof(ManagedToolTask).Assembly; var buildTaskDirectory = GetBuildTaskDirectory(); @@ -189,33 +193,6 @@ private string GetToolDirectory() #endif } - /// - /// - /// - /// - /// Using the file system as a way to differentiate between the two tasks is not ideal, but it is effective - /// and allows us to avoid significantly complicating the build process. The alternative is another parameter - /// to the Csc / Vbc / etc ... tasks that all invocations would need to pass along. - /// - internal static bool CalculateIsSdkFrameworkToCoreBridgeTask() - { -#if NET - return false; -#else - // This logic needs to be updated when this issue is fixed. That moves csc.exe out to a subdirectory - // and hence the check below will need to change - // - // https://github.com/dotnet/roslyn/issues/78001 - - var buildTaskDirectory = GetBuildTaskDirectory(); - var buildTaskDirectoryName = Path.GetFileName(buildTaskDirectory); - return - string.Equals(buildTaskDirectoryName, "binfx", StringComparison.OrdinalIgnoreCase) && - !File.Exists(Path.Combine(buildTaskDirectory, "csc.exe")) && - Directory.Exists(Path.Combine(buildTaskDirectory, "..", "bincore")); -#endif - } - internal static string GetBuildTaskDirectory() { var buildTask = typeof(ManagedToolTask).Assembly; diff --git a/src/roslyn/src/Compilers/Core/MSBuildTask/Microsoft.Build.Tasks.CodeAnalysis.csproj b/src/roslyn/src/Compilers/Core/MSBuildTask/Microsoft.Build.Tasks.CodeAnalysis.csproj deleted file mode 100644 index 1cc48b02c01..00000000000 --- a/src/roslyn/src/Compilers/Core/MSBuildTask/Microsoft.Build.Tasks.CodeAnalysis.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - - - 14.0 - Library - Microsoft.CodeAnalysis.BuildTasks - en-US - $(NetRoslynSourceBuild);net472 - true - - - false - - - $(NoWarn);CA1819 - - - true - Microsoft.CodeAnalysis.Build.Tasks - - - The build task and targets used by MSBuild to run the C# and VB compilers. - Supports using VBCSCompiler on Windows. - - true - - - - - PreserveNewest - true - None - true - contentFiles\any\any - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - true - None - true - contentFiles\any\any - - - - - - - - <_CompilerApiVersion>$([System.Version]::Parse($(VersionPrefix)).Major).$([System.Version]::Parse($(VersionPrefix)).Minor) - <_CompilerVersionTargetsFileContent> - - - roslyn$(_CompilerApiVersion) - -]]> - - - - - - - - diff --git a/src/roslyn/src/Compilers/Core/MSBuildTask/Microsoft.Managed.Core.targets b/src/roslyn/src/Compilers/Core/MSBuildTask/Microsoft.Managed.Core.targets index b40b3f07468..3f73efa8f77 100644 --- a/src/roslyn/src/Compilers/Core/MSBuildTask/Microsoft.Managed.Core.targets +++ b/src/roslyn/src/Compilers/Core/MSBuildTask/Microsoft.Managed.Core.targets @@ -4,12 +4,14 @@ <_BuildTasksDirectory>$(MSBuildThisFileDirectory) <_BuildTasksDirectory Condition="Exists('$(RoslynTargetsPath)')">$(RoslynTargetsPath)\ + <_BuildTasksAssemblyName>Microsoft.Build.Tasks.CodeAnalysis + <_BuildTasksAssemblyName Condition="!Exists('$(_BuildTasksDirectory)$(_BuildTasksAssemblyName)') and Exists('$(_BuildTasksDirectory)Microsoft.Build.Tasks.CodeAnalysis.Sdk.dll')">Microsoft.Build.Tasks.CodeAnalysis.Sdk - + @@ -63,7 +65,7 @@ ======================== --> - + @@ -156,7 +158,7 @@ --> - + + + + + Library + Microsoft.CodeAnalysis.BuildTasks + net472 + SDK_TASK;$(DefineConstants) + + + true + + + + + + + + diff --git a/src/roslyn/src/Compilers/Core/MSBuildTask/TaskTestHost.cs b/src/roslyn/src/Compilers/Core/MSBuildTask/TaskTestHost.cs deleted file mode 100644 index 98f0c83b02a..00000000000 --- a/src/roslyn/src/Compilers/Core/MSBuildTask/TaskTestHost.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; - -namespace Microsoft.CodeAnalysis.BuildTasks -{ -#if NETFRAMEWORK && DEBUG - - /// - /// This class is used in to allow us to test custom - /// disk layouts and its behavior in the context of the managed tool task. - /// - internal sealed class TaskTestHost : MarshalByRefObject - { - internal bool IsSdkFrameworkToCoreBridgeTask => ManagedToolTask.CalculateIsSdkFrameworkToCoreBridgeTask(); - } - -#endif -} diff --git a/src/roslyn/src/Compilers/Core/MSBuildTaskTests/CscTests.cs b/src/roslyn/src/Compilers/Core/MSBuildTaskTests/CscTests.cs index 02007237d16..e7303f02c4a 100644 --- a/src/roslyn/src/Compilers/Core/MSBuildTaskTests/CscTests.cs +++ b/src/roslyn/src/Compilers/Core/MSBuildTaskTests/CscTests.cs @@ -649,107 +649,5 @@ void parseRef(string refText, string alias) Assert.Throws(() => csc.GenerateResponseFileContents()); } } - - [Fact] - public void PathToManagedTool_Normal() - { - var taskPath = Path.GetDirectoryName(typeof(ManagedCompiler).Assembly.Location)!; - var relativePath = RuntimeHostInfo.IsCoreClrRuntime - ? Path.Combine("bincore", "csc.dll") - : "csc.exe"; - var task = new Csc(); - Assert.Equal(Path.Combine(taskPath, relativePath), task.PathToBuiltInTool); - } - -#if NETFRAMEWORK - - [Fact] - public void PathToManagedTool_Bridge() - { - var taskPath = Path.GetDirectoryName(typeof(ManagedCompiler).Assembly.Location)!; - var task = new Csc() - { - IsSdkFrameworkToCoreBridgeTask = true - }; - Assert.Equal(Path.Combine(taskPath, "..", "bincore", "csc.dll"), task.PathToBuiltInTool); - } - -#endif - - [Fact] - public void IsManagedToolRunningOnCoreClr_Normal() - { - var task = new Csc(); - Assert.Equal(RuntimeHostInfo.IsCoreClrRuntime, task.IsBuiltinToolRunningOnCoreClr); - } - - [Fact] - public void IsManagedToolRunningOnCoreClr_Bridge() - { -#if NET - Assert.False(ManagedToolTask.CalculateIsSdkFrameworkToCoreBridgeTask()); -#else - var task = new Csc(); - Assert.False(task.IsBuiltinToolRunningOnCoreClr); -#endif - } - -#if NETFRAMEWORK && DEBUG - - [Theory] - [InlineData("binfx", true, true)] - [InlineData("binfx", false, false)] - [InlineData("other", true, false)] - [InlineData("other", false, false)] - public void CalculateIsSdkFrameworkToCoreBridgeTask_DirectoryName(string dirName, bool makeBincore, bool expected) - { - LoadInAppDomain(dirName, (appDomain, taskAssemblyName, dirPath) => - { - if (makeBincore) - { - _ = Directory.CreateDirectory(Path.Combine(Path.GetDirectoryName(dirPath), "bincore")); - } - - var testHost = (TaskTestHost)appDomain.CreateInstanceAndUnwrap(taskAssemblyName, typeof(TaskTestHost).FullName); - Assert.Equal(expected, testHost.IsSdkFrameworkToCoreBridgeTask); - }); - } - - [Fact] - public void CalculateIsSdkFrameworkToCoreBridgeTask_CscPresent() - { - LoadInAppDomain("binfx", (appDomain, taskAssemblyName, dirPath) => - { - File.WriteAllText(Path.Combine(dirPath, "csc.exe"), "real code"); - var testHost = (TaskTestHost)appDomain.CreateInstanceAndUnwrap(taskAssemblyName, typeof(TaskTestHost).FullName); - Assert.False(testHost.IsSdkFrameworkToCoreBridgeTask); - }); - } - - private static void LoadInAppDomain(string dirName, Action action) - { - using var tempRoot = new TempRoot(); - var dirPath = tempRoot.CreateDirectory().CreateDirectory(dirName).Path; - var taskAssembly = typeof(ManagedCompiler).Assembly; - var taskFilePath = taskAssembly.Location!; - var taskPath = Path.GetDirectoryName(taskFilePath); - foreach (var dllPath in Directory.EnumerateFiles(taskPath, "*.dll")) - { - File.Copy(dllPath, Path.Combine(dirPath, Path.GetFileName(dllPath))); - } - - var appDomain = Roslyn.Test.Utilities.Desktop.AppDomainUtils.Create("TestAppDomain", dirPath); - try - { - action(appDomain, taskAssembly.FullName, dirPath); - } - finally - { - AppDomain.Unload(appDomain); - } - } - -#endif - } } diff --git a/src/roslyn/src/Compilers/Core/MSBuildTaskTests/MSBuildManagedToolTests.cs b/src/roslyn/src/Compilers/Core/MSBuildTaskTests/MSBuildManagedToolTests.cs new file mode 100644 index 00000000000..4e69936b4e6 --- /dev/null +++ b/src/roslyn/src/Compilers/Core/MSBuildTaskTests/MSBuildManagedToolTests.cs @@ -0,0 +1,36 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.IO; +using Microsoft.CodeAnalysis.Test.Utilities; +using Xunit; + +namespace Microsoft.CodeAnalysis.BuildTasks.UnitTests; + +public sealed class MSBuildManagedToolTests +{ + [Fact] + public void PathToBuiltinTool() + { + var taskPath = Path.GetDirectoryName(typeof(ManagedCompiler).Assembly.Location)!; + var relativePath = RuntimeHostInfo.IsCoreClrRuntime + ? Path.Combine("bincore", "csc.dll") + : "csc.exe"; + var task = new Csc(); + Assert.Equal(Path.Combine(taskPath, relativePath), task.PathToBuiltInTool); + } + + [Fact] + public void IsSdkFrameworkToCoreBridgeTask() + { + Assert.False(ManagedToolTask.IsSdkFrameworkToCoreBridgeTask); + } + + [Fact] + public void IsBuiltinToolRunningOnCoreClr() + { + Assert.Equal(RuntimeHostInfo.IsCoreClrRuntime, ManagedToolTask.IsBuiltinToolRunningOnCoreClr); + } +} diff --git a/src/roslyn/src/Compilers/Core/MSBuildTaskTests/Microsoft.Build.Tasks.CodeAnalysis.UnitTests.csproj b/src/roslyn/src/Compilers/Core/MSBuildTaskTests/Microsoft.Build.Tasks.CodeAnalysis.UnitTests.csproj index 7f3264bb5f7..59ae5eb2b95 100644 --- a/src/roslyn/src/Compilers/Core/MSBuildTaskTests/Microsoft.Build.Tasks.CodeAnalysis.UnitTests.csproj +++ b/src/roslyn/src/Compilers/Core/MSBuildTaskTests/Microsoft.Build.Tasks.CodeAnalysis.UnitTests.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/roslyn/src/Compilers/Core/SdkTaskTests/Microsoft.Build.Tasks.CodeAnalysis.Sdk.UnitTests.csproj b/src/roslyn/src/Compilers/Core/SdkTaskTests/Microsoft.Build.Tasks.CodeAnalysis.Sdk.UnitTests.csproj new file mode 100644 index 00000000000..b0f7e319cef --- /dev/null +++ b/src/roslyn/src/Compilers/Core/SdkTaskTests/Microsoft.Build.Tasks.CodeAnalysis.Sdk.UnitTests.csproj @@ -0,0 +1,25 @@ + + + + + Library + Microsoft.CodeAnalysis.BuildTasks.Sdk.UnitTests + true + net472 + + + + + + + + + + + + + + + + + diff --git a/src/roslyn/src/Compilers/Core/SdkTaskTests/SdkManagedToolTests.cs b/src/roslyn/src/Compilers/Core/SdkTaskTests/SdkManagedToolTests.cs new file mode 100644 index 00000000000..9c235ed8f8f --- /dev/null +++ b/src/roslyn/src/Compilers/Core/SdkTaskTests/SdkManagedToolTests.cs @@ -0,0 +1,42 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.IO; +using Roslyn.Test.Utilities; +using Microsoft.CodeAnalysis.Test.Utilities; +using Xunit.Abstractions; +using Xunit; + +namespace Microsoft.CodeAnalysis.BuildTasks.Sdk.UnitTests; + +public sealed class SdkManagedToolTests +{ + public ITestOutputHelper TestOutputHelper { get; } + + public SdkManagedToolTests(ITestOutputHelper testOutputHelper) + { + TestOutputHelper = testOutputHelper; + } + + [Fact] + public void PathToBuiltinTool() + { + var taskPath = Path.GetDirectoryName(typeof(ManagedCompiler).Assembly.Location)!; + var task = new Csc(); + Assert.Equal(Path.Combine(taskPath, "..", "bincore", "csc.dll"), task.PathToBuiltInTool); + } + + [Fact] + public void IsSdkFrameworkToCoreBridgeTask() + { + Assert.True(ManagedToolTask.IsSdkFrameworkToCoreBridgeTask); + } + + [Fact] + public void IsBuiltinToolRunningOnCoreClr() + { + Assert.True(ManagedToolTask.IsBuiltinToolRunningOnCoreClr); + } +} diff --git a/src/roslyn/src/Compilers/Extension/Roslyn.Compilers.Extension.csproj b/src/roslyn/src/Compilers/Extension/Roslyn.Compilers.Extension.csproj index d2c5a638009..9c84fa22c52 100644 --- a/src/roslyn/src/Compilers/Extension/Roslyn.Compilers.Extension.csproj +++ b/src/roslyn/src/Compilers/Extension/Roslyn.Compilers.Extension.csproj @@ -59,7 +59,7 @@ DebugSymbolsProjectOutputGroup%3b true - + BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems DebugSymbolsProjectOutputGroup%3b true diff --git a/src/roslyn/src/LanguageServer/Protocol/Extensions/ProtocolConversions.cs b/src/roslyn/src/LanguageServer/Protocol/Extensions/ProtocolConversions.cs index 187cd244bdf..f3c9f824904 100644 --- a/src/roslyn/src/LanguageServer/Protocol/Extensions/ProtocolConversions.cs +++ b/src/roslyn/src/LanguageServer/Protocol/Extensions/ProtocolConversions.cs @@ -41,7 +41,7 @@ internal static partial class ProtocolConversions private static readonly char[] s_dirSeparators = [PathUtilities.DirectorySeparatorChar, PathUtilities.AltDirectorySeparatorChar]; - private static readonly Regex s_markdownEscapeRegex = new(@"([\\`\*_\{\}\[\]\(\)#+\-\.!])", RegexOptions.Compiled); + private static readonly Regex s_markdownEscapeRegex = new(@"([\\`\*_\{\}\[\]\(\)#+\-\.!<>])", RegexOptions.Compiled); // NOTE: While the spec allows it, don't use Function and Method, as both VS and VS Code display them the same // way which can confuse users diff --git a/src/roslyn/src/LanguageServer/ProtocolUnitTests/Hover/HoverTests.cs b/src/roslyn/src/LanguageServer/ProtocolUnitTests/Hover/HoverTests.cs index d272e37c274..af452f1de5f 100644 --- a/src/roslyn/src/LanguageServer/ProtocolUnitTests/Hover/HoverTests.cs +++ b/src/roslyn/src/LanguageServer/ProtocolUnitTests/Hover/HoverTests.cs @@ -527,6 +527,7 @@ public async Task DoAsync() expectedLocation).ConfigureAwait(false); Assert.Equal(expectedMarkdown, results.Contents.Fourth.Value); } + [Theory, CombinatorialData] public async Task TestGetHoverAsync_UsesNonBreakingSpaceForSupportedPlatforms(bool mutatingLspWorkspace) { @@ -586,6 +587,47 @@ static void Main(string[] args) Assert.Equal(expectedMarkdown, result.Contents.Fourth.Value); } + [Theory, CombinatorialData, WorkItem("https://github.com/dotnet/vscode-csharp/issues/6577")] + public async Task TestGetHoverAsync_EscapesAngleBracketsInGenerics(bool mutatingLspWorkspace) + { + var markup = + """ + using System.Collections.Generic; + using System.Collections.Immutable; + using System.Threading.Tasks; + class C + { + private async Task>> GetData() + { + {|caret:var|} d = await GetData(); + return null; + } + } + """; + var clientCapabilities = new LSP.ClientCapabilities + { + TextDocument = new LSP.TextDocumentClientCapabilities { Hover = new LSP.HoverSetting { ContentFormat = [LSP.MarkupKind.Markdown] } } + }; + await using var testLspServer = await CreateTestLspServerAsync(markup, mutatingLspWorkspace, clientCapabilities); + var expectedLocation = testLspServer.GetLocations("caret").Single(); + + var expectedMarkdown = """ + ```csharp + interface System.Collections.Generic.IDictionary + ``` + + + TKey is string + TValue is ImmutableArray\ + + """; + + var results = await RunGetHoverAsync( + testLspServer, + expectedLocation).ConfigureAwait(false); + Assert.Equal(expectedMarkdown, results.Contents.Fourth.Value); + } + private static async Task RunGetHoverAsync( TestLspServer testLspServer, LSP.Location caret, diff --git a/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/AnyCpu/Microsoft.Net.Compilers.Toolset.Package.csproj b/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/AnyCpu/Microsoft.Net.Compilers.Toolset.Package.csproj index 2456300ab12..54016ae2414 100644 --- a/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/AnyCpu/Microsoft.Net.Compilers.Toolset.Package.csproj +++ b/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/AnyCpu/Microsoft.Net.Compilers.Toolset.Package.csproj @@ -31,7 +31,8 @@ - + + <_File Include="@(CoreClrCompilerBinArtifact)" TargetDir="tasks/netcore/bincore"/> <_File Include="@(CoreClrCompilerBinRuntimesArtifact)" TargetDir="tasks/netcore/bincore/runtimes"/> - <_File Include="@(DesktopCompilerArtifact)" Condition="'%(DesktopCompilerArtifact.NeededForBuildTask)' == 'true'" TargetDir="tasks/netcore/binfx"/> - <_File Include="@(DesktopCompilerResourceArtifact)" Condition="'%(DesktopCompilerResourceArtifact.NeededForBuildTask)' == 'true'" TargetDir="tasks/netcore/binfx"/> + <_File Include="@(BridgeCompilerArtifact)" TargetDir="tasks/netcore/binfx"/> + <_File Include="@(BridgeCompilerResourceArtifact)" TargetDir="tasks/netcore/binfx"/> <_FileWithPath Include="@(_File)" TargetPath="%(_File.TargetDir)/%(_File.RecursiveDir)%(_File.FileName)%(_File.Extension)" /> diff --git a/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/AnyCpu/build/Microsoft.Net.Compilers.Toolset.props b/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/AnyCpu/build/Microsoft.Net.Compilers.Toolset.props index 8dc5f46a1ec..710e106bed4 100644 --- a/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/AnyCpu/build/Microsoft.Net.Compilers.Toolset.props +++ b/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/AnyCpu/build/Microsoft.Net.Compilers.Toolset.props @@ -5,6 +5,7 @@ <_RoslynTargetDirectoryName Condition="'$(MSBuildRuntimeType)' == 'Core'">netcore <_RoslynTargetDirectoryName Condition="'$(MSBuildRuntimeType)' != 'Core'">net472 <_RoslynTasksDirectory>$(MSBuildThisFileDirectory)..\tasks\$(_RoslynTargetDirectoryName)\ + Custom $(_RoslynTasksDirectory)Microsoft.Build.Tasks.CodeAnalysis.dll true $(_RoslynTasksDirectory)Microsoft.CSharp.Core.targets diff --git a/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/DesktopCompilerArtifacts.targets b/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/DesktopCompilerArtifacts.targets index 5e5207a85e1..747d3732e84 100644 --- a/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/DesktopCompilerArtifacts.targets +++ b/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/DesktopCompilerArtifacts.targets @@ -48,7 +48,7 @@ - + @@ -62,19 +62,19 @@ We don't currently collect optimization data for the following assemblies. --> - <_NoOptimizationData Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\System.Buffers.dll" NeededForBuildTask="true"/> + <_NoOptimizationData Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\System.Buffers.dll" /> <_NoOptimizationData Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\System.Collections.Immutable.dll"/> - <_NoOptimizationData Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\System.Memory.dll" NeededForBuildTask="true"/> + <_NoOptimizationData Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\System.Memory.dll" /> <_NoOptimizationData Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\System.Numerics.Vectors.dll"/> <_NoOptimizationData Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\System.Reflection.Metadata.dll"/> - <_NoOptimizationData Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\System.Runtime.CompilerServices.Unsafe.dll" NeededForBuildTask="true"/> + <_NoOptimizationData Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\System.Runtime.CompilerServices.Unsafe.dll" /> <_NoOptimizationData Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\System.Text.Encoding.CodePages.dll"/> <_NoOptimizationData Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\System.Threading.Tasks.Extensions.dll"/> - <_NoNGen Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\System.Numerics.Vectors.dll" NeededForBuildTask="true"/> + <_NoNGen Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\System.Numerics.Vectors.dll" /> @@ -86,8 +86,15 @@ - + + + + + + + + diff --git a/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/Framework/Microsoft.Net.Compilers.Toolset.Framework.Package.csproj b/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/Framework/Microsoft.Net.Compilers.Toolset.Framework.Package.csproj index a907edcd537..da4ffd5050f 100644 --- a/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/Framework/Microsoft.Net.Compilers.Toolset.Framework.Package.csproj +++ b/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/Framework/Microsoft.Net.Compilers.Toolset.Framework.Package.csproj @@ -28,7 +28,7 @@ - + diff --git a/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/arm64/Microsoft.Net.Compilers.Toolset.Arm64.Package.csproj b/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/arm64/Microsoft.Net.Compilers.Toolset.Arm64.Package.csproj index 51c21a5b9d6..05b8b035813 100644 --- a/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/arm64/Microsoft.Net.Compilers.Toolset.Arm64.Package.csproj +++ b/src/roslyn/src/NuGet/Microsoft.Net.Compilers.Toolset/arm64/Microsoft.Net.Compilers.Toolset.Arm64.Package.csproj @@ -32,7 +32,7 @@ - + - + diff --git a/src/roslyn/src/Setup/DevDivVsix/CompilersPackage/CompilersPackage.targets b/src/roslyn/src/Setup/DevDivVsix/CompilersPackage/CompilersPackage.targets index b398c100c00..e3ebb3a6ad2 100644 --- a/src/roslyn/src/Setup/DevDivVsix/CompilersPackage/CompilersPackage.targets +++ b/src/roslyn/src/Setup/DevDivVsix/CompilersPackage/CompilersPackage.targets @@ -8,7 +8,7 @@ - + diff --git a/src/roslyn/src/Tools/BuildBoss/CompilerNuGetCheckerUtil.cs b/src/roslyn/src/Tools/BuildBoss/CompilerNuGetCheckerUtil.cs index 4720b750bfc..28e24e4ea2c 100644 --- a/src/roslyn/src/Tools/BuildBoss/CompilerNuGetCheckerUtil.cs +++ b/src/roslyn/src/Tools/BuildBoss/CompilerNuGetCheckerUtil.cs @@ -191,7 +191,7 @@ private bool CheckPackages(TextWriter textWriter) (@"tasks\netcore\bincore", GetProjectPublishDirectory("vbc", "net9.0")), (@"tasks\netcore\bincore", GetProjectPublishDirectory("VBCSCompiler", "net9.0")), (@"tasks\netcore", GetProjectPublishDirectory("Microsoft.Build.Tasks.CodeAnalysis", "net9.0")), - (@"tasks\netcore\binfx", GetProjectOutputDirectory("Microsoft.Build.Tasks.CodeAnalysis", "net472"))); + (@"tasks\netcore\binfx", GetProjectOutputDirectory("Microsoft.Build.Tasks.CodeAnalysis.Sdk", "net472"))); foreach (var arch in new[] { "x86", "x64", "arm64" }) { diff --git a/src/source-manifest.json b/src/source-manifest.json index 582dd6baa2b..013207f806f 100644 --- a/src/source-manifest.json +++ b/src/source-manifest.json @@ -92,11 +92,11 @@ "commitSha": "6352a3201c903ffe907d9c7d2eb3a10507f1bd4e" }, { - "packageVersion": "5.0.0-1.25266.2", - "barId": 268686, + "packageVersion": "5.0.0-1.25266.4", + "barId": 268710, "path": "roslyn", "remoteUri": "https://github.com/dotnet/roslyn", - "commitSha": "a1b9c9b6b820e1267893d090fce4392c6cd7c50f" + "commitSha": "c3c7ad6a866dd0b857ad14ce683987c39d2b8fe0" }, { "packageVersion": "10.0.0-preview.25263.1",