-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade BCL assembly to 8.0.0 #71444
Upgrade BCL assembly to 8.0.0 #71444
Conversation
…oftBclAsyncInterface to 8.0.0
cc @jaredpar |
/azp run |
Azure Pipelines successfully started running 4 pipeline(s). |
@@ -11,6 +11,7 @@ | |||
|
|||
<ItemGroup Label="Package References"> | |||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(MicrosoftExtensionsDependencyInjectionVersion)" /> | |||
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="$(MicrosoftBclAsyncInterfacesVersion)" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't reference this package on .NETCoreApp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to add this but I get this
.dotnet/sdk/8.0.100/Microsoft.Common.CurrentVersion.targets(2382,5): error MSB3277: (NETCORE_ENGINEERING_TELEMETRY=Build) Found conflicts between different versions of "Microsoft.Bcl.AsyncInterfaces" that could not be resolved.
There was a conflict between "Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" and "Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51".
"Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was chosen because it was primary and "Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was not.
References which depend on "Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" [/mnt/vss/_work/1/s/.packages/microsoft.bcl.asyncinterfaces/7.0.0/lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll].
/mnt/vss/_work/1/s/.packages/microsoft.bcl.asyncinterfaces/7.0.0/lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll
Project file item includes which caused reference "/mnt/vss/_work/1/s/.packages/microsoft.bcl.asyncinterfaces/7.0.0/lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll".
/mnt/vss/_work/1/s/.packages/microsoft.bcl.asyncinterfaces/7.0.0/lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll
References which depend on "Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" [].
/mnt/vss/_work/1/s/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer.Protocol/Debug/netstandard2.0/Microsoft.CodeAnalysis.LanguageServer.Protocol.dll
Project file item includes which caused reference "/mnt/vss/_work/1/s/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer.Protocol/Debug/netstandard2.0/Microsoft.CodeAnalysis.LanguageServer.Protocol.dll".
/mnt/vss/_work/1/s/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer.Protocol/Debug/netstandard2.0/Microsoft.CodeAnalysis.LanguageServer.Protocol.dll
/mnt/vss/_work/1/s/artifacts/bin/Microsoft.CommonLanguageServerProtocol.Framework/Debug/netstandard2.0/Microsoft.CommonLanguageServerProtocol.Framework.dll
Project file item includes which caused reference "/mnt/vss/_work/1/s/artifacts/bin/Microsoft.CommonLanguageServerProtocol.Framework/Debug/netstandard2.0/Microsoft.CommonLanguageServerProtocol.Framework.dll".
/mnt/vss/_work/1/s/artifacts/bin/Microsoft.CommonLanguageServerProtocol.Framework/Debug/netstandard2.0/Microsoft.CommonLanguageServerProtocol.Framework.dll
/mnt/vss/_work/1/s/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer.Protocol/Debug/netstandard2.0/Microsoft.CodeAnalysis.LanguageServer.Protocol.dll
From project.assets.json
file I see it the project is referencing the 7.0.0
BCL in net6.0 TFM. My guess is it might be introduced by other packages used in project. And Roslyn is referencing 8.0.0
BCL in other referenced projects so it causes the conflict.
This is by far the easiest way I found to solve the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the request here is to add it to a conditional item group:
<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<PackageReference ... />
</ItemGroup>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the following packages bring M.Bcl.AsyncInterfaces in on .NETCoreApp:
- Microsoft.VisualStudio.Threading/17.7.35
- Nerdbank.Streams/2.10.69
- StreamJsonRpc/2.17.8
Those packages should be updated to not reference M.Bcl.AsyncInterfaces. I submitted microsoft/vs-threading#1269, dotnet/Nerdbank.Streams#723 and microsoft/vs-streamjsonrpc#987 to fix that.
Meanwhile I understand that you want to upgrade the transitive package dependency. Did you consider using NuGet Central Package Management with the transitive pinning feature? That would allow you to do that automatically without needing to add an extra PackageReference in this project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am thinking about this. The main purpose of this PR is Roslyn also ships a few dlls, which needs to match the dlls version in msbuild. (e.g SystemCollectionsImmutableVersion and SystemReflectionMetadataVersion)
Even other packages in VS move to the new version (like BCL
) it might be fine since we don't ship that dlls. We can wait for the upstream packages to update and later update all other stuff here.
So here we just want to find a sweet point without too many other tricks. Testing now..
src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj
Outdated
Show resolved
Hide resolved
43ac484
to
c555956
Compare
@@ -43,6 +44,7 @@ public void TestAnalyzerLoading_AppDomain() | |||
var dir = Temp.CreateDirectory(); | |||
dir.CopyFile(typeof(AppDomainUtils).Assembly.Location); | |||
dir.CopyFile(typeof(RemoteAnalyzerFileReferenceTest).Assembly.Location); | |||
dir.CopyFile(typeof(Vector).Assembly.Location); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test would fail on line 54. Exception shows it can't find System.Numerics assembly.
@@ -85,6 +87,7 @@ public class TestAnalyzer : DiagnosticAnalyzer | |||
var immutable = dir.CopyFile(typeof(ImmutableArray).Assembly.Location); | |||
var analyzer = dir.CopyFile(typeof(DiagnosticAnalyzer).Assembly.Location); | |||
dir.CopyFile(typeof(RemoteAnalyzerFileReferenceTest).Assembly.Location); | |||
dir.CopyFile(typeof(Vector).Assembly.Location); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above comment
628f42c
to
5159608
Compare
A few things need to be checked before this is good to merge.
There are many undo/redo commits in the PR, will squash them when merging. |
Retargeting 17.9, this is needed in P3 |
@@ -1586,7 +1586,7 @@ .maxstack 2 | |||
"); | |||
} | |||
|
|||
[Fact] | |||
[ConditionalFact(typeof(IsEnglishLocal))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked to Compiler folks offline and verifed this is OK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked to Compiler folks offline and verifed this is OK
I think we should open an issue for the test infrastructure. It should make sure that verification errors are obtained in English. Then this change should be reverted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #71509.
Requested because VS updated to 8.0.0.