Skip to content

Commit

Permalink
Enabling ConvertPdbsToWindowsPdbs (#8007)
Browse files Browse the repository at this point in the history
* Convert pdbs

* default the value to false

* Update test case

* updated sdk

* test

* Revert

* updated the test

* test sdk

* Revert

* updated

* updated sdk

* revert feed task change

* update sdk

* revert

* revert
  • Loading branch information
epananth authored Oct 7, 2021
1 parent 8725d09 commit a661399
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
1 change: 1 addition & 0 deletions eng/publishing/v3/publish-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
/p:DotNetBuildsPublicChecksumsUriBase64='$(dotnetbuilds-public-container-checksum-uri-base64)'
/p:DotNetBuildsInternalUriBase64='$(dotnetbuilds-internal-container-uri-base64)'
/p:DotNetBuildsInternalChecksumsUriBase64='$(dotnetbuilds-internal-container-checksum-uri-base64)'
/p:ConvertPortablePdbsToWindowsPdbs='true'
- template: /eng/common/templates/steps/publish-logs.yml
parameters:
StageLabel: '${{ parameters.stageName }}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
<InternalChecksumsFeedKey>$(InternalChecksumsAzureAccountKey)</InternalChecksumsFeedKey>
<AllowFeedOverrides Condition="'$(AllowFeedOverrides)' == ''">false</AllowFeedOverrides>
<UseStreamingPublishing Condition="'$(UseStreamingPublishing)' == ''">false</UseStreamingPublishing>
<ConvertPortablePdbsToWindowsPdbs Condition="'$(ConvertPortablePdbsToWindowsPdbs)' == ''">false</ConvertPortablePdbsToWindowsPdbs>
<ArtifactsBasePath Condition="'$(ArtifactsBasePath)' == ''">$(BlobBasePath)</ArtifactsBasePath>
<NonStreamingPublishingMaxClients Condition="'$(NonStreamingPublishingMaxClients)' == ''">12</NonStreamingPublishingMaxClients>
<StreamingPublishingMaxClients Condition="'$(UseStreamingPublishing)' == 'true' and '$(StreamingPublishingMaxClients)' == ''">16</StreamingPublishingMaxClients>
Expand Down Expand Up @@ -172,6 +173,7 @@
FeedKeys="@(FeedKey)"
FeedSasUris="@(FeedSasUri)"
FeedOverrides="@(FeedOverride)"
ConvertPortablePdbsToWindowsPdbs="$(ConvertPortablePdbsToWindowsPdbs)"
/>
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public async Task TemporarySymbolDirectoryDoesNotExists()
};
var path = TestInputs.GetFullPath("Symbol");
var buildAsset = new Dictionary<string, HashSet<Asset>>();
await task.HandleSymbolPublishingAsync(path, MsdlToken, SymWebToken, "", false, buildAsset, null, path);
await task.HandleSymbolPublishingAsync(path, MsdlToken, SymWebToken, "", false, false, buildAsset, null, path);
Assert.True(task.Log.HasLoggedErrors);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ public class PublishArtifactsInManifest : MSBuildTaskBase
/// </summary>
public bool PublishSpecialClrFiles { get; set; }

public bool ConvertPortablePdbsToWindowsPdbs { get; set; }

/// <summary>
/// If true, safety checks only print messages and do not error
/// - Internal asset to public feed
Expand Down Expand Up @@ -342,6 +344,7 @@ internal PublishArtifactsInManifestBase ConstructPublishingV3Task(BuildModel bui
MsdlToken = this.MsdlToken,
SymbolPublishingExclusionsFile = this.SymbolPublishingExclusionsFile,
PublishSpecialClrFiles = this.PublishSpecialClrFiles,
ConvertPortablePdbsToWindowsPdbs = this.ConvertPortablePdbsToWindowsPdbs,
BuildQuality = this.BuildQuality,
ArtifactsBasePath = this.ArtifactsBasePath,
AzdoApiToken = this.AzdoApiToken,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,18 +396,20 @@ public void CheckForStableAssetsInNonIsolatedFeeds()
/// <param name="symbolPublishingExclusionsFile">Right now we do not add any files to this, so this is going to be null</param>
/// <param name="publishSpecialClrFiles">If true, the special coreclr module indexed files like DBI, DAC and SOS are published</param>
/// <param name="clientThrottle">To avoid starting too many processes</param>
/// <param name="convertPortablePdbsToWindowsPdbs">If true, convert protable pdbs to windows pdbs</param>
/// <returns>Task</returns>
public async Task PublishSymbolsUsingStreamingAsync(
string pdbArtifactsBasePath,
string msdlToken,
string symWebToken,
string symbolPublishingExclusionsFile,
bool publishSpecialClrFiles,
bool convertPortablePdbsToWindowsPdbs,
Dictionary<string, HashSet<Asset>> buildAssets,
SemaphoreSlim clientThrottle)
{
Log.LogMessage(MessageImportance.High,
$"Performing symbol publishing... \nExpirationInDays : {ExpirationInDays} \nConvertPortablePdbsToWindowsPdb : false \ndryRun: false ");
$"Performing symbol publishing... \nExpirationInDays : {ExpirationInDays} \nConvertPortablePdbsToWindowsPdb : {convertPortablePdbsToWindowsPdbs} \ndryRun: false ");
var symbolCategory = TargetFeedContentType.Symbols;

using HttpClient httpClient = CreateAzdoClient(AzureDevOpsOrg, false, AzureProject);
Expand Down Expand Up @@ -502,7 +504,7 @@ await PublishSymbolsHelper.PublishAsync(
null,
excludeFiles,
ExpirationInDays,
false,
convertPortablePdbsToWindowsPdbs,
publishSpecialClrFiles,
null,
false,
Expand Down Expand Up @@ -600,12 +602,14 @@ await PublishSymbolsHelper.PublishAsync(
/// <param name="temporarySymbolsLocation">Path to Symbol.nupkgs</param>
/// <param name="clientThrottle">To avoid starting too many processes</param>
/// <param name="publishSpecialClrFiles">If true, the special coreclr module indexed files like DBI, DAC and SOS are published</param>
/// <param name="convertPortablePdbsToWindowsPdbs">If true, convert protable pdbs to windows pdbs</param>
public async Task HandleSymbolPublishingAsync (
string pdbArtifactsBasePath,
string msdlToken,
string symWebToken,
string symbolPublishingExclusionsFile,
bool publishSpecialClrFiles,
bool convertPortablePdbsToWindowsPdbs,
Dictionary<string, HashSet<Asset>> buildAssets,
SemaphoreSlim clientThrottle = null,
string temporarySymbolsLocation = null)
Expand All @@ -618,6 +622,7 @@ await PublishSymbolsUsingStreamingAsync(
symWebToken,
symbolPublishingExclusionsFile,
publishSpecialClrFiles,
convertPortablePdbsToWindowsPdbs,
buildAssets,
clientThrottle);
}
Expand All @@ -629,6 +634,7 @@ await PublishSymbolsfromBlobArtifactsAsync(
symWebToken,
symbolPublishingExclusionsFile,
publishSpecialClrFiles,
convertPortablePdbsToWindowsPdbs,
temporarySymbolsLocation);
}
}
Expand All @@ -642,12 +648,14 @@ await PublishSymbolsfromBlobArtifactsAsync(
/// <param name="symbolPublishingExclusionsFile">Right now we do not add any files to this, so this is going to be null</param>
/// <param name="temporarySymbolsLocation">Path to Symbol.nupkgs</param>
/// <param name="publishSpecialClrFiles">If true, the special coreclr module indexed files like DBI, DAC and SOS are published</param>
/// <param name="convertPortablePdbsToWindowsPdbs">If true, convert protable pdbs to windows pdbs</param>
public async Task PublishSymbolsfromBlobArtifactsAsync(
string pdbArtifactsBasePath,
string msdlToken,
string symWebToken,
string symbolPublishingExclusionsFile,
bool publishSpecialClrFiles,
bool convertPortablePdbsToWindowsPdbs,
string temporarySymbolsLocation = null)
{
if (Directory.Exists(temporarySymbolsLocation))
Expand Down Expand Up @@ -682,7 +690,7 @@ public async Task PublishSymbolsfromBlobArtifactsAsync(
var serverPath = server.Key;
var token = server.Value;;
Log.LogMessage(MessageImportance.High,
$"Performing symbol publishing...\nSymbolServerPath : ${serverPath} \nExpirationInDays : {ExpirationInDays} \nConvertPortablePdbsToWindowsPdb : false \ndryRun: false \nTotal number of symbol files : {fileEntries.Length} ");
$"Performing symbol publishing...\nSymbolServerPath : ${serverPath} \nExpirationInDays : {ExpirationInDays} \nConvertPortablePdbsToWindowsPdb : {convertPortablePdbsToWindowsPdbs} \ndryRun: false \nTotal number of symbol files : {fileEntries.Length} ");

try
{
Expand All @@ -694,7 +702,7 @@ await PublishSymbolsHelper.PublishAsync(
filesToSymbolServer,
null,
ExpirationInDays,
false,
convertPortablePdbsToWindowsPdbs,
publishSpecialClrFiles,
null,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public class PublishArtifactsInManifestV3 : PublishArtifactsInManifestBase

public bool AllowFeedOverrides { get; set; }

public bool ConvertPortablePdbsToWindowsPdbs { get; set;}

public ITaskItem[] FeedKeys { get; set; }
public ITaskItem[] FeedSasUris { get; set; }

Expand Down Expand Up @@ -193,6 +195,7 @@ await Task.WhenAll(new Task[]
SymWebToken,
SymbolPublishingExclusionsFile,
PublishSpecialClrFiles,
ConvertPortablePdbsToWindowsPdbs,
buildAssets,
clientThrottle,
temporarySymbolsLocation)
Expand Down

0 comments on commit a661399

Please sign in to comment.