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
…-net9.0-2024-09-04
  • Loading branch information
rolfbjarne committed Sep 5, 2024
2 parents a6dca9d + f562519 commit e3950ef
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,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
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 @@ -155,8 +156,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
1 change: 0 additions & 1 deletion tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42193,7 +42193,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
39 changes: 31 additions & 8 deletions tools/devops/automation/scripts/VSTS.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,35 @@ class BuildConfiguration {
}
}

<#
.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 @@ -468,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 Down

0 comments on commit e3950ef

Please sign in to comment.