Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into dev/rolf/bump-main-in…
Browse files Browse the repository at this point in the history
…-xcode16-2024-09-02
  • Loading branch information
rolfbjarne committed Sep 5, 2024
2 parents 73683f8 + f562519 commit c206728
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 70 deletions.
2 changes: 1 addition & 1 deletion Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ INCLUDE_TVOS=1
INCLUDE_MACCATALYST=1
INCLUDE_DEVICE=1
INCLUDE_DOTNET_WATCHOS=
INCLUDE_XAMARIN_LEGACY=1
INCLUDE_XAMARIN_LEGACY=
INCLUDE_HOTRESTART=1

ENABLE_DOTNET=1
Expand Down
23 changes: 0 additions & 23 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,36 +32,13 @@
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" protocolVersion="3" />
<add key="Dotnet arcade" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<!-- We've dropped support for .NET 6, but let's keep the feed in for a little while longer to make sure it's dropped throughout our entire stack and the lack of this feed doesn't break our build. -->
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
<add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
<!-- dotnet8-transport is required for Microsoft.DotNet.Cecil -->
<add key="dotnet8-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8-transport/nuget/v3/index.json" />
<add key="macios-dependencies" value="https://pkgs.dev.azure.com/xamarin/public/_packaging/macios-dependencies/nuget/v3/index.json" />
<add key="xamarin-impl" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json" />
<add key="local-tests-feed" value="tests/.nuget/packages" />
<!-- These feeds are from main (6.0.4xx runtime branch) to get 6.0.9 versions of numerous .NET 6 packages. It should be possible to remove this after a while. -->
<add key="darc-pub-dotnet-emsdk-3f6c45a" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-3f6c45a2/nuget/v3/index.json" />
<add key="darc-pub-dotnet-runtime-531f715" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-531f715f/nuget/v3/index.json" />
<!-- Need 6.0.10 feeds too -->
<add key="darc-pub-dotnet-runtime-8c6bcad" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-8c6bcad1/nuget/v3/index.json" />
<!-- And a 6.0.11 feed -->
<add key="darc-pub-dotnet-runtime-f2980ae" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-f2980ae1/nuget/v3/index.json" />
<!-- And a 6.0.12 feed -->
<add key="darc-pub-dotnet-runtime-15d285f" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-15d285f3/nuget/v3/index.json" />
<!-- Add a 6.0.13 feed -->
<add key="darc-pub-dotnet-runtime-de84cf9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-d5edd29b-1/nuget/v3/index.json" />
<!-- Add a 6.0.14 feed -->
<add key="darc-pub-dotnet-runtime-2e45bc7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-2e45bc7a/nuget/v3/index.json" />
<!-- Add a 7.0.11 feed -->
<add key="darc-pub-dotnet-runtime-0ece505" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-0ece5051/nuget/v3/index.json" />
<!-- Add a 7.0.17 feed -->
<add key="darc-pub-dotnet-runtime-21f293d" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-21f293d8/nuget/v3/index.json" />
<!-- Add a 7.0.18 feed -->
<add key="darc-pub-dotnet-runtime-b6e8c6a" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-b6e8c6a6/nuget/v3/index.json" />
<!-- Add a 7.0.19 feed -->
<add key="darc-pub-dotnet-runtime-397f9ea" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-397f9eac/nuget/v3/index.json" />
<!-- Add a 7.0.20 feed -->
<add key="darc-pub-dotnet-runtime-fd36db5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-fd36db5f/nuget/v3/index.json" />
</packageSources>
Expand Down
13 changes: 13 additions & 0 deletions src/Network/NWConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#nullable enable

using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using ObjCRuntime;
using Foundation;
Expand Down Expand Up @@ -157,8 +158,20 @@ static void TrampolineBooleanChangeHandler (IntPtr block, byte value)
[DllImport (Constants.NetworkLibrary)]
static extern unsafe void nw_connection_set_viability_changed_handler (IntPtr handle, void* callback);

#if !XAMCORE_5_0
[Obsolete ("Use 'SetViabilityChangeHandler' instead.")]
[EditorBrowsable (EditorBrowsableState.Never)]
[BindingImpl (BindingImplOptions.Optimizable)]
public unsafe void SetBooleanChangeHandler (Action<bool> callback)
{
SetViabilityChangeHandler (callback);
}
#endif // !XAMCORE_5_0

/// <summary>Set a handler that is called when data can be sent or received.</summary>
/// <param name="callback">The callback to call when data can be sent or received.</param>
[BindingImpl (BindingImplOptions.Optimizable)]
public unsafe void SetViabilityChangeHandler (Action<bool> callback)
{
if (callback is null) {
nw_connection_set_viability_changed_handler (GetCheckedHandle (), null);
Expand Down
4 changes: 2 additions & 2 deletions src/bgen/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4564,8 +4564,8 @@ void GenerateMethod (MemberInformation minfo)
argCount++;
}
if (minfo.Method.GetParameters ().Length != argCount) {
ErrorHelper.Warning (1105,
minfo.selector, argCount, minfo.Method, minfo.Method.GetParameters ().Length);
exceptions.Add (ErrorHelper.CreateWarning (1105,
minfo.selector, argCount, minfo.Method, minfo.Method.GetParameters ().Length));
}
}

Expand Down
1 change: 0 additions & 1 deletion tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43067,7 +43067,6 @@ M:Network.NWConnection.Send(System.Byte[],System.Int32,System.Int32,Network.NWCo
M:Network.NWConnection.SendIdempotent(CoreFoundation.DispatchData,Network.NWContentContext,System.Boolean)
M:Network.NWConnection.SendIdempotent(System.Byte[],Network.NWContentContext,System.Boolean)
M:Network.NWConnection.SetBetterPathAvailableHandler(System.Action{System.Boolean})
M:Network.NWConnection.SetBooleanChangeHandler(System.Action{System.Boolean})
M:Network.NWConnection.SetPathChangedHandler(System.Action{Network.NWPath})
M:Network.NWConnection.SetQueue(CoreFoundation.DispatchQueue)
M:Network.NWConnection.SetStateChangeHandler(System.Action{Network.NWConnectionState,Network.NWError})
Expand Down
34 changes: 20 additions & 14 deletions tests/common/shared-dotnet.mk
Original file line number Diff line number Diff line change
Expand Up @@ -72,44 +72,50 @@ ifeq ($(PLATFORM),)
PLATFORM=$(shell basename "$(CURDIR)")
endif

ifeq ($(RUNTIMEIDENTIFIERS),)
ifneq ($(RUNTIMEIDENTIFIERS)$(RUNTIMEIDENTIFIER),)
$(error "Don't set RUNTIMEIDENTIFIER or RUNTIMEIDENTIFIERS, set RID instead")
endif

ifeq ($(RID),)
ifeq ($(PLATFORM),iOS)
RUNTIMEIDENTIFIERS=ios-arm64
RID=ios-arm64
else ifeq ($(PLATFORM),tvOS)
RUNTIMEIDENTIFIERS=tvos-arm64
RID=tvos-arm64
else ifeq ($(PLATFORM),MacCatalyst)
ifeq ($(CONFIG),Release)
RUNTIMEIDENTIFIERS=maccatalyst-x64;maccatalyst-arm64
RID=maccatalyst-x64;maccatalyst-arm64
else ifneq ($(UNIVERSAL),)
RUNTIMEIDENTIFIERS=maccatalyst-x64;maccatalyst-arm64
RID=maccatalyst-x64;maccatalyst-arm64
else ifeq ($(shell arch),arm64)
RUNTIMEIDENTIFIERS=maccatalyst-arm64
RID=maccatalyst-arm64
else
RUNTIMEIDENTIFIERS=maccatalyst-x64
RID=maccatalyst-x64
endif
else ifeq ($(PLATFORM),macOS)
ifeq ($(CONFIG),Release)
RUNTIMEIDENTIFIERS=osx-x64;osx-arm64
RID=osx-x64;osx-arm64
else ifneq ($(UNIVERSAL),)
RUNTIMEIDENTIFIERS=osx-x64;osx-arm64
RID=osx-x64;osx-arm64
else ifeq ($(shell arch),arm64)
RUNTIMEIDENTIFIERS=osx-arm64
RID=osx-arm64
else
RUNTIMEIDENTIFIERS=osx-x64
RID=osx-x64
endif
else
RUNTIMEIDENTIFIERS=unknown-platform-$(PLATFORM)
RID=unknown-platform-$(PLATFORM)
endif
endif

ifneq ($(UNIVERSAL),)
UNIVERSAL_ARGUMENT=/p:UniversalBuild=true
endif

ifeq ($(findstring ;,$(RUNTIMEIDENTIFIERS)),;)
ifeq ($(findstring ;,$(RID)),;)
PATH_RID=
export RUNTIMEIDENTIFIERS=$(RID)
else
PATH_RID=$(RUNTIMEIDENTIFIERS)/
PATH_RID=$(RID)/
export RUNTIMEIDENTIFIER=$(RID)
endif


Expand Down
98 changes: 69 additions & 29 deletions tools/devops/automation/scripts/VSTS.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,70 @@ class BuildConfiguration {
}
}

static [string[]] $labelsOfInterest = $(
"build-package",
"skip-packages",
"skip-nugets",
"skip-signing",
"run-sample-tests",
"skip-packaged-macos-tests",
"run-packaged-macos-tests",
"skip-api-comparison",
"run-windows-tests",
"skip-windows-tests",
"skip-all-tests"
)

[void] SetLabelsFromPR ([PSCustomObject] $prInfo, [bool]$isPR) {
if ($prInfo) {
Write-Deubg "Setting VSTS labels from $($prInfo.labels)"
foreach ($l in [BuildConfiguration]::labelsOfInterest) {
$labelPresent = 1 -eq ($prInfo.labels | Where-Object { $_.name -eq "$l"}).Count
# We need to replace dashes with underscores, because bash can't access an environment variable with a dash in the name.
$lbl = $l.Replace('-', '_')
Write-Host "##vso[task.setvariable variable=$lbl;isOutput=true]$labelPresent"
}
} else {
Write-Debug "Not setting PR labels because there was not info provided."
}

# set if the build is a PR or not
if ($isPR) {
Write-Host "##vso[task.setvariable variable=prBuild;isOutput=true]True"
} else {
Write-Host "##vso[task.setvariable variable=prBuild;isOutput=true]False"
}
}

<#
.SYNOPSIS
Retrieve the change id and export it as an enviroment variable.
#>
[string] ExportChangeId ([object] $configuration) {
# This is an interesting step, we do know we are dealing with a PR, but we need the PR id to
# be able to get the labels, the buildSourceBranch follows the pattern: refs/pull/{ChangeId}/merge
# we could use a regexp but then we would have two problems instead of one
$changeId = $null
if ($configuration.PARENT_BUILD_BUILD_SOURCEBRANCH) {
# use the source branch information from the configuration object
$changeId = $configuration.PARENT_BUILD_BUILD_SOURCEBRANCH.Replace("refs/pull/", "").Replace("/merge", "")
} else {
Write-Debug "Retrieving change id from the environment since it could not be found in the config."
# retrieve the change ide form the BUILD_SOURCEBRANCH enviroment variable.
$changeId = "$Env:BUILD_SOURCEBRANCH".Replace("refs/pull/", "").Replace("/merge", "")
}

# we can always fail (regexp error or not env varaible)
if ($changeId) {
# add a var with the change id, which can be later consumed by some of the old scripts from
# jenkins
Write-Host "##vso[task.setvariable variable=pr_number;isOutput=true]$changeId"
} else {
Write-Debug "Not setting the change id because it could not be calculated."
}
return $changeId
}

[PSCustomObject] Import([string] $configFile) {
if (-not (Test-Path -Path $configFile -PathType Leaf)) {
throw [System.InvalidOperationException]::new("Configuration file $configFile is missing")
Expand Down Expand Up @@ -433,15 +497,9 @@ class BuildConfiguration {

if ($configuration.BuildReason -eq "PullRequest" -or (($configuration.BuildReason -eq "Manual") -and ($configuration.PARENT_BUILD_BUILD_SOURCEBRANCH -eq "merge")) ) {
Write-Host "Configuring build from PR."
# This is an interesting step, we do know we are dealing with a PR, but we need the PR id to
# be able to get the labels, the buildSourceBranch follows the pattern: refs/pull/{ChangeId}/merge
# we could use a regexp but then we would have two problems instead of one
$changeId = $configuration.PARENT_BUILD_BUILD_SOURCEBRANCH.Replace("refs/pull/", "").Replace("/merge", "")

# add a var with the change id, which can be later consumed by some of the old scripts from
# jenkins
Write-Host "##vso[task.setvariable variable=pr_number;isOutput=true]$changeId"

# retrieve the PR data to be able to fwd the labels from github
$changeId = $this.ExportChangeId($configuration)
$prInfo = Get-GitHubPRInfo -ChangeId $changeId
Write-Host $prInfo

Expand All @@ -459,29 +517,11 @@ class BuildConfiguration {
$tags.Add("$ref")

# set output variables based on the git labels
$labelsOfInterest = @(
"build-package",
"skip-packages",
"skip-nugets",
"skip-signing",
"run-sample-tests",
"skip-packaged-macos-tests",
"run-packaged-macos-tests",
"skip-api-comparison",
"run-windows-tests",
"skip-windows-tests",
"skip-all-tests"
)

foreach ($l in $labelsOfInterest) {
$labelPresent = 1 -eq ($prInfo.labels | Where-Object { $_.name -eq "$l"}).Count
# We need to replace dashes with underscores, because bash can't access an environment variable with a dash in the name.
$lbl = $l.Replace('-', '_')
Write-Host "##vso[task.setvariable variable=$lbl;isOutput=true]$labelPresent"
}
$this.SetLabelsFromPR($prInfo, $true)

Write-Host "##vso[task.setvariable variable=prBuild;isOutput=true]True"
} else {
# thee are not labels to add in a CI build and we will set the build as a ci build.
$this.SetLabelsFromPR($null, $false)
if ($tags.Contains("cronjob")) {
# debug so that we do know why we do not have ciBuild
Write-Debug "Skipping the tag 'ciBuild' because we are dealing with a translation build."
Expand Down

0 comments on commit c206728

Please sign in to comment.