From cd7176f700c69184f8f21c8d4ace0e8b8673a2f0 Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Mon, 11 Jan 2021 16:49:46 -0800 Subject: [PATCH 1/4] fixed nuget url, versions, and failing tests --- NuGet.config | 2 +- eng/Versions.props | 6 +++--- .../Code/ContractsCheckTest.cs | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/NuGet.config b/NuGet.config index 48ce3bd5ca..362a82f95b 100644 --- a/NuGet.config +++ b/NuGet.config @@ -11,7 +11,7 @@ - + diff --git a/eng/Versions.props b/eng/Versions.props index fbead7ba7f..353e9fecb6 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -2,7 +2,7 @@ - 0.12.0 - 1.0.1-beta1.20080.1 + 1.0.1-beta1.20374.2 3.0.1 0.0.6-test - 0.0.6-test + 0.0.7-test 0.0.13-test 0.0.6-test 4.6.1 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 e6e5528ee9d1644eda33d1023338b92103941050 Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Tue, 12 Jan 2021 11:41:23 -0800 Subject: [PATCH 2/4] changes from pr comments and MacOS changes --- NuGet.config | 4 ++-- build/ci/job-template.yml | 13 ++----------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/NuGet.config b/NuGet.config index 362a82f95b..8967174a89 100644 --- a/NuGet.config +++ b/NuGet.config @@ -10,8 +10,8 @@ - - + + diff --git a/build/ci/job-template.yml b/build/ci/job-template.yml index d1ebf59c6f..8baa40054f 100644 --- a/build/ci/job-template.yml +++ b/build/ci/job-template.yml @@ -55,18 +55,9 @@ jobs: container: ${{ parameters.container }} steps: - # Work around MacOS Homebrew image/environment bug: https://github.com/actions/virtual-environments/issues/1811 - - ${{ if eq(parameters.pool.name, 'Hosted macOS') }}: - - script: | - brew uninstall openssl@1.0.2t | - brew uninstall python@2.7.17 | - brew untap local/openssl | - brew untap local/python2 - displayName: MacOS Homebrew bug Workaround - continueOnError: true # Extra MacOS step required to install OS-specific dependencies - ${{ if eq(parameters.pool.name, 'Hosted macOS') }}: - - script: brew update && brew unlink python@3.8 && brew install mono-libgdiplus && brew install $(Build.SourcesDirectory)/build/libomp.rb && brew link libomp --force + - script: brew update && brew unlink python@3.9 && brew install mono-libgdiplus && brew install $(Build.SourcesDirectory)/build/libomp.rb && brew link libomp --force displayName: Install MacOS 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" @@ -156,7 +147,7 @@ jobs: testRunner: 'xUnit' searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults' # Upload all test results except performance test project. On CI by default performance tests - # will not run and test result files will still be generate without details. Avoid uploading + # will not run and test result files will still be generate without details. Avoid uploading # performance test result to avoid warnings on publish test result stage. testResultsFiles: | **/*.xml From bffba75e9c7649796dcf737ac6d95e0614755ee8 Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Tue, 12 Jan 2021 11:55:41 -0800 Subject: [PATCH 3/4] MacOS homebrew bug workaround --- build/ci/job-template.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build/ci/job-template.yml b/build/ci/job-template.yml index 8baa40054f..4944eb6c6c 100644 --- a/build/ci/job-template.yml +++ b/build/ci/job-template.yml @@ -55,9 +55,15 @@ jobs: 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 # Extra MacOS step required to install OS-specific dependencies - ${{ if eq(parameters.pool.name, 'Hosted macOS') }}: - - script: brew update && brew unlink python@3.9 && brew install mono-libgdiplus && brew install $(Build.SourcesDirectory)/build/libomp.rb && brew link libomp --force + - script: brew update && brew install mono-libgdiplus && brew install $(Build.SourcesDirectory)/build/libomp.rb && brew link libomp --force displayName: Install MacOS 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" From f4e485652b9b89c1335ba01b10f9ccb05df52295 Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Tue, 12 Jan 2021 14:32:53 -0800 Subject: [PATCH 4/4] removed unnused nuget url --- NuGet.config | 1 - 1 file changed, 1 deletion(-) diff --git a/NuGet.config b/NuGet.config index 8967174a89..30ab880580 100644 --- a/NuGet.config +++ b/NuGet.config @@ -10,7 +10,6 @@ -