Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
30c3091
Brand release/6.0-maui branch appropriately (#61792)
directhex Nov 24, 2021
af20fce
[mono][interp] Remove hack for nint/nfloat (#62053)
BrzVlad Nov 30, 2021
5e7fb16
Shrink version name due to nuget maximum (#62190)
directhex Dec 1, 2021
6c8d2b0
[release/6.0-maui] Exclude the managed code around libproc on iOS/tvO…
MaximLipnin Dec 2, 2021
3992fc3
Update timeout for sourcebuild (#61436) (#62300)
directhex Dec 2, 2021
2ab2de4
[MonoAOTCompiler] more properties & custom WorkingDirectory (#62849)
github-actions[bot] Dec 16, 2021
6523aa4
Merge branch 'release/6.0-maui' into merge/release/6.0-to-release/6.0…
akoeplinger Dec 20, 2021
d63fcb9
Disable package generation
akoeplinger Dec 20, 2021
37e3ee4
Merge pull request #62850 from dotnet-maestro-bot/merge/release/6.0-t…
jkotas Dec 22, 2021
7636d44
transform sgen_get_descriptor to parallel safe version in job_major_m…
github-actions[bot] Jan 4, 2022
b96f560
Bump SdkBandVersion prop to 6.0.200 (#62787)
steveisok Jan 4, 2022
a66e67b
Bump SdkVersionForWorkloadTesting to use a 200 band SDK (#63450)
steveisok Jan 7, 2022
a9d5ccd
[release/6.0-maui] Add back HAVE_SYS_ZLIB support (#63359)
lambdageek Jan 10, 2022
f36afb1
[release/6.0-maui] Backport MacCatalyst process start support (#62520)
simonrozsival Jan 11, 2022
936a1c1
[automated] Merge branch 'release/6.0' => 'release/6.0-maui' (#63112)
dotnet-maestro-bot Jan 14, 2022
e08fc29
Merge branch 'release/6.0-maui' into merge/release/6.0-to-release/6.0…
akoeplinger Jan 17, 2022
1ea69f9
Merge pull request #63807 from dotnet-maestro-bot/merge/release/6.0-t…
akoeplinger Jan 17, 2022
a54012e
[release/6.0-maui] Serialize SendPacketsAsync tests (#63896)
github-actions[bot] Jan 18, 2022
ffa6594
[release/6.0-maui] [Android] Prevent potential out of bounds write on…
github-actions[bot] Jan 18, 2022
994a341
[release/6.0-maui] [debugger] Fix reading a byte without checking the…
thaystg Jan 18, 2022
063054b
[release/6.0-maui] [mono][debugger] Fix step on ios when using interp…
github-actions[bot] Jan 18, 2022
fd2cdbb
[iOS/tvOS] Remove P/Invokes to libproc from System.Private.CoreLib (#…
akoeplinger Jan 18, 2022
49d6db3
[release/6.0-maui] [Android] Fix accessing network interfaces informa…
simonrozsival Jan 18, 2022
4f567e5
Take MacCatalyst into account in EnvironmentTests.WorkingSet_Valid te…
github-actions[bot] Jan 19, 2022
6371525
[release/6.0-maui] Android remove backward timezones (#64228)
github-actions[bot] Jan 24, 2022
059caa2
Merge pull request #64056 from dotnet-maestro-bot/merge/release/6.0-t…
akoeplinger Jan 25, 2022
9e82981
[release/6.0-maui][mono] Recognize new names for Xamarin.iOS etc asse…
akoeplinger Jan 26, 2022
2405c8e
Revert branch specific changes
safern Jan 26, 2022
e7920eb
Merge branch 'release/6.0' into merge-maui-branch-to-6.0
akoeplinger Feb 3, 2022
7ba7eae
Merge remote-tracking branch 'upstream/release/6.0' into merge-maui-b…
akoeplinger Feb 7, 2022
0f45149
Add the ability to generate Mono toolchain manifests per sdk band. 1…
Feb 8, 2022
bdc58e1
Merge remote-tracking branch 'upstream/release/6.0' into merge-maui-b…
Feb 8, 2022
da2f120
Remove unnecessary SdkBandVersion prop
Feb 8, 2022
0dead8c
Revert removing SdkBandVersion change. Wasm tests still need it
Feb 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<MajorVersion>6</MajorVersion>
<MinorVersion>0</MinorVersion>
<PatchVersion>3</PatchVersion>
<SdkBandVersion>6.0.100</SdkBandVersion>
<SdkBandVersion>6.0.200</SdkBandVersion>
<PreReleaseVersionLabel>servicing</PreReleaseVersionLabel>
<PreReleaseVersionIteration>
</PreReleaseVersionIteration>
Expand All @@ -23,6 +23,10 @@
<UsingToolXliff>false</UsingToolXliff>
<LastReleasedStableAssemblyVersion>$(AssemblyVersion)</LastReleasedStableAssemblyVersion>
</PropertyGroup>
<ItemGroup>
<!-- The bands we want to produce workload manifests for -->
<WorkloadSdkBandVersions Include="6.0.100;6.0.200" />
</ItemGroup>
<PropertyGroup>
<!-- For source generator support we need to target multiple versions of Rolsyn in order to be able to run on older versions of Roslyn -->
<MicrosoftCodeAnalysisCSharpWorkspacesVersion_3_11>3.11.0</MicrosoftCodeAnalysisCSharpWorkspacesVersion_3_11>
Expand Down Expand Up @@ -145,7 +149,7 @@
<SQLitePCLRawbundle_greenVersion>2.0.4</SQLitePCLRawbundle_greenVersion>
<MoqVersion>4.12.0</MoqVersion>
<FsCheckVersion>2.14.3</FsCheckVersion>
<SdkVersionForWorkloadTesting>6.0.100-rtm.21480.21</SdkVersionForWorkloadTesting>
<SdkVersionForWorkloadTesting>6.0.200-preview.22055.18</SdkVersionForWorkloadTesting>
<!-- Docs -->
<MicrosoftPrivateIntellisenseVersion>6.0.0-preview-20211019.1</MicrosoftPrivateIntellisenseVersion>
<!-- ILLink -->
Expand Down
45 changes: 45 additions & 0 deletions eng/pipelines/runtime-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,51 @@ jobs:
eq(variables['monoContainsChange'], true),
eq(variables['isFullMatrix'], true))

#
# MacCatalyst interp - requires AOT Compilation and Interp flags
# Build the whole product using Mono and run libraries tests
# The test app is built with the App Sandbox entitlement
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
buildConfig: Release
runtimeFlavor: mono
platforms:
- MacCatalyst_x64
# don't run tests on arm64 PRs until we can get significantly more devices
- ${{ if eq(variables['isFullMatrix'], true) }}:
- MacCatalyst_arm64
variables:
# map dependencies variables to local variables
- name: librariesContainsChange
value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
- name: monoContainsChange
value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
jobParameters:
testGroup: innerloop
nameSuffix: AllSubsets_Mono_AppSandbox
buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=adhoc /p:RunAOTCompilation=true /p:MonoForceInterpreter=true /p:BuildDarwinFrameworks=true /p:EnableAppSandbox=true
timeoutInMinutes: 180
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true),
eq(variables['isFullMatrix'], true))
# extra steps, run tests
extraStepsTemplate: /eng/pipelines/libraries/helix.yml
extraStepsParameters:
creator: dotnet-bot
interpreter: true
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
condition: >-
or(
eq(variables['librariesContainsChange'], true),
eq(variables['monoContainsChange'], true),
eq(variables['isFullMatrix'], true))

#
# MacCatalyst interp - requires AOT Compilation and Interp flags
# Build the whole product using Mono and run libraries tests
Expand Down
1 change: 1 addition & 0 deletions eng/testing/tests.mobile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
MainLibraryFileName="$(MainLibraryFileName)"
ForceAOT="$(RunAOTCompilation)"
ForceInterpreter="$(MonoForceInterpreter)"
EnableAppSandbox="$(EnableAppSandbox)"
InvariantGlobalization="$(InvariantGlobalization)"
UseConsoleUITemplate="True"
GenerateXcodeProject="$(GenerateXcodeProject)"
Expand Down
12 changes: 11 additions & 1 deletion src/libraries/Common/src/Interop/OSX/Interop.libproc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ internal static partial class libproc
// Constants from sys\resource.h
private const int RUSAGE_INFO_V3 = 3;

// Constants from sys/errno.h
private const int EPERM = 1;

// Defines from proc_info.h
internal enum ThreadRunState
{
Expand Down Expand Up @@ -120,7 +123,14 @@ internal static unsafe int[] proc_listallpids()
{
// Get the number of processes currently running to know how much data to allocate
int numProcesses = proc_listallpids(null, 0);
if (numProcesses <= 0)
if (numProcesses == 0 && Marshal.GetLastPInvokeError() == EPERM)
{
// An app running in App Sandbox does not have permissions to list other running processes
// and so the `proc_listallpids` function returns 0 and sets errno to 1. As a fallback
// we return at least an array with the PID of the current process which we always know.
return new[] { Environment.ProcessId };
}
else if (numProcesses <= 0)
{
throw new Win32Exception(SR.CantGetAllPids);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public static partial class PlatformDetection
public static bool IsMacOsCatalinaOrHigher => IsOSX && Environment.OSVersion.Version >= new Version(10, 15);
public static bool IsMacOsAppleSilicon => IsOSX && IsArm64Process;
public static bool IsNotMacOsAppleSilicon => !IsMacOsAppleSilicon;
public static bool IsAppSandbox => Environment.GetEnvironmentVariable("APP_SANDBOX_CONTAINER_ID") != null;
public static bool IsNotAppSandbox => !IsAppSandbox;

// RedHat family covers RedHat and CentOS
public static bool IsRedHatFamily => IsRedHatFamilyAndVersion();
Expand Down
1 change: 1 addition & 0 deletions src/libraries/Native/Unix/Common/pal_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#cmakedefine01 HAVE_F_FULLFSYNC
#cmakedefine01 HAVE_O_CLOEXEC
#cmakedefine01 HAVE_GETIFADDRS
#cmakedefine01 HAVE_IFADDRS
#cmakedefine01 HAVE_UTSNAME_DOMAINNAME
#cmakedefine01 HAVE_STAT64
#cmakedefine01 HAVE_FORK
Expand Down
77 changes: 72 additions & 5 deletions src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
#include <stdlib.h>
#include <sys/types.h>
#include <assert.h>
#if HAVE_IFADDRS || HAVE_GETIFADDRS
#include <ifaddrs.h>
#endif
#if !HAVE_GETIFADDRS && TARGET_ANDROID
#include <dlfcn.h>
#include <pthread.h>
#endif
#include <net/if.h>
#include <netinet/in.h>
#include <string.h>
Expand Down Expand Up @@ -55,7 +61,6 @@
#endif
#endif

#if HAVE_GETIFADDRS
// Convert mask to prefix length e.g. 255.255.255.0 -> 24
// mask parameter is pointer to buffer where address starts and length is
// buffer length e.g. 4 for IPv4 and 16 for IPv6.
Expand Down Expand Up @@ -95,14 +100,67 @@ static inline uint8_t mask2prefix(uint8_t* mask, int length)

return len;
}

#if !HAVE_IFADDRS && TARGET_ANDROID
// This structure is exactly the same as struct ifaddrs defined in ifaddrs.h but since the header
// might not be available (e.g., in bionics used in Android before API 24) we need to mirror it here
// so that we can dynamically load the getifaddrs function and use it.
struct ifaddrs
{
struct ifaddrs *ifa_next;
char *ifa_name;
unsigned int ifa_flags;
struct sockaddr *ifa_addr;
struct sockaddr *ifa_netmask;
union
{
struct sockaddr *ifu_broadaddr;
struct sockaddr *ifu_dstaddr;
} ifa_ifu;
void *ifa_data;
};
#endif

#if !HAVE_GETIFADDRS && TARGET_ANDROID
// Try to load the getifaddrs and freeifaddrs functions manually.
// This workaround is necessary on Android prior to API 24 and it can be removed once
// we drop support for earlier Android versions.
static int (*getifaddrs)(struct ifaddrs**) = NULL;
static void (*freeifaddrs)(struct ifaddrs*) = NULL;

static void try_loading_getifaddrs()
{
void *libc = dlopen("libc.so", RTLD_NOW);
if (libc)
{
getifaddrs = (int (*)(struct ifaddrs**)) dlsym(libc, "getifaddrs");
freeifaddrs = (void (*)(struct ifaddrs*)) dlsym(libc, "freeifaddrs");
}
}

static bool ensure_getifaddrs_is_loaded()
{
static pthread_once_t getifaddrs_is_loaded = PTHREAD_ONCE_INIT;
pthread_once(&getifaddrs_is_loaded, try_loading_getifaddrs);
return getifaddrs != NULL && freeifaddrs != NULL;
}
#endif

int32_t SystemNative_EnumerateInterfaceAddresses(void* context,
IPv4AddressFound onIpv4Found,
IPv6AddressFound onIpv6Found,
LinkLayerAddressFound onLinkLayerFound)
{
#if HAVE_GETIFADDRS
#if !HAVE_GETIFADDRS && TARGET_ANDROID
// Workaround for Android API < 24
if (!ensure_getifaddrs_is_loaded())
{
errno = ENOTSUP;
return -1;
}
#endif

#if HAVE_GETIFADDRS || TARGET_ANDROID
struct ifaddrs* headAddr;
if (getifaddrs(&headAddr) == -1)
{
Expand Down Expand Up @@ -235,7 +293,7 @@ int32_t SystemNative_EnumerateInterfaceAddresses(void* context,
freeifaddrs(headAddr);
return 0;
#else
// Not supported on e.g. Android. Also, prevent a compiler error because parameters are unused
// Not supported. Also, prevent a compiler error because parameters are unused
(void)context;
(void)onIpv4Found;
(void)onIpv6Found;
Expand All @@ -247,7 +305,16 @@ int32_t SystemNative_EnumerateInterfaceAddresses(void* context,

int32_t SystemNative_GetNetworkInterfaces(int32_t * interfaceCount, NetworkInterfaceInfo **interfaceList, int32_t * addressCount, IpAddressInfo **addressList )
{
#if HAVE_GETIFADDRS
#if !HAVE_GETIFADDRS && TARGET_ANDROID
// Workaround for Android API < 24
if (!ensure_getifaddrs_is_loaded())
{
errno = ENOTSUP;
return -1;
}
#endif

#if HAVE_GETIFADDRS || TARGET_ANDROID
struct ifaddrs* head; // Pointer to block allocated by getifaddrs().
struct ifaddrs* ifaddrsEntry;
IpAddressInfo *ai;
Expand Down Expand Up @@ -453,7 +520,7 @@ int32_t SystemNative_GetNetworkInterfaces(int32_t * interfaceCount, NetworkInter

return 0;
#else
// Not supported on e.g. Android. Also, prevent a compiler error because parameters are unused
// Not supported. Also, prevent a compiler error because parameters are unused
(void)interfaceCount;
(void)interfaceList;
(void)addressCount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,13 +585,14 @@ AndroidCryptoNative_SSLStreamRead(SSLStream* sslStream, uint8_t* buffer, int32_t

if (rem > 0)
{
data = make_java_byte_array(env, rem);
int32_t bytes_to_read = rem < length ? rem : length;
data = make_java_byte_array(env, bytes_to_read);
IGNORE_RETURN((*env)->CallObjectMethod(env, sslStream->appInBuffer, g_ByteBufferGet, data));
ON_EXCEPTION_PRINT_AND_GOTO(cleanup);
IGNORE_RETURN((*env)->CallObjectMethod(env, sslStream->appInBuffer, g_ByteBufferCompact));
ON_EXCEPTION_PRINT_AND_GOTO(cleanup);
(*env)->GetByteArrayRegion(env, data, 0, rem, (jbyte*)buffer);
*read = rem;
(*env)->GetByteArrayRegion(env, data, 0, bytes_to_read, (jbyte*)buffer);
*read = bytes_to_read;
ret = SSLStreamStatus_OK;
}
else
Expand Down
16 changes: 14 additions & 2 deletions src/libraries/Native/Unix/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include(CheckStructHasMember)
include(CheckSymbolExists)
include(CheckTypeSize)
include(CheckLibraryExists)
include(CheckFunctionExists)

# CMP0075 Include file check macros honor CMAKE_REQUIRED_LIBRARIES.
if(POLICY CMP0075)
Expand Down Expand Up @@ -141,6 +142,18 @@ check_c_source_compiles(
"
HAVE_FLOCK64)

check_c_source_compiles(
"
#include <sys/types.h>
#include <ifaddrs.h>
int main(void)
{
struct ifaddrs ia;
return 0;
}
"
HAVE_IFADDRS)

check_symbol_exists(
O_CLOEXEC
fcntl.h
Expand All @@ -156,9 +169,8 @@ check_symbol_exists(
fcntl.h
HAVE_F_FULLFSYNC)

check_symbol_exists(
check_function_exists(
getifaddrs
ifaddrs.h
HAVE_GETIFADDRS)

check_symbol_exists(
Expand Down
Loading