machinelearning icon indicating copy to clipboard operation
machinelearning copied to clipboard

Bump versions of maintenance-packages dependencies consumed in machin…

Open carlossanlop opened this issue 1 year ago • 1 comments

dotnet/runtime depends on these packages that we are now publishing from dotnet/maintenance-packages:

  • Microsoft.Bcl.HashCode
  • System.Buffers
  • System.Memory
  • System.Runtime.CompilerServices.Unsafe

Bumping their versions to consume the new preview versions, available in the dotnet-libraries feed: https://dnceng.visualstudio.com/public/_artifacts/feed/dotnet-libraries

Related PRs:

  • runtime: https://github.com/dotnet/runtime/pull/108806
  • winforms: https://github.com/dotnet/winforms/pull/12313

carlossanlop avatar Oct 18 '24 23:10 carlossanlop

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 68.90%. Comparing base (f385b06) to head (908acb5). Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7274      +/-   ##
==========================================
+ Coverage   68.80%   68.90%   +0.09%     
==========================================
  Files        1461     1467       +6     
  Lines      272400   274380    +1980     
  Branches    28176    28642     +466     
==========================================
+ Hits       187436   189066    +1630     
- Misses      77729    77983     +254     
- Partials     7235     7331      +96     
Flag Coverage Δ
Debug 68.90% <ø> (+0.09%) :arrow_up:
production 63.38% <ø> (+0.07%) :arrow_up:
test 89.18% <ø> (+0.10%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

see 22 files with indirect coverage changes

codecov[bot] avatar Oct 19 '24 00:10 codecov[bot]

@michaelgsharp there are several dead-lettering failures. Can you take a look? Maybe the VM queues need updating?

carlossanlop avatar Oct 31 '24 18:10 carlossanlop

/azp run

michaelgsharp avatar Nov 04 '24 19:11 michaelgsharp

Azure Pipelines successfully started running 2 pipeline(s).

azure-pipelines[bot] avatar Nov 04 '24 19:11 azure-pipelines[bot]

System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x8013104

The new version of System.Memory is 4.0.2.0. I would expect the test to auto-generate a bindingRedirect for this.

ericstj avatar Nov 04 '24 21:11 ericstj

I found these two lines hardcoding the package version, which should now be 4.6.0: https://github.com/dotnet/machinelearning/blob/5c503195e8fb64ea5f73c6a46c76d87f4aa0503b/test/Microsoft.ML.CodeAnalyzer.Tests/Helpers/AdditionalMetadataReferences.cs#L17-L23

carlossanlop avatar Nov 04 '24 21:11 carlossanlop

Those are just for testing the analyzer.

Here the problem is due to RemoteExecutor.

The .dll.config has the correct redirect. If you download the helix payload and examine workitems\Microsoft.ML.CpuMath.UnitTests\Microsoft.ML.CpuMath.UnitTests.dll.config you can see

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

But that .dll.config isn't being reused with RemoteExecutor.

ericstj avatar Nov 04 '24 21:11 ericstj

This same issue was hit here: https://github.com/dotnet/runtime/issues/104647 @ViktorHofer mentions that it should be handled with https://github.com/dotnet/arcade/blob/fc2f7ce8372a55725aab7b48c25bad7327a9769d/src/Microsoft.DotNet.RemoteExecutor/src/build/Microsoft.DotNet.RemoteExecutor.targets#L8-L33 -- it looks like ML.NET doesn't use that remote executor, but still uses it's own which may not have the fix. So that's the "right fix" here -- make the ML.NET remoteexecutor honor the tests redirects.

If I look at the assembly refs here, most are coming from the netstandard2.0 library which was pinned to 4.0.1.2. In the 4.5.5 version of System.Memory both the netstandard2.0 and net461 libraries had the same version. In the new package we kept netstandard2.0 pinned at 4.0.1.2 but bumped net4* to 4.0.2.0. I wonder if we should avoid doing this in servicing since it'll be introducing the need for a redirect in this scenario? I checked and the version that's inbox in netcoreapp2.1 is actually 4.1.0.0 so we don't need to pin the netstandard2.0 version -- so long as it remains lower than 4.1.0.0.

ericstj avatar Nov 04 '24 21:11 ericstj

We don't use the RemoteExecutor in arcade because it doens't support NetFX, so we still have our custom one. Let me take a look at @ViktorHofer's fix and see what it would take to adopt it as well.

michaelgsharp avatar Nov 05 '24 00:11 michaelgsharp

@michaelgsharp RemoteExecutor in Arcade supports .NET Framework. A lot of the tests in runtime target framework and depend on RemoteExecutor.

ViktorHofer avatar Nov 05 '24 06:11 ViktorHofer

Closing as #7295 takes care of it and the remote executor update.

michaelgsharp avatar Nov 11 '24 19:11 michaelgsharp