Skip to content
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

Add explicit System.Memory dependency to Hosts #2443

Merged
merged 7 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

name: 'Build'
env:
DotNetVersion: "7.0.100-preview.4.22252.9"
DotNetVersion2: "3.1.419"
DotNetVersion: "7.0.100-preview.7.22377.5"
DotNetVersion2: "3.1.422"
NuGetVersion: "5.7.0"
MonoVersion: "6.12.0"
Artifacts: ${{ github.workspace }}/artifacts/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests-net6.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

name: 'Tests net6.0'
env:
DotNetVersion: "7.0.100-preview.4.22252.9"
DotNetVersion2: "3.1.419"
DotNetVersion: "7.0.100-preview.7.22377.5"
DotNetVersion2: "3.1.422"
NuGetVersion: "5.7.0"
MonoVersion: "6.12.0"
Artifacts: ${{ github.workspace }}/artifacts/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

name: 'Tests'
env:
DotNetVersion: "7.0.100-preview.4.22252.9"
DotNetVersion2: "3.1.419"
DotNetVersion: "7.0.100-preview.7.22377.5"
DotNetVersion2: "3.1.422"
NuGetVersion: "5.7.0"
MonoVersion: "6.12.0"
Artifacts: ${{ github.workspace }}/artifacts/
Expand Down
4 changes: 2 additions & 2 deletions .pipelines/init.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
parameters:
# Configuration: Release
Verbosity: Normal
DotNetVersion: "7.0.100-preview.4.22252.9"
DotNetVersion2: "3.1.419"
DotNetVersion: "7.0.100-preview.7.22377.5"
DotNetVersion2: "3.1.422"
CakeVersion: "1.1.0"
NuGetVersion: "5.7.0"
MonoVersion: ''
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ resources:

variables:
Verbosity: Diagnostic
DotNetVersion: "6.0.300"
DotNetVersion2: "3.1.419"
DotNetVersion: "6.0.400"
DotNetVersion2: "3.1.422"
CakeVersion: "1.1.0"
NuGetVersion: "5.7.0"
GitVersionVersion: "5.0.1"
Expand Down
6 changes: 3 additions & 3 deletions build.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"DotNetInstallScriptURL": "https://dot.net/v1",
"DotNetChannel": "Preview",
"DotNetVersions": [
"3.1.419",
"6.0.300",
"7.0.100-preview.4.22252.9"
"3.1.422",
"6.0.400",
"7.0.100-preview.7.22377.5"
],
"RequiredMonoVersion": "6.6.0",
"DownloadURL": "https://roslynomnisharp.blob.core.windows.net/ext",
Expand Down
7 changes: 4 additions & 3 deletions build/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<PropertyGroup>
<AspNetCorePackageVersion>2.2.0</AspNetCorePackageVersion>
<MicrosoftExtensionPackageVersion>6.0.0</MicrosoftExtensionPackageVersion>
<MicrosoftTestPackageVersion>17.2.0</MicrosoftTestPackageVersion>
<MSBuildPackageVersion>17.0.0</MSBuildPackageVersion>
<NuGetPackageVersion>6.3.0-preview.1.32</NuGetPackageVersion>
<MicrosoftTestPackageVersion>17.3.0</MicrosoftTestPackageVersion>
<MSBuildPackageVersion>17.3.1</MSBuildPackageVersion>
<NuGetPackageVersion>6.3.0-rc.128</NuGetPackageVersion>
<RoslynPackageVersion>4.4.0-1.22369.1</RoslynPackageVersion>
<XunitPackageVersion>2.4.1</XunitPackageVersion>
</PropertyGroup>
Expand Down Expand Up @@ -79,6 +79,7 @@
<PackageReference Update="System.Collections.Immutable" Version="6.0.0" />
<PackageReference Update="System.ComponentModel.Composition" Version="4.5.0" />
<PackageReference Update="System.Composition" Version="6.0.0" />
<PackageReference Update="System.Memory" Version="4.5.5" />
<PackageReference Update="System.Reflection.Metadata" Version="6.0.0" />
<PackageReference Update="System.Threading.Tasks.Dataflow" Version="6.0.0" />
<PackageReference Update="System.ValueTuple" Version="4.5.0" />
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.100-preview.4.22252.9",
"version": "7.0.100-preview.7.22377.5",
"rollForward": "patch"
}
}
5 changes: 5 additions & 0 deletions src/OmniSharp.Http.Driver/OmniSharp.Http.Driver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" />

<!-- An older System.Memory is an implicit dependency, so without this we won't have
a new enough System.Memory and we'll get method missing exceptions when we are
running with some newer MSBuild versions. -->
<PackageReference Include="System.Memory" />
</ItemGroup>
</Project>
5 changes: 5 additions & 0 deletions src/OmniSharp.Http.Driver/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
<assemblyIdentity name="System.Composition.TypedParts" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
</dependentAssembly>

<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why doesn't this version match up with the dependency version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the assembly version doesn't match the nuget package version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth a comment.

</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
5 changes: 5 additions & 0 deletions src/OmniSharp.Stdio.Driver/OmniSharp.Stdio.Driver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" />

<!-- An older System.Memory is an implicit dependency, so without this we won't have
a new enough System.Memory and we'll get method missing exceptions when we are
running with some newer MSBuild versions. -->
<PackageReference Include="System.Memory" />
</ItemGroup>
</Project>
5 changes: 5 additions & 0 deletions src/OmniSharp.Stdio.Driver/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
<assemblyIdentity name="System.Composition.TypedParts" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
</dependentAssembly>

<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
2 changes: 1 addition & 1 deletion test-assets/test-projects/ExternAlias/global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "3.1.419"
"version": "3.1.422"
}
}
2 changes: 1 addition & 1 deletion test-assets/test-projects/Net60Project/global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "6.0.300"
"version": "6.0.400"
}
}
2 changes: 1 addition & 1 deletion test-assets/test-projects/Net70Project/global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "7.0.100-preview.4.22252.9"
"version": "7.0.100-preview.7.22377.5"
}
}
2 changes: 1 addition & 1 deletion test-assets/test-projects/NetCore31Project/global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "3.1.419"
"version": "3.1.422"
}
}
5 changes: 5 additions & 0 deletions tests/OmniSharp.Cake.Tests/OmniSharp.Cake.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="xunit" />

<!-- An older System.Memory is an implicit dependency, so without this we won't have
a new enough System.Memory and we'll get method missing exceptions when we are
running with some newer MSBuild versions. -->
<PackageReference Include="System.Memory" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="xunit" />

<!-- An older System.Memory is an implicit dependency, so without this we won't have
a new enough System.Memory and we'll get method missing exceptions when we are
running with some newer MSBuild versions. -->
<PackageReference Include="System.Memory" />

<!--
Mono's MSBuild does not include the SQLitePCLRaw libraries.
We include them when packaging our non-windows .NET Framework builds.
Expand Down
5 changes: 5 additions & 0 deletions tests/OmniSharp.Http.Tests/OmniSharp.Http.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="xunit" />

<!-- An older System.Memory is an implicit dependency, so without this we won't have
a new enough System.Memory and we'll get method missing exceptions when we are
running with some newer MSBuild versions. -->
<PackageReference Include="System.Memory" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions tests/OmniSharp.Lsp.Tests/OmniSharp.Lsp.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="xunit" />

<!-- An older System.Memory is an implicit dependency, so without this we won't have
a new enough System.Memory and we'll get method missing exceptions when we are
running with some newer MSBuild versions. -->
<PackageReference Include="System.Memory" />

<!--
Mono's MSBuild does not include the SQLitePCLRaw libraries.
We include them when packaging our non-windows .NET Framework builds.
Expand Down
6 changes: 6 additions & 0 deletions tests/OmniSharp.MSBuild.Tests/OmniSharp.MSBuild.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
<PackageReference Include="xunit" />
<PackageReference Include="Microsoft.Build.Locator" />
<PackageReference Include="Microsoft.Build" ExcludeAssets="Runtime" PrivateAssets="all" />

<!-- An older System.Memory is an implicit dependency, so without this we won't have
a new enough System.Memory and we'll get method missing exceptions when we are
running with some newer MSBuild versions. -->
<PackageReference Include="System.Memory" />

<!--
Mono's MSBuild does not include the SQLitePCLRaw libraries.
We include them when packaging our non-windows .NET Framework builds.
Expand Down
6 changes: 3 additions & 3 deletions tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public async Task The_correct_sdk_version_is_emitted_NETCore3_1()
using var testProject = await TestAssets.Instance.GetTestProjectAsync("NetCore31Project");
using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory));
Assert.Single(emitter.ReceivedMessages);
Assert.Equal(GetHashedFileExtension("3.1.419"), emitter.ReceivedMessages[0].SdkVersion);
Assert.Equal(GetHashedFileExtension("3.1.422"), emitter.ReceivedMessages[0].SdkVersion);
}

[ConditionalFact(typeof(NonMonoRuntimeOnly))]
Expand All @@ -230,7 +230,7 @@ public async Task The_correct_sdk_version_is_emitted_NET6()
using var testProject = await TestAssets.Instance.GetTestProjectAsync("Net60Project");
using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory));
Assert.Single(emitter.ReceivedMessages);
Assert.Equal(GetHashedFileExtension("6.0.300"), emitter.ReceivedMessages[0].SdkVersion);
Assert.Equal(GetHashedFileExtension("6.0.400"), emitter.ReceivedMessages[0].SdkVersion);
}

[ConditionalFact(typeof(NonMonoRuntimeOnly))]
Expand All @@ -242,7 +242,7 @@ public async Task The_correct_sdk_version_is_emitted_NET7()
using var testProject = await TestAssets.Instance.GetTestProjectAsync("Net70Project");
using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory));
Assert.Single(emitter.ReceivedMessages);
Assert.Equal(GetHashedFileExtension("7.0.100-preview.4.22252.9"), emitter.ReceivedMessages[0].SdkVersion);
Assert.Equal(GetHashedFileExtension("7.0.100-preview.7.22377.5"), emitter.ReceivedMessages[0].SdkVersion);
}

private string GetHashedFileExtension(string fileExtension)
Expand Down
2 changes: 1 addition & 1 deletion tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public async Task TwoProjectsWithSolution()
Assert.Equal("netstandard1.3", secondProject.TargetFrameworks[0].ShortName);
}

[Fact]
[Fact(Skip = "https://github.com/dotnet/msbuild/pull/7642")]
public async Task TwoProjectsWithSolutionAndCustomConfigurations()
{
var configData = new Dictionary<string, string> { [$"MsBuild:{nameof(Options.MSBuildOptions.Configuration)}"] = "ReleaseSln" };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="xunit" />

<!-- An older System.Memory is an implicit dependency, so without this we won't have
a new enough System.Memory and we'll get method missing exceptions when we are
running with some newer MSBuild versions. -->
<PackageReference Include="System.Memory" />

<!--
Mono's MSBuild does not include the SQLitePCLRaw libraries.
We include them when packaging our non-windows .NET Framework builds.
Expand Down
5 changes: 5 additions & 0 deletions tests/OmniSharp.Script.Tests/OmniSharp.Script.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="xunit" />

<!-- An older System.Memory is an implicit dependency, so without this we won't have
a new enough System.Memory and we'll get method missing exceptions when we are
running with some newer MSBuild versions. -->
<PackageReference Include="System.Memory" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions tests/OmniSharp.Stdio.Tests/OmniSharp.Stdio.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="xunit" />

<!-- An older System.Memory is an implicit dependency, so without this we won't have
a new enough System.Memory and we'll get method missing exceptions when we are
running with some newer MSBuild versions. -->
<PackageReference Include="System.Memory" />

<!--
Mono's MSBuild does not include the SQLitePCLRaw libraries.
We include them when packaging our non-windows .NET Framework builds.
Expand Down
2 changes: 1 addition & 1 deletion tests/OmniSharp.Tests/DotNetCliServiceFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace OmniSharp.Tests
{
public class DotNetCliServiceFacts : AbstractTestFixture
{
private const string DotNetVersion = "7.0.100-preview.4.22252.9";
private const string DotNetVersion = "7.0.100-preview.7.22377.5";
private int Major { get; }
private int Minor { get; }
private int Patch { get; }
Expand Down
4 changes: 2 additions & 2 deletions tests/OmniSharp.Tests/DotNetVersionFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public void ParseErrorMessage()
"Installed SDKs:",
"6.0.105 [/usr/local/share/dotnet/sdk]",
"6.0.202 [/usr/local/share/dotnet/sdk]",
"6.0.300 [/usr/local/share/dotnet/sdk]",
"7.0.100-preview.4.22252.9 [/usr/local/share/dotnet/sdk]",
"6.0.400 [/usr/local/share/dotnet/sdk]",
"7.0.100-preview.7.22377.5 [/usr/local/share/dotnet/sdk]",
"",
$"Install the [{RequestedSdkVersion}] .NET SDK or update [{GlobalJsonFile}] to match an installed SDK.",
"",
Expand Down
5 changes: 5 additions & 0 deletions tests/OmniSharp.Tests/OmniSharp.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="xunit" />

<!-- An older System.Memory is an implicit dependency, so without this we won't have
a new enough System.Memory and we'll get method missing exceptions when we are
running with some newer MSBuild versions. -->
<PackageReference Include="System.Memory" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions tests/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
<assemblyIdentity name="System.Composition.TypedParts" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
</dependentAssembly>

<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>