Skip to content

Commit 8f3996c

Browse files
authored
[automated] Merge branch 'release/8.0.1xx' => 'main' (#35432)
2 parents 5b2f65c + c4e2d1e commit 8f3996c

File tree

9 files changed

+77
-16
lines changed

9 files changed

+77
-16
lines changed

.vsts-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ stages:
144144
vmImage: 'ubuntu-22.04'
145145
${{ if ne(variables['System.TeamProject'], 'public') }}:
146146
name: $(DncEngInternalBuildPool)
147-
demands: ImageOverride -equals 1es-ubuntu-2204
147+
demands: ImageOverride -equals build.ubuntu.2204.amd64
148148
${{ if eq(variables['System.TeamProject'], 'public') }}:
149149
helixTargetQueue: ubuntu.2204.amd64.open
150150
${{ if ne(variables['System.TeamProject'], 'public') }}:

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
</PropertyGroup>
190190
<!-- Test Dependencies -->
191191
<PropertyGroup>
192-
<FluentAssertionsVersion>6.11.0</FluentAssertionsVersion>
192+
<FluentAssertionsVersion>6.12.0</FluentAssertionsVersion>
193193
<FluentAssertionsJsonVersion>6.1.0</FluentAssertionsJsonVersion>
194194
<MicrosoftDotNetXUnitExtensionsVersion>8.0.0-beta.23463.1</MicrosoftDotNetXUnitExtensionsVersion>
195195
<MoqPackageVersion>4.18.4</MoqPackageVersion>

eng/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ jobs:
275275
displayName: Run AoT Tests in Helix
276276
env:
277277
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
278-
HelixAccessToken: ''
278+
HelixAccessToken: $(_HelixApiToken)
279279
RunAoTTests: 'true'
280280

281281
- ${{ if eq(parameters.agentOs, 'Darwin') }}:

eng/common/sdl/trim-assets-version.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function Install-VersionTools-Cli {
2525
Write-Host "Installing the package '$CliToolName' with a version of '$version' ..."
2626
$feed = "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json"
2727

28-
$argumentList = @("tool", "install", "--local", "$CliToolName", "--add-source $feed", "--no-cache", "--version $Version", "--create-manifest-if-needed")
28+
$argumentList = @("tool", "install", "--local", "$CliToolName", "--add-source $feed", "--no-cache", "--version $Version")
2929
Start-Process "$dotnet" -Verbose -ArgumentList $argumentList -NoNewWindow -Wait
3030
}
3131

src/Assets/TestProjects/KitchenSink/TestApp/TestApp.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization>false</EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization>
1515
<DebuggerSupport>true</DebuggerSupport>
1616
<EventSourceSupport>false</EventSourceSupport>
17+
<MetricsSupport>false</MetricsSupport>
1718
<InvariantGlobalization>true</InvariantGlobalization>
1819
<PredefinedCulturesOnly>true</PredefinedCulturesOnly>
1920
<ConcurrentGarbageCollection>false</ConcurrentGarbageCollection>

src/Containers/Microsoft.NET.Build.Containers/Registry/Registry.cs

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,10 @@ private async Task UploadBlobAsync(string repository, string digest, Stream cont
364364

365365
}
366366

367-
public async Task PushAsync(BuiltImage builtImage, SourceImageReference source, DestinationImageReference destination, CancellationToken cancellationToken)
367+
public Task PushAsync(BuiltImage builtImage, SourceImageReference source, DestinationImageReference destination, CancellationToken cancellationToken)
368+
=> PushAsync(builtImage, source, destination, pushTags: true, cancellationToken);
369+
370+
private async Task PushAsync(BuiltImage builtImage, SourceImageReference source, DestinationImageReference destination, bool pushTags, CancellationToken cancellationToken)
368371
{
369372
cancellationToken.ThrowIfCancellationRequested();
370373
Registry destinationRegistry = destination.RemoteRegistry!;
@@ -422,18 +425,25 @@ public async Task PushAsync(BuiltImage builtImage, SourceImageReference source,
422425
_logger.LogInformation(Strings.Registry_ConfigUploaded);
423426
}
424427

425-
//manifest upload
426-
string manifestDigest = builtImage.Manifest.GetDigest();
427-
_logger.LogInformation(Strings.Registry_ManifestUploadStarted, RegistryName, manifestDigest);
428-
await _registryAPI.Manifest.PutAsync(destination.Repository, manifestDigest, builtImage.Manifest, cancellationToken).ConfigureAwait(false);
429-
_logger.LogInformation(Strings.Registry_ManifestUploaded, RegistryName);
430-
431-
//tag upload
432-
foreach (string tag in destination.Tags)
428+
// Tags can refer to an image manifest or an image manifest list.
429+
// In the first case, we push tags to the registry.
430+
// In the second case, we push the manifest digest so the manifest list can refer to it.
431+
if (pushTags)
432+
{
433+
Debug.Assert(destination.Tags.Length > 0);
434+
foreach (string tag in destination.Tags)
435+
{
436+
_logger.LogInformation(Strings.Registry_TagUploadStarted, tag, RegistryName);
437+
await _registryAPI.Manifest.PutAsync(destination.Repository, tag, builtImage.Manifest, cancellationToken).ConfigureAwait(false);
438+
_logger.LogInformation(Strings.Registry_TagUploaded, tag, RegistryName);
439+
}
440+
}
441+
else
433442
{
434-
_logger.LogInformation(Strings.Registry_TagUploadStarted, tag, RegistryName);
435-
await _registryAPI.Manifest.PutAsync(destination.Repository, tag, builtImage.Manifest, cancellationToken).ConfigureAwait(false);
436-
_logger.LogInformation(Strings.Registry_TagUploaded, tag, RegistryName);
443+
string manifestDigest = builtImage.Manifest.GetDigest();
444+
_logger.LogInformation(Strings.Registry_ManifestUploadStarted, RegistryName, manifestDigest);
445+
await _registryAPI.Manifest.PutAsync(destination.Repository, manifestDigest, builtImage.Manifest, cancellationToken).ConfigureAwait(false);
446+
_logger.LogInformation(Strings.Registry_ManifestUploaded, RegistryName);
437447
}
438448
}
439449
}

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,11 @@ Copyright (c) .NET Foundation. All rights reserved.
504504
Value="$(DebuggerSupport)"
505505
Trim="true" />
506506

507+
<RuntimeHostConfigurationOption Include="System.Diagnostics.Metrics.Meter.IsSupported"
508+
Condition="'$(MetricsSupport)' != ''"
509+
Value="$(MetricsSupport)"
510+
Trim="true" />
511+
507512
<RuntimeHostConfigurationOption Include="System.Diagnostics.Tracing.EventSource.IsSupported"
508513
Condition="'$(EventSourceSupport)' != ''"
509514
Value="$(EventSourceSupport)"

src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibrary.cs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,50 @@ public void It_can_implicitly_define_predefined_Cultures_only(string targetFrame
897897
}
898898
}
899899

900+
[Theory]
901+
[InlineData("True")]
902+
[InlineData("False")]
903+
[InlineData(null)]
904+
public void It_can_evaluate_metrics_support(string value)
905+
{
906+
var testProj = new TestProject()
907+
{
908+
Name = "CheckMetricsSupport",
909+
TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
910+
IsExe = true,
911+
};
912+
913+
if (value is not null)
914+
{
915+
testProj.AdditionalProperties["MetricsSupport"] = value;
916+
}
917+
918+
var testAsset = _testAssetsManager.CreateTestProject(testProj, identifier: value);
919+
var buildCommand = new BuildCommand(testAsset);
920+
buildCommand
921+
.Execute()
922+
.Should()
923+
.Pass();
924+
925+
string runtimeConfigName = $"{testProj.Name}.runtimeconfig.json";
926+
var outputDirectory = buildCommand.GetOutputDirectory(testProj.TargetFrameworks);
927+
outputDirectory.Should().HaveFile(runtimeConfigName);
928+
929+
string runtimeConfigFile = Path.Combine(outputDirectory.FullName, runtimeConfigName);
930+
string runtimeConfigContents = File.ReadAllText(runtimeConfigFile);
931+
JObject runtimeConfig = JObject.Parse(runtimeConfigContents);
932+
JToken metricsSupport = runtimeConfig["runtimeOptions"]["configProperties"]["System.Diagnostics.Metrics.Meter.IsSupported"];
933+
934+
if (value is null)
935+
{
936+
metricsSupport.Should().BeNull();
937+
}
938+
else
939+
{
940+
metricsSupport.Value<string>().Should().Be(value);
941+
}
942+
}
943+
900944
[Theory]
901945
[InlineData("netcoreapp2.2", null, false, null, false)]
902946
[InlineData(ToolsetInfo.CurrentTargetFramework, null, true, null, true)]

src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAProjectWithAllFeatures.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public void It_publishes_the_project_correctly(string targetFramework, string[]
6060
""System.AggressiveAttributeTrimming"": true,
6161
""System.ComponentModel.TypeConverter.EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization"": false,
6262
""System.Diagnostics.Debugger.IsSupported"": true,
63+
""System.Diagnostics.Metrics.Meter.IsSupported"": false,
6364
""System.Diagnostics.Tracing.EventSource.IsSupported"": false,
6465
""System.Globalization.Invariant"": true,
6566
""System.Globalization.PredefinedCulturesOnly"": true,

0 commit comments

Comments
 (0)