dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
9.05k stars 1.89k forks source link

Clean up build warnings #5963

Open ericstj opened 3 years ago

ericstj commented 3 years ago

I looked at a recent build and noticed the following warnings:

D:\a\1\s\src\Microsoft.ML.Data\Prediction\IPredictionTransformer.cs(40,34): warning CS1574: XML comment has cref attribute 'FeatureColumnType' that could not be resolved [D:\a\1\s\src\Microsoft.ML.Data\Microsoft.ML.Data.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5109: The file at 'lib/netstandard2.0/_._' uses the symbol for empty directory '_._', but it is present in a directory that contains other files. Please remove this file from directories that contain other files. [D:\a\1\s\src\Microsoft.ML.Mkl.Redist\Microsoft.ML.Mkl.Redist.csproj]

And in .NETFramework builds

D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277: Found conflicts between different versions of "System.CodeDom" that could not be resolved. [D:\a\1\s\test\Microsoft.ML.PerformanceTests\Microsoft.ML.PerformanceTests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277: There was a conflict between "System.CodeDom, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" and "System.CodeDom, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51". [D:\a\1\s\test\Microsoft.ML.PerformanceTests\Microsoft.ML.PerformanceTests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:     "System.CodeDom, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was chosen because it was primary and "System.CodeDom, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was not. [D:\a\1\s\test\Microsoft.ML.PerformanceTests\Microsoft.ML.PerformanceTests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:     References which depend on "System.CodeDom, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" [C:\Users\VssAdministrator\.nuget\packages\system.codedom\4.4.0\ref\net461\System.CodeDom.dll]. [D:\a\1\s\test\Microsoft.ML.PerformanceTests\Microsoft.ML.PerformanceTests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:         C:\Users\VssAdministrator\.nuget\packages\system.codedom\4.4.0\ref\net461\System.CodeDom.dll [D:\a\1\s\test\Microsoft.ML.PerformanceTests\Microsoft.ML.PerformanceTests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\VssAdministrator\.nuget\packages\system.codedom\4.4.0\ref\net461\System.CodeDom.dll". [D:\a\1\s\test\Microsoft.ML.PerformanceTests\Microsoft.ML.PerformanceTests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             C:\Users\VssAdministrator\.nuget\packages\system.codedom\4.4.0\ref\net461\System.CodeDom.dll [D:\a\1\s\test\Microsoft.ML.PerformanceTests\Microsoft.ML.PerformanceTests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:     References which depend on "System.CodeDom, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" []. [D:\a\1\s\test\Microsoft.ML.PerformanceTests\Microsoft.ML.PerformanceTests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:         C:\Users\VssAdministrator\.nuget\packages\benchmarkdotnet\0.12.0\lib\netstandard2.0\BenchmarkDotNet.dll [D:\a\1\s\test\Microsoft.ML.PerformanceTests\Microsoft.ML.PerformanceTests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\VssAdministrator\.nuget\packages\benchmarkdotnet\0.12.0\lib\netstandard2.0\BenchmarkDotNet.dll". [D:\a\1\s\test\Microsoft.ML.PerformanceTests\Microsoft.ML.PerformanceTests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             C:\Users\VssAdministrator\.nuget\packages\benchmarkdotnet\0.12.0\lib\netstandard2.0\BenchmarkDotNet.dll [D:\a\1\s\test\Microsoft.ML.PerformanceTests\Microsoft.ML.PerformanceTests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             C:\Users\VssAdministrator\.nuget\packages\benchmarkdotnet.diagnostics.windows\0.12.0\lib\netstandard2.0\BenchmarkDotNet.Diagnostics.Windows.dll [D:\a\1\s\test\Microsoft.ML.PerformanceTests\Microsoft.ML.PerformanceTests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277: Found conflicts between different versions of "System.CodeDom" that could not be resolved. [D:\a\1\s\test\Microsoft.ML.Benchmarks.Tests\Microsoft.ML.Benchmarks.Tests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277: There was a conflict between "System.CodeDom, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" and "System.CodeDom, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51". [D:\a\1\s\test\Microsoft.ML.Benchmarks.Tests\Microsoft.ML.Benchmarks.Tests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:     "System.CodeDom, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was chosen because it was primary and "System.CodeDom, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was not. [D:\a\1\s\test\Microsoft.ML.Benchmarks.Tests\Microsoft.ML.Benchmarks.Tests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:     References which depend on "System.CodeDom, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" [C:\Users\VssAdministrator\.nuget\packages\system.codedom\4.4.0\ref\net461\System.CodeDom.dll]. [D:\a\1\s\test\Microsoft.ML.Benchmarks.Tests\Microsoft.ML.Benchmarks.Tests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:         C:\Users\VssAdministrator\.nuget\packages\system.codedom\4.4.0\ref\net461\System.CodeDom.dll [D:\a\1\s\test\Microsoft.ML.Benchmarks.Tests\Microsoft.ML.Benchmarks.Tests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\VssAdministrator\.nuget\packages\system.codedom\4.4.0\ref\net461\System.CodeDom.dll". [D:\a\1\s\test\Microsoft.ML.Benchmarks.Tests\Microsoft.ML.Benchmarks.Tests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             C:\Users\VssAdministrator\.nuget\packages\system.codedom\4.4.0\ref\net461\System.CodeDom.dll [D:\a\1\s\test\Microsoft.ML.Benchmarks.Tests\Microsoft.ML.Benchmarks.Tests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:     References which depend on "System.CodeDom, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" []. [D:\a\1\s\test\Microsoft.ML.Benchmarks.Tests\Microsoft.ML.Benchmarks.Tests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:         C:\Users\VssAdministrator\.nuget\packages\benchmarkdotnet\0.12.0\lib\netstandard2.0\BenchmarkDotNet.dll [D:\a\1\s\test\Microsoft.ML.Benchmarks.Tests\Microsoft.ML.Benchmarks.Tests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\VssAdministrator\.nuget\packages\benchmarkdotnet\0.12.0\lib\netstandard2.0\BenchmarkDotNet.dll". [D:\a\1\s\test\Microsoft.ML.Benchmarks.Tests\Microsoft.ML.Benchmarks.Tests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             C:\Users\VssAdministrator\.nuget\packages\benchmarkdotnet\0.12.0\lib\netstandard2.0\BenchmarkDotNet.dll [D:\a\1\s\test\Microsoft.ML.Benchmarks.Tests\Microsoft.ML.Benchmarks.Tests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             D:\a\1\s\artifacts\bin\Microsoft.ML.PerformanceTests\Release-netfx\net461\win-x64\Microsoft.ML.PerformanceTests.exe [D:\a\1\s\test\Microsoft.ML.Benchmarks.Tests\Microsoft.ML.Benchmarks.Tests.csproj]
D:\a\1\s\.dotnet\sdk\6.0.100-preview.3.21202.5\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             C:\Users\VssAdministrator\.nuget\packages\benchmarkdotnet.diagnostics.windows\0.12.0\lib\netstandard2.0\BenchmarkDotNet.Diagnostics.Windows.dll [D:\a\1\s\test\Microsoft.ML.Benchmarks.Tests\Microsoft.ML.Benchmarks.Tests.csproj]

We should both clean these up and enable warnings as errors at the build-level to keep the repo clean.

michaelgsharp commented 3 years ago

Sounds good. I can take care of it after the next release.

Is the way to fix the netfx errors by using binding redirects? After the release if you could point me to documentation about that I would appreciate it.

ericstj commented 3 years ago

For CodeDom you need to reference a newer package that has that assembly version (or higher). It looks to me like ML.NET is downgrading the dependency: https://github.com/dotnet/machinelearning/blob/f696661cbd36cbeed53ea0cd3e129f2e24476e1d/eng/Versions.props#L17

I would have expected that to cause a warning if you referenced a lower version than a dependency, but maybe the dependency forgot to reference the package? That's worth looking into. I can show you how to examine the assets file + binlog to gain an understanding.