Skip to content

Commit

Permalink
Merge pull request #33514 from sharwell/broken-validation
Browse files Browse the repository at this point in the history
Disable broken checksum validation
  • Loading branch information
sharwell authored Feb 21, 2019
2 parents 8a5b8e8 + e8bb766 commit f32205e
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/Workspaces/Remote/Core/Services/SolutionCreator.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#if DEBUG
#if false // https://github.com/dotnet/roslyn/issues/33476
#define VALIDATE_CHECKSUM
#endif
#endif

using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Internal.Log;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Remote.DebugUtil;
using Microsoft.CodeAnalysis.Remote.Shared;
using Microsoft.CodeAnalysis.Serialization;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;

#if VALIDATE_CHECKSUM
using System.Diagnostics;
using System.Text;
using Microsoft.CodeAnalysis.Internal.Log;
using Microsoft.CodeAnalysis.Remote.DebugUtil;
using Microsoft.CodeAnalysis.Remote.Shared;
#endif

namespace Microsoft.CodeAnalysis.Remote
{
Expand Down Expand Up @@ -628,7 +637,7 @@ private ImmutableArray<string> GetStrongNameKeyPaths(ProjectInfo.ProjectAttribut

private async Task ValidateChecksumAsync(Checksum givenSolutionChecksum, Solution solution)
{
#if DEBUG
#if VALIDATE_CHECKSUM
var currentSolutionChecksum = await solution.State.GetChecksumAsync(_cancellationToken).ConfigureAwait(false);

if (givenSolutionChecksum == currentSolutionChecksum)
Expand Down Expand Up @@ -660,6 +669,7 @@ private async Task ValidateChecksumAsync(Checksum givenSolutionChecksum, Solutio
#endif
}

#if VALIDATE_CHECKSUM
private async Task RemoveDuplicateChecksumsAsync(Checksum givenSolutionChecksum, Dictionary<Checksum, object> map)
{
var solutionChecksums = await _assetService.GetAssetAsync<SolutionStateChecksums>(givenSolutionChecksum, _cancellationToken).ConfigureAwait(false);
Expand All @@ -683,5 +693,6 @@ private async Task RemoveDuplicateChecksumsAsync(Checksum givenSolutionChecksum,
}
}
}
#endif
}
}

0 comments on commit f32205e

Please sign in to comment.