From 653ac7296d1ea404cdea4758eda8833927ef99a5 Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Tue, 26 Jan 2021 14:23:41 -0800 Subject: [PATCH 1/5] updated nuget feeds and versions --- BuildToolsVersion.txt | 2 +- Directory.Build.props | 14 +++++++------- build/Dependencies.props | 4 ++-- build/ci/job-template.yml | 18 ++++++++++++------ init-tools.cmd | 2 +- .../Code/ContractsCheckTest.cs | 16 ++++++++-------- 6 files changed, 31 insertions(+), 25 deletions(-) diff --git a/BuildToolsVersion.txt b/BuildToolsVersion.txt index 61c8d2d4e3..07318c0f04 100644 --- a/BuildToolsVersion.txt +++ b/BuildToolsVersion.txt @@ -1 +1 @@ -3.0.0-preview4-04926-01 +3.0.0-preview4-06015-01 diff --git a/Directory.Build.props b/Directory.Build.props index 5ef129c098..b2bfe844f1 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -21,8 +21,8 @@ https://api.nuget.org/v3/index.json; https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json; - https://dotnet.myget.org/F/dotnet-core/api/v3/index.json; - https://dotnet.myget.org/F/roslyn-analyzers/api/v3/index.json; + https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json; + https://pkgs.dev.azure.com/dnceng/public/_packaging/myget-legacy/nuget/v3/index.json; https://pkgs.dev.azure.com/dnceng/public/_packaging/MachineLearning/nuget/v3/index.json; https://pkgs.dev.azure.com/dnceng/public/_packaging/machinelearning-testdata/nuget/v3/index.json; @@ -47,7 +47,7 @@ $(BaseOutputPath)$(PlatformConfig)\$(MSBuildProjectName)\ $(ObjDir)/packages/ - + $(BinDir)packages_noship/ $(BinDir)packages/ @@ -60,7 +60,7 @@ $(RepoRoot)Tools/ - @@ -93,16 +93,16 @@ $(LatestCommit) - - + 8.0 4.7 true - + true diff --git a/build/Dependencies.props b/build/Dependencies.props index e9aa31db0c..3e97fbebee 100644 --- a/build/Dependencies.props +++ b/build/Dependencies.props @@ -51,10 +51,10 @@ 0.12.0 - 1.0.1-beta1.20080.1 + 1.0.1-beta1.20156.1 3.0.1 0.0.6-test - 0.0.6-test + 0.0.7-test 0.0.12-test 0.0.6-test 4.6.1 diff --git a/build/ci/job-template.yml b/build/ci/job-template.yml index 52abf2dc99..78b0f98da2 100644 --- a/build/ci/job-template.yml +++ b/build/ci/job-template.yml @@ -43,14 +43,20 @@ jobs: _targetFramework: netcoreapp2.1 ${{ if ne(parameters.customMatrixes, '') }}: ${{ insert }}: ${{ parameters.customMatrixes }} - + pool: ${{ parameters.pool }} ${{ if ne(parameters.container, '') }}: container: ${{ parameters.container }} steps: + # Work around MacOS Homebrew image/environment bug: https://github.com/actions/virtual-environments/issues/2322#issuecomment-749211076 + - ${{ if eq(parameters.pool.name, 'Hosted macOS') }}: + - script: | + rm -rf /usr/local/bin/2to3 + displayName: MacOS Homebrew bug Workaround + continueOnError: true - ${{ if eq(parameters.pool.name, 'Hosted macOS') }}: - - script: brew update && brew install $(Build.SourcesDirectory)/build/libomp.rb && brew unlink python@2 && brew install mono-libgdiplus gettext && brew link gettext --force && brew link libomp --force + - script: brew update && brew install mono-libgdiplus && brew install $(Build.SourcesDirectory)/build/libomp.rb && brew link libomp --force displayName: Install build dependencies - ${{ if and( eq(parameters.nightlyBuild, 'true'), eq(parameters.pool.name, 'Hosted Ubuntu 1604')) }}: - bash: echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$(nightlyBuildRunPath):$LD_LIBRARY_PATH" @@ -89,8 +95,8 @@ jobs: Get-ChildItem -Path '.\bin\AnyCPU.*' -Recurse | Select -ExpandProperty FullName | Where {$_ -notlike '*\Microsoft.ML.NightlyBuild.Tests*'} | - sort length -Descending | - Remove-Item -force + sort length -Descending | + Remove-Item -force Write-Output "Done cleaning up usless project..." displayName: Clean up useless project - script: $(dotnetPath) msbuild -restore $(nightlyBuildProjPath) /p:ReferenceTypeForTestFramework="Nuget" /p:Configuration=$(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} @@ -119,10 +125,10 @@ jobs: testAssemblyVer2: | **\*test.dll **\*tests.dll - !**\obj\** + !**\obj\** runSettingsFile: $(Build.SourcesDirectory)/tools-local/vstest.runsettings searchFolder: '$(System.DefaultWorkingDirectory)' - vstestLocationMethod: 'version' + vstestLocationMethod: 'version' vsTestVersion: 'latest' runInParallel: False runTestsInIsolation: True diff --git a/init-tools.cmd b/init-tools.cmd index 4c7893ec49..ab999d8d73 100644 --- a/init-tools.cmd +++ b/init-tools.cmd @@ -6,7 +6,7 @@ if [%PACKAGES_DIR%]==[] set PACKAGES_DIR=%~dp0packages if [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\ if [%DOTNET_CMD%]==[] set DOTNET_CMD=%DOTNET_PATH%dotnet.exe -if [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json +if [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://pkgs.dev.azure.com/dnceng/public/_packaging/myget-legacy/nuget/v3/index.json set /P BUILDTOOLS_VERSION=< "%~dp0BuildToolsVersion.txt" set BUILD_TOOLS_PATH=%PACKAGES_DIR%\Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib set INIT_TOOLS_RESTORE_PROJECT=%~dp0init-tools.msbuild diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs index 532d5ff49e..6822853ba4 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs @@ -39,8 +39,8 @@ public async Task ContractsCheck() VerifyCS.Diagnostic(ContractsCheckAnalyzer.SimpleMessageDiagnostic.Rule).WithLocation(basis + 32, 35).WithArguments("Check", "\"Less fine: \" + env.GetType().Name"), VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(basis + 34, 17).WithArguments("CheckUserArg", "name", "\"p\""), VerifyCS.Diagnostic(ContractsCheckAnalyzer.DecodeMessageWithLoadContextDiagnostic.Rule).WithLocation(basis + 39, 41).WithArguments("CheckDecode", "\"This message is suspicious\""), - new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithLocation("Test1.cs", 752, 24).WithMessage("'ICancelable' is inaccessible due to its protection level"), - new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithLocation("Test1.cs", 752, 67).WithMessage("'ICancelable.IsCanceled' is inaccessible due to its protection level"), + new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 24, 752, 35).WithMessage("'ICancelable' is inaccessible due to its protection level"), + new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 67, 752, 77).WithMessage("'ICancelable.IsCanceled' is inaccessible due to its protection level"), }; var test = new VerifyCS.Test @@ -126,9 +126,9 @@ public async Task ContractsCheckFix() VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(23, 39).WithArguments("CheckValue", "paramName", "\"noMatch\""), VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(24, 53).WithArguments("CheckUserArg", "name", "\"chumble\""), VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(25, 53).WithArguments("CheckUserArg", "name", "\"sp\""), - new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithLocation("Test1.cs", 752, 24).WithMessage("'ICancelable' is inaccessible due to its protection level"), - new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithLocation("Test1.cs", 752, 67).WithMessage("'ICancelable.IsCanceled' is inaccessible due to its protection level"), - new DiagnosticResult("CS1503", DiagnosticSeverity.Error).WithLocation("Test1.cs", 753, 90).WithMessage("Argument 2: cannot convert from 'Microsoft.ML.Runtime.IHostEnvironment' to 'Microsoft.ML.Runtime.IExceptionContext'"), + new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 24, 752, 35).WithMessage("'ICancelable' is inaccessible due to its protection level"), + new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 67, 752, 77).WithMessage("'ICancelable.IsCanceled' is inaccessible due to its protection level"), + new DiagnosticResult("CS1503", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 753, 90, 753, 93).WithMessage("Argument 2: cannot convert from 'Microsoft.ML.Runtime.IHostEnvironment' to 'Microsoft.ML.Runtime.IExceptionContext'"), }, }, FixedState = @@ -146,9 +146,9 @@ public async Task ContractsCheckFix() { VerifyCS.Diagnostic(ContractsCheckAnalyzer.ExceptionDiagnostic.Rule).WithLocation(9, 43).WithArguments("ExceptParam"), VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(23, 39).WithArguments("CheckValue", "paramName", "\"noMatch\""), - new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithLocation("Test1.cs", 752, 24).WithMessage("'ICancelable' is inaccessible due to its protection level"), - new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithLocation("Test1.cs", 752, 67).WithMessage("'ICancelable.IsCanceled' is inaccessible due to its protection level"), - new DiagnosticResult("CS1503", DiagnosticSeverity.Error).WithLocation("Test1.cs", 753, 90).WithMessage("Argument 2: cannot convert from 'Microsoft.ML.Runtime.IHostEnvironment' to 'Microsoft.ML.Runtime.IExceptionContext'"), + new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 24, 752, 35).WithMessage("'ICancelable' is inaccessible due to its protection level"), + new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 67, 752, 77).WithMessage("'ICancelable.IsCanceled' is inaccessible due to its protection level"), + new DiagnosticResult("CS1503", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 753, 90, 753, 93).WithMessage("Argument 2: cannot convert from 'Microsoft.ML.Runtime.IHostEnvironment' to 'Microsoft.ML.Runtime.IExceptionContext'"), }, }, }; From e3663a93e25d1ac1768f92c621287853026df158 Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Tue, 26 Jan 2021 14:51:55 -0800 Subject: [PATCH 2/5] fixed .sh url --- init-tools.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init-tools.sh b/init-tools.sh index 492df5711f..0b402cca5b 100755 --- a/init-tools.sh +++ b/init-tools.sh @@ -6,7 +6,7 @@ __PACKAGES_DIR="$__scriptpath/packages" __TOOLRUNTIME_DIR="$__scriptpath/Tools" __DOTNET_PATH="$__TOOLRUNTIME_DIR/dotnetcli" __DOTNET_CMD="$__DOTNET_PATH/dotnet" -if [ -z "${__BUILDTOOLS_SOURCE:-}" ]; then __BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json; fi +if [ -z "${__BUILDTOOLS_SOURCE:-}" ]; then __BUILDTOOLS_SOURCE=https://pkgs.dev.azure.com/dnceng/public/_packaging/myget-legacy/nuget/v3/index.json; fi export __BUILDTOOLS_USE_CSPROJ=true __BUILD_TOOLS_PACKAGE_VERSION=$(cat "$__scriptpath/BuildToolsVersion.txt" | sed 's/\r$//') # remove CR if mounted repo on Windows drive From 91433b40c254edb760e1521801404c37a514c925 Mon Sep 17 00:00:00 2001 From: Michael Sharp <51342856+michaelgsharp@users.noreply.github.com> Date: Wed, 27 Jan 2021 15:28:30 -0800 Subject: [PATCH 3/5] Update ContractsCheckTest.cs Reverting test file and version. --- .../Code/ContractsCheckTest.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs index 6822853ba4..13abf21e35 100644 --- a/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs +++ b/test/Microsoft.ML.CodeAnalyzer.Tests/Code/ContractsCheckTest.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -39,8 +39,8 @@ public async Task ContractsCheck() VerifyCS.Diagnostic(ContractsCheckAnalyzer.SimpleMessageDiagnostic.Rule).WithLocation(basis + 32, 35).WithArguments("Check", "\"Less fine: \" + env.GetType().Name"), VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(basis + 34, 17).WithArguments("CheckUserArg", "name", "\"p\""), VerifyCS.Diagnostic(ContractsCheckAnalyzer.DecodeMessageWithLoadContextDiagnostic.Rule).WithLocation(basis + 39, 41).WithArguments("CheckDecode", "\"This message is suspicious\""), - new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 24, 752, 35).WithMessage("'ICancelable' is inaccessible due to its protection level"), - new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 67, 752, 77).WithMessage("'ICancelable.IsCanceled' is inaccessible due to its protection level"), + new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithLocation("Test1.cs", 752, 24).WithMessage("'ICancelable' is inaccessible due to its protection level"), + new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithLocation("Test1.cs", 752, 67).WithMessage("'ICancelable.IsCanceled' is inaccessible due to its protection level"), }; var test = new VerifyCS.Test @@ -126,9 +126,9 @@ public async Task ContractsCheckFix() VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(23, 39).WithArguments("CheckValue", "paramName", "\"noMatch\""), VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(24, 53).WithArguments("CheckUserArg", "name", "\"chumble\""), VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(25, 53).WithArguments("CheckUserArg", "name", "\"sp\""), - new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 24, 752, 35).WithMessage("'ICancelable' is inaccessible due to its protection level"), - new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 67, 752, 77).WithMessage("'ICancelable.IsCanceled' is inaccessible due to its protection level"), - new DiagnosticResult("CS1503", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 753, 90, 753, 93).WithMessage("Argument 2: cannot convert from 'Microsoft.ML.Runtime.IHostEnvironment' to 'Microsoft.ML.Runtime.IExceptionContext'"), + new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithLocation("Test1.cs", 752, 24).WithMessage("'ICancelable' is inaccessible due to its protection level"), + new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithLocation("Test1.cs", 752, 67).WithMessage("'ICancelable.IsCanceled' is inaccessible due to its protection level"), + new DiagnosticResult("CS1503", DiagnosticSeverity.Error).WithLocation("Test1.cs", 753, 90).WithMessage("Argument 2: cannot convert from 'Microsoft.ML.Runtime.IHostEnvironment' to 'Microsoft.ML.Runtime.IExceptionContext'"), }, }, FixedState = @@ -146,9 +146,9 @@ public async Task ContractsCheckFix() { VerifyCS.Diagnostic(ContractsCheckAnalyzer.ExceptionDiagnostic.Rule).WithLocation(9, 43).WithArguments("ExceptParam"), VerifyCS.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(23, 39).WithArguments("CheckValue", "paramName", "\"noMatch\""), - new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 24, 752, 35).WithMessage("'ICancelable' is inaccessible due to its protection level"), - new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 67, 752, 77).WithMessage("'ICancelable.IsCanceled' is inaccessible due to its protection level"), - new DiagnosticResult("CS1503", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 753, 90, 753, 93).WithMessage("Argument 2: cannot convert from 'Microsoft.ML.Runtime.IHostEnvironment' to 'Microsoft.ML.Runtime.IExceptionContext'"), + new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithLocation("Test1.cs", 752, 24).WithMessage("'ICancelable' is inaccessible due to its protection level"), + new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithLocation("Test1.cs", 752, 67).WithMessage("'ICancelable.IsCanceled' is inaccessible due to its protection level"), + new DiagnosticResult("CS1503", DiagnosticSeverity.Error).WithLocation("Test1.cs", 753, 90).WithMessage("Argument 2: cannot convert from 'Microsoft.ML.Runtime.IHostEnvironment' to 'Microsoft.ML.Runtime.IExceptionContext'"), }, }, }; From 17765cbee7da42d876406969b8604a158a75fac8 Mon Sep 17 00:00:00 2001 From: Michael Sharp <51342856+michaelgsharp@users.noreply.github.com> Date: Wed, 27 Jan 2021 15:29:14 -0800 Subject: [PATCH 4/5] Update Dependencies.props Fixed testing version. --- build/Dependencies.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Dependencies.props b/build/Dependencies.props index 3e97fbebee..0b997ef8ec 100644 --- a/build/Dependencies.props +++ b/build/Dependencies.props @@ -51,7 +51,7 @@ 0.12.0 - 1.0.1-beta1.20156.1 + 1.0.1-beta1.20080.1 3.0.1 0.0.6-test 0.0.7-test From af171d1ea915f47b91c48403a7779a9ed234b166 Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Wed, 27 Jan 2021 22:28:24 -0800 Subject: [PATCH 5/5] set precision to 0 --- test/Microsoft.ML.Tests/TrainerEstimators/LbfgsTests.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Microsoft.ML.Tests/TrainerEstimators/LbfgsTests.cs b/test/Microsoft.ML.Tests/TrainerEstimators/LbfgsTests.cs index 81f9810b00..0c7a6ffd40 100644 --- a/test/Microsoft.ML.Tests/TrainerEstimators/LbfgsTests.cs +++ b/test/Microsoft.ML.Tests/TrainerEstimators/LbfgsTests.cs @@ -117,8 +117,8 @@ public void TestLRWithStats() validateStats(linearModel); var modelAndSchemaPath = GetOutputPath("TestLRWithStats.zip"); - - // Save model. + + // Save model. ML.Model.Save(transformer, dataView.Schema, modelAndSchemaPath); ITransformer transformerChain; @@ -202,7 +202,7 @@ public void TestMLRWithStats() CompareNumbersWithTolerance(stats.Deviance, 45.79, digitsOfPrecision: 2); CompareNumbersWithTolerance(stats.NullDeviance, 329.58, digitsOfPrecision: 2); #else - CompareNumbersWithTolerance(stats.Deviance, 45.35, digitsOfPrecision: 2); + CompareNumbersWithTolerance(stats.Deviance, 45.35, digitsOfPrecision: 0); CompareNumbersWithTolerance(stats.NullDeviance, 329.58, digitsOfPrecision: 2); #endif //Assert.Equal(14, stats.ParametersCount); @@ -212,7 +212,7 @@ public void TestMLRWithStats() validateStats(model); var modelAndSchemaPath = GetOutputPath("TestMLRWithStats.zip"); - // Save model. + // Save model. ML.Model.Save(transformer, dataView.Schema, modelAndSchemaPath); // Load model.