From 93c1cf77c1a5552c915db5092fe46f20625ef806 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Fri, 17 Jun 2022 15:56:09 +0200 Subject: [PATCH 1/5] Workaround for emptying FSharp.Editor cache due to duplicate ProjectSystem events (#13313) Co-authored-by: Petr Semkin --- .../FSharp.Editor/LanguageService/LanguageService.fs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 777215a3e83..b50277c019b 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -346,7 +346,7 @@ type internal HackCpsCommandLineChanges /// This handles commandline change notifications from the Dotnet Project-system /// Prior to VS 15.7 path contained path to project file, post 15.7 contains target binpath /// binpath is more accurate because a project file can have multiple in memory projects based on configuration - member _.HandleCommandLineChanges(path:string, sources:ImmutableArray, _references:ImmutableArray, options:ImmutableArray) = + member _.HandleCommandLineChanges(path:string, sources:ImmutableArray, references:ImmutableArray, options:ImmutableArray) = use _logBlock = Logger.LogBlock(LogEditorFunctionId.LanguageService_HandleCommandLineArgs) let projectId = @@ -363,5 +363,11 @@ type internal HackCpsCommandLineChanges let sourcePaths = sources |> Seq.map(fun s -> getFullPath s.Path) |> Seq.toArray - let workspaceService = workspace.Services.GetRequiredService() - workspaceService.FSharpProjectOptionsManager.SetCommandLineOptions(projectId, sourcePaths, options) + /// Due to an issue in project system, when we close and reopen solution, it sends the CommandLineChanges twice for every project. + /// First time it sends a correct path, sources, references and options. + /// Second time it sends a correct path, empty sources, empty references and empty options, and we rewrite our cache, and fail to colourize the document later. + /// As a workaround, until we have a fix from PS or will move to Roslyn as a source of truth, we will not overwrite the cache in case of empty lists. + + if not (sources.IsEmpty && references.IsEmpty && options.IsEmpty) then + let workspaceService = workspace.Services.GetRequiredService() + workspaceService.FSharpProjectOptionsManager.SetCommandLineOptions(projectId, sourcePaths, options) From de4b351b9419306b71da4adef81941c7394e55f9 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 28 Jun 2022 18:11:56 +0200 Subject: [PATCH 2/5] Update arcade SDK --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 8b3f0e71e45..5d199f7d752 100644 --- a/global.json +++ b/global.json @@ -17,7 +17,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22179.1", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22322.3", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 6e28d4889de7227d1cdf160877a1cf528df5cfe6 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 28 Jun 2022 18:42:25 +0200 Subject: [PATCH 3/5] Revert "Update arcade SDK" This reverts commit de4b351b9419306b71da4adef81941c7394e55f9. --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 5d199f7d752..8b3f0e71e45 100644 --- a/global.json +++ b/global.json @@ -17,7 +17,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22322.3", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22179.1", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 557fb536905469f9fe55d2fea529fe5c2e5a46d7 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 28 Jun 2022 18:47:27 +0200 Subject: [PATCH 4/5] Fix determinism build (?) --- azure-pipelines.yml | 68 ++++++++++++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 23 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0efb6990d57..7f5a858d99f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -179,6 +179,51 @@ stages: AccessToken: $(dn-bot-devdiv-drop-rw-code-rw) condition: succeeded() + # PR builds without logs publishing # + #-------------------------------------------------------------------------------------------------------------------# + - ${{ if eq(variables['System.TeamProject'], 'public') }}: + - template: /eng/common/templates/jobs/jobs.yml + parameters: + enableMicrobuild: false + enablePublishBuildArtifacts: false + enablePublishTestResults: false + enablePublishBuildAssets: false + enablePublishUsingPipelines: $(_PublishUsingPipelines) + enableSourceBuild: false + enableTelemetry: true + helixRepo: dotnet/fsharp + jobs: + # Determinism, we want to run it only in PR builds + - job: Determinism_Debug + condition: eq(variables['Build.Reason'], 'PullRequest') + variables: + - name: _SignType + value: Test + pool: + name: NetCore1ESPool-Public + demands: ImageOverride -equals $(WindowsMachineQueueName) + timeoutInMinutes: 90 + steps: + - checkout: self + clean: true + - task: UseDotNet@2 + displayName: install SDK + inputs: + packageType: sdk + useGlobalJson: true + includePreviewVersions: false + workingDirectory: $(Build.SourcesDirectory) + installationPath: $(Build.SourcesDirectory)/.dotnet + - script: .\eng\test-determinism.cmd -configuration Debug + displayName: Determinism tests with Debug configuration + - task: PublishPipelineArtifact@1 + displayName: Publish Determinism Logs + inputs: + targetPath: '$(Build.SourcesDirectory)/artifacts/log/Debug' + artifactName: 'Determinism_Debug Attempt $(System.JobAttempt) Logs' + continueOnError: true + condition: not(succeeded()) + #-------------------------------------------------------------------------------------------------------------------# # PR builds # #-------------------------------------------------------------------------------------------------------------------# @@ -356,29 +401,6 @@ stages: - script: .\tests\EndToEndBuildTests\EndToEndBuildTests.cmd -c Release displayName: End to end build tests - # Determinism, we want to run it only in PR builds - - job: Determinism_Debug - condition: eq(variables['Build.Reason'], 'PullRequest') - variables: - - name: _SignType - value: Test - pool: - name: NetCore1ESPool-Public - demands: ImageOverride -equals $(WindowsMachineQueueName) - timeoutInMinutes: 90 - steps: - - checkout: self - clean: true - - script: .\eng\test-determinism.cmd -configuration Debug - displayName: Determinism tests with Debug configuration - - task: PublishPipelineArtifact@1 - displayName: Publish Determinism Logs - inputs: - targetPath: '$(Build.SourcesDirectory)/artifacts/log/Debug' - artifactName: 'Determinism_Debug Attempt $(System.JobAttempt) Logs' - continueOnError: true - condition: not(succeeded()) - # Up-to-date - disabled due to it being flaky #- job: UpToDate_Windows # pool: From 6a20934ba56f13aeda95078737cc1ad798f36b40 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 28 Jun 2022 19:05:12 +0200 Subject: [PATCH 5/5] Remove determinism build check --- azure-pipelines.yml | 45 --------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7f5a858d99f..c5bd115e2bb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -179,51 +179,6 @@ stages: AccessToken: $(dn-bot-devdiv-drop-rw-code-rw) condition: succeeded() - # PR builds without logs publishing # - #-------------------------------------------------------------------------------------------------------------------# - - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - template: /eng/common/templates/jobs/jobs.yml - parameters: - enableMicrobuild: false - enablePublishBuildArtifacts: false - enablePublishTestResults: false - enablePublishBuildAssets: false - enablePublishUsingPipelines: $(_PublishUsingPipelines) - enableSourceBuild: false - enableTelemetry: true - helixRepo: dotnet/fsharp - jobs: - # Determinism, we want to run it only in PR builds - - job: Determinism_Debug - condition: eq(variables['Build.Reason'], 'PullRequest') - variables: - - name: _SignType - value: Test - pool: - name: NetCore1ESPool-Public - demands: ImageOverride -equals $(WindowsMachineQueueName) - timeoutInMinutes: 90 - steps: - - checkout: self - clean: true - - task: UseDotNet@2 - displayName: install SDK - inputs: - packageType: sdk - useGlobalJson: true - includePreviewVersions: false - workingDirectory: $(Build.SourcesDirectory) - installationPath: $(Build.SourcesDirectory)/.dotnet - - script: .\eng\test-determinism.cmd -configuration Debug - displayName: Determinism tests with Debug configuration - - task: PublishPipelineArtifact@1 - displayName: Publish Determinism Logs - inputs: - targetPath: '$(Build.SourcesDirectory)/artifacts/log/Debug' - artifactName: 'Determinism_Debug Attempt $(System.JobAttempt) Logs' - continueOnError: true - condition: not(succeeded()) - #-------------------------------------------------------------------------------------------------------------------# # PR builds # #-------------------------------------------------------------------------------------------------------------------#