Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Change test projects to target netcoreapp2.1 #1736

Merged
merged 20 commits into from
Oct 7, 2017

Conversation

ahsonkhan
Copy link
Contributor

@ahsonkhan ahsonkhan commented Aug 30, 2017

After validating that tests targeting netcoreapp2.0 will pass using the latest packages (#1735), update the tests to target netcoreapp2.1.

Do NOT merge until the above mentioned PR is green.

We could update to 2.1 right away, but we should wait and make sure that the packages we depend on still work on netcoreapp2.0 first.

cc @shiftylogic, @KrzysztofCwalina

@KrzysztofCwalina
Copy link
Member

looks good

@ahsonkhan
Copy link
Contributor Author

FYI, I removed unnecessary or redundant project/package references.

cc @davidfowl

@@ -8,10 +8,8 @@
<PackageIconUrl>http://go.microsoft.com/fwlink/?linkid=833199</PackageIconUrl>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Buffers" Version="$(CoreFxVersion)" />
<PackageReference Include="System.Buffers" Version="$(CoreFxStableVersion4_4)" />
Copy link
Contributor Author

@ahsonkhan ahsonkhan Aug 30, 2017

Choose a reason for hiding this comment

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

Question: For a netstandard library, like System.Buffers.Primitives for example, is it better to reference a lower version of a package or higher (4.4.0 vs 4.3.0)? This change results in us referencing the higher version.

cc @ericstj

Copy link
Member

Choose a reason for hiding this comment

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

Typical best practice is to reference the lowest version that satisfies your dependency (both direct and indirect). Be careful not to reference a version lower than any of your other dependencies or you will cause a downgrade.

There are sometimes requirements that folks have (limiting test matrix, or limiting number of packages downloaded) that will cause them to break from this best practice and reference higher versions then they actually need, so don't be surprised if you find that this advice is not followed consistently.

@ahsonkhan
Copy link
Contributor Author

error CS0433: The type 'ReadOnlySpan' exists in both 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' and 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [D:\j\workspace\windows_nt_de---4b678204\tests\System.Text.Primitives.Tests\System.Text.Primitives.Tests.csproj]

This issue will be resolved after this PR/fix:
dotnet/corefx#23836

@ahsonkhan
Copy link
Contributor Author

The other issues will get fixed after the cli picks up the new shared framework. Right now it is picking up an old one from Aug 16.

dotnet/cli#7530 (comment)
dotnet/cli#7601

@eerhardt
Copy link
Member

eerhardt commented Sep 7, 2017

FYI - dotnet/cli#7606 moves the CLI to the latest shared framework.

@ahsonkhan
Copy link
Contributor Author

ahsonkhan commented Sep 12, 2017

The test failures (such as the one shown below) will go away once we get a new dotnet CLI with the latest shared framework (which has the AsReadOnlySpan API).

This is blocked on https://github.com/dotnet/coreclr/issues/13919

[xUnit.net 00:00:02.2852907] System.Text.Utf8.Tests.Utf8StringTests.SubstringFromTests(expected: "abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", s: "abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", substring: "abbbbbbbb") [FAIL]
[xUnit.net 00:00:02.2855085] System.MissingMethodException : Method not found: 'System.ReadOnlySpan`1 System.Span.AsReadOnlySpan(System.String)'.
[xUnit.net 00:00:02.2856067] Stack Trace:
[xUnit.net 00:00:02.2856658] at System.SpanExtensions.AsReadOnlySpan(String text)
[xUnit.net 00:00:02.2857327] D:\GitHub\Fork\corefxlab\src\System.Text.Utf8String\System\Text\Utf8String.cs(622,0): at System.Text.Utf8.Utf8String.GetUtf8BytesFromString(String str)
[xUnit.net 00:00:02.2858459] D:\GitHub\Fork\corefxlab\src\System.Text.Utf8String\System\Text\Utf8String.cs(51,0): at System.Text.Utf8.Utf8String..ctor(String s)
[xUnit.net 00:00:02.2859141] D:\GitHub\Fork\corefxlab\tests\System.Text.Utf8String.Tests\RandomTests.cs(689,0): at System.Text.Utf8.Tests.Utf8StringTests.SubstringFromTests(String expected, String s, String substring)

@ahsonkhan
Copy link
Contributor Author

Waiting for CLI with new shared framework (above 2.1.0-preview1-25719-04) which has the following changes: dotnet/coreclr#14057

@eerhardt
Copy link
Member

eerhardt commented Oct 2, 2017

Waiting for CLI with new shared framework (above 2.1.0-preview1-25719-04) which has the following changes: dotnet/coreclr#14057

@livarcocc @nguerrera @dsplaisted - it looks like the dotnet/cli master builds are currently broken. Is someone fixing them?

@nguerrera
Copy link

nguerrera commented Oct 2, 2017

Adding @johnbeisner re: broken master CLI builds. Is it due to signing issues?

@johnbeisner
Copy link

@nguerrera
Most likely master is blocked because we took an update to the 'NuGet_Version' from 4.4.0-preview1-4365 to 4.4.0-preview3-4475 [ https://github.com/dotnet/cli/pull/7713 ] which causes the 'Dotnet CLI CI [AllLinuxDistrosNativeInstallers][x64][master]' leg to fail in the 'UploadToLinuxPackageRepository' task at runtime:
error MSB4018: The "UploadToLinuxPackageRepository" task failed unexpectedly.
error MSB4018: System.IO.FileLoadException: Could not load file or assembly 'NuGet.Protocol, Version=4.4.0.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621)

https://devdiv.visualstudio.com/DevDiv/_build/index?buildId=1030130&_a=summary

@nguerrera
Copy link

@johnbeisner, you fixed that, right? Is the fix just not RIed to master? Can you do that now?

@johnbeisner
Copy link

@nguerrera
No I did not fix this - I'm looking into it.

@ahsonkhan
Copy link
Contributor Author

ahsonkhan commented Oct 7, 2017

@VSadov, any idea what could be causing these build failures when we change the test projects to target netcoreapp2.1?

I cannot reproduce this failure locally (on my Windows machine).

https://ci.dot.net/job/dotnet_corefxlab/job/master/job/windows_nt_release_prtest/819/consoleFull#-75892857179494335-f7bd-47d0-8771-8661e00c2db2

C:\Users\dotnet-bot.nuget\packages\microsoft.netcore.compilers\2.6.0-beta1-62126-01\tools\Microsoft.CSharp.Core.targets(84,5): error MSB6006: "RunCsc.cmd" exited with code -2147450749. [D:\j\workspace\windows_nt_re---4abe806d\src\System.Buffers.Primitives\System.Buffers.Primitives.csproj]
17:49:52 C:\Users\dotnet-bot.nuget\packages\microsoft.netcore.compilers\2.6.0-beta1-62126-01\tools\Microsoft.CSharp.Core.targets(84,5): error MSB6006: "RunCsc.cmd" exited with code -2147450749. [D:\j\workspace\windows_nt_re---4abe806d\src\System.Collections.Sequences\System.Collections.Sequences.csproj]

Edit: I was able to reproduce a failure on Ubuntu. Here are more detailed logs.

 1>/home/ahkha/.nuget/packages/microsoft.netcore.compilers/2.6.0-beta1-62126-01/tools/Microsoft.CSharp.Core.targets(84,5): error MSB6006: "RunCsc" exited with code 131. [/home/ahkha/corefxlab/corefxlab/src/System.Collections.Generic.MultiValueDictionary/System.Collections.Generic.MultiValueDictionary.csproj]
   Done executing task "Csc" -- FAILED.
 1>Done building target "CoreCompile" in project "System.Collections.Generic.MultiValueDictionary.csproj" -- FAILED.
 1>Target "_CheckForCompileOutputs" in file "/home/ahkha/corefxlab/corefxlab/dotnetcli/sdk/2.1.0-preview1-007306/Microsoft.Common.CurrentVersion.targets" from project "/home/ahkha/corefxlab/corefxlab/src/System.Collections.Generic.MultiValueDictionary/System.Collections.Generic.MultiValueDictionary.csproj" (target "_CleanGetCurrentAndPriorFileWrites" depends on it):
 1>Done building target "_CheckForCompileOutputs" in project "System.Collections.Generic.MultiValueDictionary.csproj".
   Target "_SGenCheckForOutputs" skipped, due to false condition; ('$(_SGenGenerateSerializationAssembliesConfig)' == 'On' or ('@(WebReferenceUrl)'!='' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto')) was evaluated as ('Off' == 'On' or (''!='' and 'Off' == 'Auto')).
 1>Target "_CleanGetCurrentAndPriorFileWrites" in file "/home/ahkha/corefxlab/corefxlab/dotnetcli/sdk/2.1.0-preview1-007306/Microsoft.Common.CurrentVersion.targets" from project "/home/ahkha/corefxlab/corefxlab/src/System.Collections.Generic.MultiValueDictionary/System.Collections.Generic.MultiValueDictionary.csproj" (target "_CleanRecordFileWrites" depends on it):
   Using "ReadLinesFromFile" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
   Task "ReadLinesFromFile"
   Done executing task "ReadLinesFromFile".
   Using "ConvertToAbsolutePath" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
   Task "ConvertToAbsolutePath"
   Done executing task "ConvertToAbsolutePath".
   Using "FindUnderPath" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
   Task "FindUnderPath"
     Comparison path is "/home/ahkha/corefxlab/corefxlab/src/System.Collections.Generic.MultiValueDictionary".
   Done executing task "FindUnderPath".
   Task "FindUnderPath"
     Comparison path is "bin/Debug/netstandard1.1/".
   Done executing task "FindUnderPath".
   Task "FindUnderPath"
     Comparison path is "obj/Debug/netstandard1.1/".
   Done executing task "FindUnderPath".
   Using "RemoveDuplicates" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
   Task "RemoveDuplicates"
   Done executing task "RemoveDuplicates".
 1>Done building target "_CleanGetCurrentAndPriorFileWrites" in project "System.Collections.Generic.MultiValueDictionary.csproj".
 1>Target "_CleanRecordFileWrites" in file "/home/ahkha/corefxlab/corefxlab/dotnetcli/sdk/2.1.0-preview1-007306/Microsoft.Common.CurrentVersion.targets" from project "/home/ahkha/corefxlab/corefxlab/src/System.Collections.Generic.MultiValueDictionary/System.Collections.Generic.MultiValueDictionary.csproj" (target "CoreBuild" depends on it):
   Task "RemoveDuplicates"
   Done executing task "RemoveDuplicates".
   Task "MakeDir"
   Done executing task "MakeDir".
   Task "WriteLinesToFile"
   Done executing task "WriteLinesToFile".
 1>Done building target "_CleanRecordFileWrites" in project "System.Collections.Generic.MultiValueDictionary.csproj".
 1>Done Building Project "/home/ahkha/corefxlab/corefxlab/src/System.Collections.Generic.MultiValueDictionary/System.Collections.Generic.MultiValueDictionary.csproj" (Build target(s)) -- FAILED.

Build FAILED.

@ahsonkhan
Copy link
Contributor Author

@dotnet-bot test this please

@ahsonkhan
Copy link
Contributor Author

ahsonkhan commented Oct 7, 2017

cc @dotnet/corefxlab-contrib

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants