Skip to content

Commit c069b47

Browse files
authored
Merge 7.0.3.1 into release/7.0.x
1 parent 9c9d62b commit c069b47

43 files changed

Lines changed: 811 additions & 60 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build/config.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<!-- when changing any of the NuGetVersion props below, run tools-local\ship-public-apis -->
1515
<MajorNuGetVersion Condition="'$(MajorNuGetVersion)' == ''">7</MajorNuGetVersion>
1616
<MinorNuGetVersion Condition="'$(MinorNuGetVersion)' == ''">0</MinorNuGetVersion>
17-
<PatchNuGetVersion Condition="'$(PatchNuGetVersion)' == ''">2</PatchNuGetVersion>
17+
<PatchNuGetVersion Condition="'$(PatchNuGetVersion)' == ''">3</PatchNuGetVersion>
1818
<SemanticVersion Condition=" '$(SemanticVersion)' == '' ">$(MajorNuGetVersion).$(MinorNuGetVersion).$(PatchNuGetVersion)</SemanticVersion>
1919

2020
<!-- ** Change for each new preview/rc -->

eng/pipelines/pull_request.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ variables:
2727
extends:
2828
template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate
2929
parameters:
30+
settings:
31+
networkIsolationPolicy: Permissive
3032
sdl:
3133
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
3234
binskim:

eng/pipelines/templates/Build.yml

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ parameters:
44
- name: SigningType
55
displayName: Type of signing to use
66
type: string
7+
- name: isOfficialBuild
8+
type: boolean
79

810
steps:
911
- task: PowerShell@1
@@ -300,27 +302,28 @@ steps:
300302
# Using MSBuild CLI results in an assembly binding failure for NuGet.Common.dll 4.4.0.3 because Microsoft.DotNet.Build.Tasks.Feed.dll references SleetLib.dll which references NuGet.Common 4.4.0.3.
301303
# The Microsoft.DotNet.Build.Tasks.Feed package includes NuGet.Common 4.9.0.6 and a binding redirection in Microsoft.DotNet.Build.Tasks.Feed.dll.config but the binding redirection is not processed.
302304
# This would probably solve it: https://github.com/Microsoft/msbuild/issues/1309
303-
- task: UseDotNet@2
304-
displayName: "Install .NET 10.0.0 for BAR publishing"
305-
inputs:
306-
packageType: sdk
307-
version: 10.0.x
308-
includePreviewVersions: true
309-
installationPath: $(Agent.TempDirectory)/dotnet
310-
workingDirectory: $(Agent.TempDirectory)
311-
condition: "and(succeeded(),eq(variables['PublishArtifactsToDotNetBuildAssetRegistry'], 'true'), eq(variables['BuildRTM'], 'false'))"
312-
313-
- task: AzureCLI@2
314-
displayName: "Publish to the .NET Core build asset registry (BAR)"
315-
inputs:
316-
azureSubscription: "Darc: Maestro Production"
317-
scriptType: ps
318-
scriptLocation: inlineScript
319-
inlineScript: |
320-
$(Agent.TempDirectory)/dotnet/dotnet msbuild $(Build.Repository.LocalPath)\build\publish.proj /t:PublishToBuildAssetRegistry /property:NuGetClientNupkgsDirectoryPath=$(Build.Repository.LocalPath)\artifacts\$(NupkgOutputDir) /property:BUILD_BUILDNUMBER=$(Build.BuildNumber) /property:BUILD_SOURCEBRANCH=$(SourceBranch) /property:BUILD_SOURCEVERSION=$(Build.SourceVersion) /property:BUILD_REPOSITORY_URI=$(Build.Repository.Uri) /property:BUILD_REPOSITORY_NAME=$(Build.Repository.Name) /property:ArtifactsLogDir=$(Build.Repository.LocalPath)\artifacts\manifests\ /binarylogger:$(Build.StagingDirectory)\binlog\21.PublishToBuildAssetRegistry.binlog /property:MaestroApiEndpoint=$(MaestroApiEndpoint)
321-
workingDirectory: cli
322-
failOnStderr: true
323-
env:
324-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
325-
DOTNET_MULTILEVEL_LOOKUP: true
326-
condition: "and(succeeded(),eq(variables['PublishArtifactsToDotNetBuildAssetRegistry'], 'true'), eq(variables['BuildRTM'], 'false'))"
305+
- ${{ if parameters.isOfficialBuild }}:
306+
- task: UseDotNet@2
307+
displayName: "Install .NET 10.0.0 for BAR publishing"
308+
inputs:
309+
packageType: sdk
310+
version: 10.0.x
311+
includePreviewVersions: true
312+
installationPath: $(Agent.TempDirectory)/dotnet
313+
workingDirectory: $(Agent.TempDirectory)
314+
condition: "and(succeeded(),eq(variables['PublishArtifactsToDotNetBuildAssetRegistry'], 'true'), eq(variables['BuildRTM'], 'false'))"
315+
316+
- task: AzureCLI@2
317+
displayName: "Publish to the .NET Core build asset registry (BAR)"
318+
inputs:
319+
azureSubscription: "Darc: Maestro Production"
320+
scriptType: ps
321+
scriptLocation: inlineScript
322+
inlineScript: |
323+
$(Agent.TempDirectory)/dotnet/dotnet msbuild $(Build.Repository.LocalPath)\build\publish.proj /t:PublishToBuildAssetRegistry /property:NuGetClientNupkgsDirectoryPath=$(Build.Repository.LocalPath)\artifacts\$(NupkgOutputDir) /property:BUILD_BUILDNUMBER=$(Build.BuildNumber) /property:BUILD_SOURCEBRANCH=$(SourceBranch) /property:BUILD_SOURCEVERSION=$(Build.SourceVersion) /property:BUILD_REPOSITORY_URI=$(Build.Repository.Uri) /property:BUILD_REPOSITORY_NAME=$(Build.Repository.Name) /property:ArtifactsLogDir=$(Build.Repository.LocalPath)\artifacts\manifests\ /binarylogger:$(Build.StagingDirectory)\binlog\21.PublishToBuildAssetRegistry.binlog /property:MaestroApiEndpoint=$(MaestroApiEndpoint)
324+
workingDirectory: cli
325+
failOnStderr: true
326+
env:
327+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
328+
DOTNET_MULTILEVEL_LOOKUP: true
329+
condition: "and(succeeded(),eq(variables['PublishArtifactsToDotNetBuildAssetRegistry'], 'true'), eq(variables['BuildRTM'], 'false'))"

eng/pipelines/templates/pipeline.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ stages:
178178
parameters:
179179
BuildRTM: false
180180
SigningType: ${{ parameters.SigningType }}
181+
isOfficialBuild: ${{ parameters.isOfficialBuild }}
181182

182183
- stage: Build_For_Publishing
183184
displayName: Build NuGet published to nuget.org
@@ -240,6 +241,7 @@ stages:
240241
parameters:
241242
BuildRTM: true
242243
SigningType: ${{ parameters.SigningType }}
244+
isOfficialBuild: ${{ parameters.isOfficialBuild }}
243245

244246
- job: Validate_Publishing_Artifacts
245247
condition: "and(succeeded(), ne(variables['RunBuildForPublishing'], 'false'))"

src/NuGet.Core/NuGet.Packaging/PackageExtractor.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,8 @@ public static async Task<bool> InstallFromSourceAsync(
466466

467467
using (var packageReader = new PackageArchiveReader(nupkgStream))
468468
{
469+
ValidateExpectedPackage(packageIdentity, packageReader);
470+
469471
if (packageSaveMode.HasFlag(PackageSaveMode.Nuspec) || packageSaveMode.HasFlag(PackageSaveMode.Files))
470472
{
471473
telemetry.StartIntervalMeasure();
@@ -588,6 +590,22 @@ await VerifyPackageSignatureAsync(
588590
}
589591
}
590592

593+
private static void ValidateExpectedPackage(PackageIdentity packageIdentity, PackageArchiveReader packageReader)
594+
{
595+
PackageIdentity actualIdentity = packageReader.GetIdentity();
596+
if (!PackageIdentityComparer.Default.Equals(packageIdentity, actualIdentity))
597+
{
598+
string message = string.Format(
599+
CultureInfo.InvariantCulture,
600+
Strings.ErrorPackageIdentityDoesNotMatch,
601+
packageIdentity.Id,
602+
packageIdentity.Version,
603+
actualIdentity.Id,
604+
actualIdentity.Version);
605+
throw new PackagingException(message);
606+
}
607+
}
608+
591609
/// <summary>
592610
/// Delete the target directory path and the temp nupkg path in case of a failed extraction.
593611
/// </summary>
@@ -947,6 +965,7 @@ public static async Task<IEnumerable<string>> CopySatelliteFilesAsync(
947965
{
948966
using (var packageReader = new PackageArchiveReader(nupkgFilePath))
949967
{
968+
ValidateExpectedPackage(packageIdentity, packageReader);
950969
return await CopySatelliteFilesAsync(
951970
packageReader,
952971
packagePathResolver,

src/NuGet.Core/NuGet.Packaging/Strings.Designer.cs

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/NuGet.Core/NuGet.Packaging/Strings.resx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,4 +887,8 @@ Valid from:</comment>
887887
{2}</value>
888888
<comment>0 is a certificate subject, 1 is a certificate fingerprint, and 2 is a PEM-encoded certificate.</comment>
889889
</data>
890+
<data name="ErrorPackageIdentityDoesNotMatch" xml:space="preserve">
891+
<value>Expected package {0} {1}, but got package {2} {3}</value>
892+
<comment>0 and 2 are package names, and 1 and 3 are versions numbers.</comment>
893+
</data>
890894
</root>

src/NuGet.Core/NuGet.Packaging/xlf/Strings.cs.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@
183183
<target state="translated">ID balíčku má prázdnou hodnotu nebo hodnotu null.</target>
184184
<note />
185185
</trans-unit>
186+
<trans-unit id="ErrorPackageIdentityDoesNotMatch">
187+
<source>Expected package {0} {1}, but got package {2} {3}</source>
188+
<target state="new">Expected package {0} {1}, but got package {2} {3}</target>
189+
<note>0 and 2 are package names, and 1 and 3 are versions numbers.</note>
190+
</trans-unit>
186191
<trans-unit id="ErrorPackageNotSigned">
187192
<source>The package is not signed.</source>
188193
<target state="translated">Balíček není podepsaný.</target>

src/NuGet.Core/NuGet.Packaging/xlf/Strings.de.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@
183183
<target state="translated">NULL oder leere Paket-ID.</target>
184184
<note />
185185
</trans-unit>
186+
<trans-unit id="ErrorPackageIdentityDoesNotMatch">
187+
<source>Expected package {0} {1}, but got package {2} {3}</source>
188+
<target state="new">Expected package {0} {1}, but got package {2} {3}</target>
189+
<note>0 and 2 are package names, and 1 and 3 are versions numbers.</note>
190+
</trans-unit>
186191
<trans-unit id="ErrorPackageNotSigned">
187192
<source>The package is not signed.</source>
188193
<target state="translated">Das Paket ist nicht signiert.</target>

src/NuGet.Core/NuGet.Packaging/xlf/Strings.es.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@
183183
<target state="translated">Id. de paquete vacío o nulo</target>
184184
<note />
185185
</trans-unit>
186+
<trans-unit id="ErrorPackageIdentityDoesNotMatch">
187+
<source>Expected package {0} {1}, but got package {2} {3}</source>
188+
<target state="new">Expected package {0} {1}, but got package {2} {3}</target>
189+
<note>0 and 2 are package names, and 1 and 3 are versions numbers.</note>
190+
</trans-unit>
186191
<trans-unit id="ErrorPackageNotSigned">
187192
<source>The package is not signed.</source>
188193
<target state="translated">El paquete no está firmado.</target>

0 commit comments

Comments
 (0)