Implement support for "Linux Bionic", a RID which builds a Linux runtime against an Android libc but without Android OS functions like JNI, Dalvik, Instrumentation, etc. This configuration has been requested by a team working on an IoT scenario.
* The new RID is linux-bionic-arm64/linux-bionic-x64.
* The build reuses the existing Android build dockerfiles and Helix queues
* Since we don't have JNI, we don't have Android Crypto - instead, use an Android build of OpenSSL. As an errata, it is incumbent upon the end user to supply this in their OS environment (we download one ad-hoc for testing purposes, which was compiled by Google)
* Some tests cannot be completed due to SELinux policies affecting the shell user executing tests via adb shell in the world-writable /data/local/tmp directory. We expect those tests would pass if they pass on Android, in a real-world IoT scenario with a custom OS (rather than recycling Google's OS images intended for phones)
Closes: #66027
<TargetOS Condition="'$(TargetOS)' == ''">$(_hostOS)</TargetOS>
<TargetsMobile Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator' or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'Browser'">true</TargetsMobile>
<TargetsAppleMobile Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator'">true</TargetsAppleMobile>
+ <TargetsLinuxBionic Condition="$(OutputRid.StartsWith('linux-bionic'))">true</TargetsLinuxBionic>
</PropertyGroup>
<!-- Platform property is required by RepoLayout.props in Arcade SDK. -->
<_portableOS>linux</_portableOS>
<_portableOS Condition="'$(_runtimeOS)' == 'linux-musl'">linux-musl</_portableOS>
+ <_portableOS Condition="'$(_runtimeOS)' == 'linux-bionic'">linux-bionic</_portableOS>
<_portableOS Condition="'$(_hostOS)' == 'OSX'">osx</_portableOS>
<_portableOS Condition="'$(_runtimeOS)' == 'win' or '$(TargetOS)' == 'windows'">win</_portableOS>
<_portableOS Condition="'$(_runtimeOS)' == 'FreeBSD' or '$(TargetOS)' == 'FreeBSD'">freebsd</_portableOS>
<_toolsRID Condition="'$(_runtimeOS)' == 'browser' and '$(HostOS)' == 'osx'">osx-x64</_toolsRID>
<!-- There are no Android tools, so use the default ones -->
- <_toolsRID Condition="'$(_runtimeOS)' == 'android'">linux-x64</_toolsRID>
- <_toolsRID Condition="'$(_runtimeOS)' == 'android' and '$(HostOS)' == 'windows'">win-x64</_toolsRID>
- <_toolsRID Condition="'$(_runtimeOS)' == 'android' and '$(HostOS)' == 'osx'">osx-x64</_toolsRID>
+ <_toolsRID Condition="'$(_runtimeOS)' == 'android' or '$(_runtimeOS)' == 'linux-bionic'">linux-x64</_toolsRID>
+ <_toolsRID Condition="('$(_runtimeOS)' == 'android' or '$(_runtimeOS)' == 'linux-bionic') and '$(HostOS)' == 'windows'">win-x64</_toolsRID>
+ <_toolsRID Condition="('$(_runtimeOS)' == 'android' or '$(_runtimeOS)' == 'linux-bionic') and '$(HostOS)' == 'osx'">osx-x64</_toolsRID>
<!-- There are no Mac Catalyst, iOS or tvOS tools and it can be built on OSX only, so use that -->
<_toolsRID Condition="'$(_runtimeOS)' == 'maccatalyst' or '$(_runtimeOS)' == 'ios' or '$(_runtimeOS)' == 'iOSSimulator' or '$(_runtimeOS)' == 'tvos' or '$(_runtimeOS)' == 'tvOSSimulator'">osx-x64</_toolsRID>
flavor is used to decide when to build the hosts and installers. -->
<PropertyGroup>
<PrimaryRuntimeFlavor>CoreCLR</PrimaryRuntimeFlavor>
- <PrimaryRuntimeFlavor Condition="'$(TargetArchitecture)' == 's390x' or '$(TargetArchitecture)' == 'armv6'">Mono</PrimaryRuntimeFlavor>
+ <PrimaryRuntimeFlavor Condition="'$(TargetArchitecture)' == 's390x' or '$(TargetArchitecture)' == 'armv6' or '$(TargetsLinuxBionic)' == 'true'">Mono</PrimaryRuntimeFlavor>
</PropertyGroup>
<PropertyGroup>
<DefaultSubsets>clr+mono+libs+host+packs</DefaultSubsets>
<DefaultSubsets Condition="'$(TargetsMobile)' == 'true'">mono+libs+packs</DefaultSubsets>
+ <DefaultSubsets Condition="'$(TargetsLinuxBionic)' == 'true'">mono+libs+host+packs</DefaultSubsets>
<!-- In source build, mono is only supported as primary runtime flavor. On Windows mono is supported for x86/x64 only. -->
<DefaultSubsets Condition="('$(DotNetBuildFromSource)' == 'true' and '$(PrimaryRuntimeFlavor)' != 'Mono') or ('$(TargetOS)' == 'windows' and '$(TargetArchitecture)' != 'x86' and '$(TargetArchitecture)' != 'x64')">clr+libs+host+packs</DefaultSubsets>
</PropertyGroup>
</ItemGroup>
<!-- Mono sets -->
- <ItemGroup Condition="$(_subset.Contains('+mono.llvm+')) or $(_subset.Contains('+mono.aotcross+')) or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator' or '$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'Browser'">
+ <ItemGroup Condition="$(_subset.Contains('+mono.llvm+')) or $(_subset.Contains('+mono.aotcross+')) or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator' or '$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'Browser' or '$(TargetsLinuxBionic)' == 'true'">
<ProjectToBuild Include="$(MonoProjectRoot)llvm\llvm-init.proj" Category="mono" />
</ItemGroup>
<Uri>https://github.com/dotnet/linker</Uri>
<Sha>6aaa900a0b1268fe4a6ce3e8af4678e84ea154fd</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="1.0.0-prerelease.22256.2">
+ <Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="1.0.0-prerelease.22261.2">
<Uri>https://github.com/dotnet/xharness</Uri>
- <Sha>79dc54a9932d26ad0deaf82562b48c4bc8fd525a</Sha>
+ <Sha>9f147c42bc2934a160e51df98e5f4da9b752a7f5</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.22256.2">
+ <Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.22261.2">
<Uri>https://github.com/dotnet/xharness</Uri>
- <Sha>79dc54a9932d26ad0deaf82562b48c4bc8fd525a</Sha>
+ <Sha>9f147c42bc2934a160e51df98e5f4da9b752a7f5</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="1.0.0-prerelease.22256.2">
+ <Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="1.0.0-prerelease.22261.2">
<Uri>https://github.com/dotnet/xharness</Uri>
- <Sha>79dc54a9932d26ad0deaf82562b48c4bc8fd525a</Sha>
+ <Sha>9f147c42bc2934a160e51df98e5f4da9b752a7f5</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.PackageTesting" Version="7.0.0-beta.22255.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<!-- Testing -->
<MicrosoftNETCoreCoreDisToolsVersion>1.1.0</MicrosoftNETCoreCoreDisToolsVersion>
<MicrosoftNETTestSdkVersion>16.9.0-preview-20201201-01</MicrosoftNETTestSdkVersion>
- <MicrosoftDotNetXHarnessTestRunnersCommonVersion>1.0.0-prerelease.22256.2</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
- <MicrosoftDotNetXHarnessTestRunnersXunitVersion>1.0.0-prerelease.22256.2</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
- <MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.22256.2</MicrosoftDotNetXHarnessCLIVersion>
+ <MicrosoftDotNetXHarnessTestRunnersCommonVersion>1.0.0-prerelease.22261.2</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
+ <MicrosoftDotNetXHarnessTestRunnersXunitVersion>1.0.0-prerelease.22261.2</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
+ <MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.22261.2</MicrosoftDotNetXHarnessCLIVersion>
<MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>1.1.0-alpha.0.22259.2</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
<XUnitVersion>2.4.2-pre.22</XUnitVersion>
<XUnitAnalyzersVersion>0.12.0-pre.20</XUnitAnalyzersVersion>
cmakeArgs="-DCMAKE_SYSTEM_VARIANT=MacCatalyst $cmakeArgs"
fi
- if [[ "$targetOS" == Android && -z "$ROOTFS_DIR" ]]; then
+ if [[ ( "$targetOS" == Android || "$targetOS" == linux-bionic ) && -z "$ROOTFS_DIR" ]]; then
if [[ -z "$ANDROID_NDK_ROOT" ]]; then
echo "Error: You need to set the ANDROID_NDK_ROOT environment variable pointing to the Android NDK root."
exit 1
if [ -z "${distroRid}" ]; then
if [ "$targetOs" = "Linux" ]; then
distroRid="linux-$buildArch"
+ elif [ "$targetOs" = "linux-bionic" ]; then
+ distroRid="linux-bionic-$buildArch"
elif [ "$targetOs" = "OSX" ]; then
distroRid="osx-$buildArch"
elif [ "$targetOs" = "MacCatalyst" ]; then
- name: _osParameter
value: /p:RuntimeOS=linux-musl /p:OutputRid=linux-musl-${{ parameters.archType }}
+ - ${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.osSubGroup, '_bionic')) }}:
+ - name: _osParameter
+ value: /p:RuntimeOS=linux-bionic /p:OutputRid=linux-bionic-${{ parameters.archType }}
+
# Do not rename as it clashes with MSBuild property in libraries/build-native.proj
- name: _crossBuildPropertyArg
value: /p:CrossBuild=${{ parameters.crossBuild }}
# Build
- ${{ if eq(parameters.buildingOnSourceBuildImage, false) }}:
- - script: $(_sclEnableCommand) $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_crossBuildPropertyArg) $(_cxx11Parameter) $(_richCodeNavigationParam) $(_buildDarwinFrameworksParameter)
+ - script: $(_sclEnableCommand) $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_crossBuildPropertyArg) $(_cxx11Parameter) $(_richCodeNavigationParam) $(_buildDarwinFrameworksParameter) $(_overrideTestScriptWindowsCmdParameter)
displayName: Build product
${{ if eq(parameters.useContinueOnErrorDuringBuild, true) }}:
continueOnError: ${{ parameters.shouldContinueOnError }}
crossrootfsDir: '/crossrootfs/arm64'
${{ insert }}: ${{ parameters.jobParameters }}
+# Linux Bionic arm64
+
+- ${{ if containsValue(parameters.platforms, 'Linux_bionic_arm64') }}:
+ - template: xplat-setup.yml
+ parameters:
+ jobTemplate: ${{ parameters.jobTemplate }}
+ helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
+ osGroup: Linux
+ osSubgroup: _bionic
+ archType: arm64
+ targetRid: linux-bionic-arm64
+ platform: Linux_bionic_arm64
+ container:
+ image: ubuntu-18.04-android-20220131172314-3983b4e
+ registry: mcr
+ jobParameters:
+ runtimeFlavor: mono
+ # We build on Linux, but the test queue runs Windows, so
+ # we need to override the test script generation
+ runScriptWindowsCmd: true
+ stagedBuild: ${{ parameters.stagedBuild }}
+ buildConfig: ${{ parameters.buildConfig }}
+ ${{ if eq(parameters.passPlatforms, true) }}:
+ platforms: ${{ parameters.platforms }}
+ helixQueueGroup: ${{ parameters.helixQueueGroup }}
+ ${{ insert }}: ${{ parameters.jobParameters }}
+
+# Linux Bionic x64
+
+- ${{ if containsValue(parameters.platforms, 'Linux_bionic_x64') }}:
+ - template: xplat-setup.yml
+ parameters:
+ jobTemplate: ${{ parameters.jobTemplate }}
+ helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
+ osGroup: Linux
+ osSubgroup: _bionic
+ archType: x64
+ targetRid: linux-bionic-x64
+ platform: Linux_bionic_x64
+ container:
+ image: ubuntu-18.04-android-20220131172314-3983b4e
+ registry: mcr
+ jobParameters:
+ runtimeFlavor: mono
+ stagedBuild: ${{ parameters.stagedBuild }}
+ buildConfig: ${{ parameters.buildConfig }}
+ ${{ if eq(parameters.passPlatforms, true) }}:
+ platforms: ${{ parameters.platforms }}
+ helixQueueGroup: ${{ parameters.helixQueueGroup }}
+ ${{ insert }}: ${{ parameters.jobParameters }}
+
# Linux x64
- ${{ if or(containsValue(parameters.platforms, 'Linux_x64'), containsValue(parameters.platforms, 'CoreClrTestBuildHost'), in(parameters.platformGroup, 'all', 'gcstress')) }}:
- name: _runSmokeTestsOnlyArg
value: '/p:RunSmokeTestsOnly=$(isRunSmokeTestsOnly)'
+ - name: _overrideTestScriptWindowsCmdParameter
+ ${{ if eq(parameters.jobParameters.runScriptWindowsCmd, true) }}:
+ value: '/p:RunScriptWindowsCmd=true'
+ ${{ if ne(parameters.jobParameters.runScriptWindowsCmd, true) }}:
+ value: ''
+
- name: _hostedOs
value: ${{ parameters.jobParameters.hostedOs }}
- OSX.1200.Amd64.Open
# Android
- - ${{ if in(parameters.platform, 'Android_x86', 'Android_x64') }}:
+ - ${{ if in(parameters.platform, 'Android_x86', 'Android_x64', 'Linux_bionic_x64') }}:
- Ubuntu.1804.Amd64.Android.29.Open
- - ${{ if in(parameters.platform, 'Android_arm', 'Android_arm64') }}:
+ - ${{ if in(parameters.platform, 'Android_arm', 'Android_arm64', 'Linux_bionic_arm64') }}:
- Windows.10.Amd64.Android.Open
# iOS Simulator/Mac Catalyst arm64
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
#
+# Build the whole product using Mono for Android Linux with Bionic libc
+#
+- 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:
+ - Linux_bionic_arm64
+ - Linux_bionic_x64
+ variables:
+ - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}:
+ - name: _HelixSource
+ value: pr/dotnet/runtime/$(Build.SourceBranch)
+ - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}:
+ - name: _HelixSource
+ value: ci/dotnet/runtime/$(Build.SourceBranch)
+ - name: timeoutPerTestInMinutes
+ value: 60
+ - name: timeoutPerTestCollectionInMinutes
+ value: 180
+ jobParameters:
+ testGroup: innerloop
+ targetRid: Linux-bionic-x64
+ nameSuffix: AllSubsets_Mono
+ buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true
+ timeoutInMinutes: 240
+ 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['isRollingBuild'], true))
+ # extra steps, run tests
+ extraStepsTemplate: /eng/pipelines/libraries/helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: Mono_$(_BuildConfig)_LinuxBionic
+
+#
# Build the whole product using Mono for Android and run runtime tests with Android devices
#
- template: /eng/pipelines/common/platform-matrix.yml
LatestRuntimeFrameworkVersion="$(ProductVersion)"
RuntimeFrameworkName="$(LocalFrameworkOverrideName)"
RuntimePackNamePatterns="$(LocalFrameworkOverrideName).Runtime.**RID**"
- RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-loongarch64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64"
+ RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-bionic-arm64;linux-loongarch64;linux-musl-x64;linux-bionic-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64"
TargetFramework="$(NetCoreAppCurrent)"
TargetingPackName="$(LocalFrameworkOverrideName).Ref"
TargetingPackVersion="$(ProductVersion)"
RuntimeFrameworkName="$(LocalFrameworkOverrideName)"
LatestRuntimeFrameworkVersion="$(ProductVersion)"
RuntimePackNamePatterns="$(LocalFrameworkOverrideName).Runtime.Mono.**RID**"
- RuntimePackRuntimeIdentifiers="linux-arm;linux-armv6;linux-arm64;linux-musl-arm64;linux-loongarch64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64;browser-wasm;ios-arm64;ios-arm;iossimulator-arm64;iossimulator-x64;iossimulator-x86;tvos-arm64;tvossimulator-arm64;tvossimulator-x64;android-arm64;android-arm;android-x64;android-x86"
+ RuntimePackRuntimeIdentifiers="linux-arm;linux-armv6;linux-arm64;linux-musl-arm64;linux-bionic-arm64;linux-loongarch64;linux-musl-x64;linux-bionic-x64;linux-x64;osx-x64;rhel.6-x64;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64;browser-wasm;ios-arm64;ios-arm;iossimulator-arm64;iossimulator-x64;iossimulator-x86;tvos-arm64;tvossimulator-arm64;tvossimulator-x64;android-arm64;android-arm;android-x64;android-x86"
RuntimePackLabels="Mono"
Condition="'@(KnownRuntimePack)' == '' or !@(KnownRuntimePack->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))"/>
<KnownAppHostPack Include="$(LocalFrameworkOverrideName)"
AppHostPackNamePattern="$(LocalFrameworkOverrideName).Host.**RID**"
AppHostPackVersion="$([MSBuild]::ValueOrDefault('$(_AppHostBaselinePackVersion)', '$(ProductVersion)'))"
- AppHostRuntimeIdentifiers="linux-arm;linux-armv6;linux-arm64;linux-musl-arm64;linux-loongarch64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64"
+ AppHostRuntimeIdentifiers="linux-arm;linux-armv6;linux-arm64;linux-musl-arm64;linux-bionic-arm64;linux-loongarch64;linux-musl-x64;linux-bionic-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64"
TargetFramework="$(NetCoreAppCurrent)"
Condition="'@(KnownAppHostPack)' == '' or !@(KnownAppHostPack->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))" />
<KnownCrossgen2Pack Include="$(LocalFrameworkOverrideName).Crossgen2"
--- /dev/null
+#!/bin/sh
+currentDirectory=$(realpath "$(dirname "$0")")
+currentTest=$(basename "$0" .sh)
+runtimeExeArg=${1:-}
+runtimeExe=${2:-}
+extraLibsArg=${3:-}
+extraLibsDir=${4:-}
+if [ $# -eq 0 ]; then
+ echo "Usage: ${currentTest}.sh -r /path/to/dotnet [-l /path/to/preloadlibs]"
+ exit 0
+fi
+if [ "x$runtimeExeArg" != "x" ]; then
+ if [ "x$runtimeExeArg" != "x-r" ]; then
+ echo "Must specify runtime with -r /path/to/dotnet"
+ exit 1
+ fi
+ if [ ! -x "$runtimeExe" ]; then
+ echo "$runtimeExe is not a valid dotnet executable"
+ exit 1
+ fi
+else
+ echo "Must specify runtime with -r /path/to/dotnet"
+ exit 1
+fi
+if [ "x$extraLibsArg" != "x" ]; then
+ if [ "x$extraLibsArg" != "x-l" ]; then
+ echo "Must specify preload libs with -l /path/to/preloadlibs"
+ exit 1
+ fi
+ if [ ! -d "$extraLibsDir" ]; then
+ echo "$extraLibsDir is not a valid directory"
+ exit 1
+ fi
+ export LD_LIBRARY_PATH="$extraLibsDir"
+fi
+_RuntimeDir="$(dirname "$runtimeExe")"
+# Consume OpenSSL if we find it in the runtime folder
+if [ -d "$_RuntimeDir/openssl" ]; then
+ _thisArch=$(uname -m)
+ case "$_thisArch" in
+ x86_64)
+ _thisArchAndroid=x86_64
+ ;;
+ i*86)
+ _thisArchAndroid=x86
+ ;;
+ armv*)
+ _thisArchAndroid=armeabi-v7a
+ ;;
+ aarch*)
+ _thisArchAndroid=arm64-v8a
+ ;;
+ *)
+ ;;
+ esac
+ export LD_LIBRARY_PATH="$_RuntimeDir/openssl/prefab/modules/ssl/libs/android.$_thisArchAndroid:$_RuntimeDir/openssl/prefab/modules/crypto/libs/android.$_thisArchAndroid"
+ # Since we're on Helix, we know we want to set the SSL cert dir
+ export SSL_CERT_DIR=/system/etc/security/cacerts
+fi
+# Android sets an invalid value for HOME, which we bypass on "real" Android via
+# some env var setup in the task. Since we aren't using the Android task system
+# for Bionic, we need to override the value another way
+export HOME="$currentDirectory"
+cd "$currentDirectory" || exit 1
+# Sometimes the depsfile doesn't exist, so only conditionally try to pass it
+if [ -e "${currentTest}.deps.json" ]; then
+ depsFileArg="--depsfile ${currentTest}.deps.json"
+fi
+$runtimeExe exec --runtimeconfig "${currentTest}".runtimeconfig.json ${depsFileArg} xunit.console.dll "${currentTest}".dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing
--- /dev/null
+@ECHO OFF
+setlocal enabledelayedexpansion
+
+FOR /F "tokens=*" %%i IN ('type TestEnv.txt') DO SET %%i
+
+SET EXECUTION_DIR=%~dp0
+SET RUNTIME_PATH=%2
+
+IF [%HELIX_WORKITEM_UPLOAD_ROOT%] == [] (
+ SET "XHARNESS_OUT=%EXECUTION_DIR%xharness-output"
+) ELSE (
+ SET "XHARNESS_OUT=%HELIX_WORKITEM_UPLOAD_ROOT%\xharness-output"
+)
+
+FOR /F %%i IN ("%ASSEMBLY_NAME%") DO @SET TEST_SCRIPT=%%~ni.sh
+
+IF /I [%1] NEQ [--runtime-path] (
+ ECHO You must specify the runtime path with --runtime-path C:\path\to\runtime
+ EXIT /b 1
+)
+
+SET ADDITIONAL_ARGS=%3 %4 %5 %6 %7 %8 %9
+
+CALL :NORMALIZEPATH "%RUNTIME_PATH%"
+SET RUNTIME_PATH=%RETVAL%
+
+CD %EXECUTION_DIR%
+
+:lock
+MKDIR androidtests.lock 2>NUL
+IF "%errorlevel%" NEQ "0" (
+ ping -n 6 127.0.0.1 >NUL
+ GOTO :lock
+)
+
+IF [%XHARNESS_CLI_PATH%] NEQ [] (
+ :: When running in CI, we only have the .NET runtime available
+ :: We need to call the XHarness CLI DLL directly via dotnet exec
+ SET HARNESS_RUNNER=dotnet.exe exec "%XHARNESS_CLI_PATH%"
+) ELSE (
+ SET HARNESS_RUNNER=dotnet.exe xharness
+)
+
+%HARNESS_RUNNER% android-headless test --test-path=%EXECUTION_DIR% --runtime-folder=%RUNTIME_PATH% --test-assembly=%ASSEMBLY_NAME% --device-arch=%TEST_ARCH% --test-script=%TEST_SCRIPT% --output-directory=%XHARNESS_OUT% --timeout=1800 -v %ADDITIONAL_ARGS%
+
+SET EXIT_CODE=%ERRORLEVEL%
+
+ECHO XHarness artifacts: %XHARNESS_OUT%
+
+RMDIR /Q androidtests.lock 2>NUL
+EXIT /B %EXIT_CODE%
+
+:: ========== FUNCTIONS ==========
+:NORMALIZEPATH
+ SET RETVAL=%~f1
+ EXIT /B
--- /dev/null
+#!/usr/bin/env bash
+
+. TestEnv.txt
+
+EXECUTION_DIR="$(realpath "$(dirname "$0")")"
+RUNTIME_PATH="$2"
+TEST_SCRIPT="$(basename "$ASSEMBLY_NAME" .dll).sh"
+if [[ -z "$HELIX_WORKITEM_UPLOAD_ROOT" ]]; then
+ XHARNESS_OUT="$EXECUTION_DIR/xharness-output"
+else
+ XHARNESS_OUT="$HELIX_WORKITEM_UPLOAD_ROOT/xharness-output"
+fi
+
+if [[ -n "$3" ]]; then
+ ADDITIONAL_ARGS=${*:5}
+fi
+
+if [[ "x$1" != "x--runtime-path" ]]; then
+ echo "You must specify the runtime path with --runtime-path /path/to/runtime"
+ exit 1
+fi
+
+RUNTIME_PATH="$(realpath "$RUNTIME_PATH")"
+
+cd "$EXECUTION_DIR" || exit 1
+
+# it doesn't support parallel execution yet, so, here is a hand-made semaphore:
+LOCKDIR=/tmp/androidtests.lock
+while true; do
+ if mkdir "$LOCKDIR"
+ then
+ trap 'rm -rf "$LOCKDIR"' 0
+ break
+ else
+ sleep 5
+ fi
+done
+
+if [[ -n "$XHARNESS_CLI_PATH" ]]; then
+ # Allow overriding the path to the XHarness CLI DLL,
+ # we need to call it directly via dotnet exec
+ HARNESS_RUNNER="dotnet exec $XHARNESS_CLI_PATH"
+else
+ HARNESS_RUNNER="dotnet xharness"
+fi
+
+$HARNESS_RUNNER android-headless test \
+ --test-path="$EXECUTION_DIR" \
+ --runtime-folder="$RUNTIME_PATH" \
+ --test-assembly="$ASSEMBLY_NAME" \
+ --device-arch="$TEST_ARCH" \
+ --test-script="$TEST_SCRIPT" \
+ --output-directory="$XHARNESS_OUT" \
+ --timeout=1800 -v \
+ $ADDITIONAL_ARGS
+
+_exitCode=$?
+
+echo "XHarness artifacts: $XHARNESS_OUT"
+
+exit $_exitCode
<Project>
+ <PropertyGroup>
+ <RunScriptWindowsCmd Condition="'$(TargetOS)' == 'windows' and '$(RunScriptWindowsCmd)' == ''">true</RunScriptWindowsCmd>
+ <RunScriptWindowsCmd Condition="'$(TargetOS)' != 'windows' and '$(RunScriptWindowsCmd)' == ''">false</RunScriptWindowsCmd>
+ </PropertyGroup>
<PropertyGroup Condition="'$(RunScriptInputName)' == ''">
- <RunScriptInputName Condition="'$(TargetOS)' == 'windows'">RunnerTemplate.cmd</RunScriptInputName>
- <RunScriptInputName Condition="'$(TargetOS)' != 'windows'">RunnerTemplate.sh</RunScriptInputName>
+ <RunScriptInputName Condition="'$(RunScriptWindowsCmd)' == 'true'">RunnerTemplate.cmd</RunScriptInputName>
+ <RunScriptInputName Condition="'$(RunScriptWindowsCmd)' != 'true'">RunnerTemplate.sh</RunScriptInputName>
<RunScriptInputName Condition="'$(BuildTestsOnHelix)' == 'true' and '$(TargetsAppleMobile)' == 'true'">AppleHelixRunnerTemplate.sh</RunScriptInputName>
<RunScriptInputName Condition="'$(BuildTestsOnHelix)' != 'true' and '$(TargetsAppleMobile)' == 'true'">AppleRunnerTemplate.sh</RunScriptInputName>
<RunScriptInputName Condition="'$(TargetOS)' == 'Android'">AndroidRunnerTemplate.sh</RunScriptInputName>
<RunScriptInputName Condition="'$(TargetOS)' == 'Browser' and '$(OS)' != 'Windows_NT' and '$(BuildAOTTestsOnHelix)' == 'true'">WasmRunnerAOTTemplate.sh</RunScriptInputName>
<RunScriptInputName Condition="'$(TargetOS)' == 'Browser' and '$(OS)' != 'Windows_NT' and '$(BuildAOTTestsOnHelix)' != 'true'">WasmRunnerTemplate.sh</RunScriptInputName>
<RunScriptInputName Condition="'$(TargetOS)' == 'Browser' and '$(OS)' == 'Windows_NT'">WasmRunnerTemplate.cmd</RunScriptInputName>
+ <RunScriptInputName Condition="'$(TargetsLinuxBionic)' == 'true' and '$(RunScriptWindowsCmd)' != 'true'">BionicRunnerTemplate.sh</RunScriptInputName>
+ <RunScriptInputName Condition="'$(TargetsLinuxBionic)' == 'true' and '$(RunScriptWindowsCmd)' == 'true'">BionicRunnerTemplate.cmd</RunScriptInputName>
+ <InnerRunScriptInputName>BionicRunOnDevice.sh</InnerRunScriptInputName>
</PropertyGroup>
<PropertyGroup>
<RunScriptInputPath Condition="'$(RunScriptInputPath)' == ''">$(MSBuildThisFileDirectory)$(RunScriptInputName)</RunScriptInputPath>
+ <InnerRunScriptInputPath>$(MSBuildThisFileDirectory)$(InnerRunScriptInputName)</InnerRunScriptInputPath>
- <RunScriptOutputName Condition="'$(TargetOS)' != 'windows'">RunTests.sh</RunScriptOutputName>
+ <RunScriptOutputName Condition="'$(RunScriptWindowsCmd)' != 'true'">RunTests.sh</RunScriptOutputName>
<RunScriptOutputName Condition="'$(BuildTestsOnHelix)' == 'true' and '$(TargetsAppleMobile)' == 'true'">build-apple-app.sh</RunScriptOutputName>
- <RunScriptOutputName Condition="'$(TargetOS)' == 'windows' or ('$(TargetOS)' == 'Browser' and '$(OS)' == 'Windows_NT')">RunTests.cmd</RunScriptOutputName>
+ <RunScriptOutputName Condition="'$(RunScriptWindowsCmd)' == 'true' or ('$(TargetOS)' == 'Browser' and '$(OS)' == 'Windows_NT')">RunTests.cmd</RunScriptOutputName>
+ <InnerRunScriptOutputName>$(AssemblyName).sh</InnerRunScriptOutputName>
<RunScriptOutputPath>$([MSBuild]::NormalizePath('$(OutDir)', '$(RunScriptOutputName)'))</RunScriptOutputPath>
+ <InnerRunScriptOutputPath>$([MSBuild]::NormalizePath('$(OutDir)', '$(InnerRunScriptOutputName)'))</InnerRunScriptOutputPath>
+ <InnerRunEnvOutputPath>$([MSBuild]::NormalizePath('$(OutDir)', 'TestEnv.txt'))</InnerRunEnvOutputPath>
- <RunScriptHostDir Condition="'$(TargetOS)' == 'windows'">%RUNTIME_PATH%\</RunScriptHostDir>
- <RunScriptHostDir Condition="'$(TargetOS)' != 'windows'">$RUNTIME_PATH/</RunScriptHostDir>
+ <RunScriptHostDir Condition="'$(RunScriptWindowsCmd)' == 'true'">%RUNTIME_PATH%\</RunScriptHostDir>
+ <RunScriptHostDir Condition="'$(RunScriptWindowsCmd)' != 'true'">$RUNTIME_PATH/</RunScriptHostDir>
- <RunScriptHost Condition="'$(TargetOS)' == 'windows'">$(RunScriptHostDir)dotnet.exe</RunScriptHost>
- <RunScriptHost Condition="'$(TargetOS)' != 'windows'">$(RunScriptHostDir)dotnet</RunScriptHost>
+ <RunScriptHost Condition="'$(RunScriptWindowsCmd)' == 'true'">$(RunScriptHostDir)dotnet.exe</RunScriptHost>
+ <RunScriptHost Condition="'$(RunScriptWindowsCmd)' != 'true'">$(RunScriptHostDir)dotnet</RunScriptHost>
</PropertyGroup>
<!-- For both tests.mobile.targets and tests.wasm.targets -->
<Target Name="GenerateRunScript">
<PropertyGroup>
<!-- RSP file support. -->
- <RunScriptCommand Condition="'$(TargetOS)' != 'windows' and ('$(TargetOS)' != 'Browser' or '$(OS)' != 'Windows_NT')">$(RunScriptCommand) $RSP_FILE</RunScriptCommand>
- <RunScriptCommand Condition="'$(TargetOS)' == 'windows' or ('$(TargetOS)' == 'Browser' and '$(OS)' == 'Windows_NT')">$(RunScriptCommand) %RSP_FILE%</RunScriptCommand>
+ <RunScriptCommand Condition="'$(RunScriptWindowsCmd)' != 'true' and ('$(TargetOS)' != 'Browser' or '$(OS)' != 'Windows_NT')">$(RunScriptCommand) $RSP_FILE</RunScriptCommand>
+ <RunScriptCommand Condition="'$(RunScriptWindowsCmd)' == 'true' or ('$(TargetOS)' == 'Browser' and '$(OS)' == 'Windows_NT')">$(RunScriptCommand) %RSP_FILE%</RunScriptCommand>
<!-- Escape potential user input. -->
<RunScriptCommand>$([MSBuild]::Escape('$(RunScriptCommand)'))</RunScriptCommand>
OutputPath="$(RunScriptOutputPath)" />
<Exec Condition="'$(TargetOS)' != 'windows' and '$(OS)' != 'Windows_NT'" Command="chmod +x $(RunScriptOutputPath)" />
+ <Copy Condition="'$(TargetsLinuxBionic)' == 'true'" SourceFiles="$(InnerRunScriptInputPath)" DestinationFiles="$(InnerRunScriptOutputPath)" />
+ <Exec Condition="'$(TargetsLinuxBionic)' == 'true' and '$(OS)' != 'Windows_NT'" Command="chmod +x $(InnerRunScriptOutputPath)" />
+
+ <PropertyGroup Condition="'$(TargetsLinuxBionic)' == 'true'">
+ <_AndroidArchitecture Condition="'$(TargetArchitecture)' == 'x64'">x86_64</_AndroidArchitecture>
+ <_AndroidArchitecture Condition="'$(TargetArchitecture)' == 'x86'">x86</_AndroidArchitecture>
+ <_AndroidArchitecture Condition="'$(TargetArchitecture)' == 'arm64'">arm64-v8a</_AndroidArchitecture>
+ <_AndroidArchitecture Condition="'$(TargetArchitecture)' == 'arm'">armeabi-v7a</_AndroidArchitecture>
+ <_BionicTestEnv>
+ASSEMBLY_NAME=$(AssemblyName).dll
+TEST_ARCH=$(_AndroidArchitecture)
+ </_BionicTestEnv>
+ </PropertyGroup>
+
+ <WriteLinesToFile Condition="'$(TargetsLinuxBionic)' == 'true'" File="$(InnerRunEnvOutputPath)" Overwrite="true" Lines="$(_BionicTestEnv)" Encoding="ascii">
+ </WriteLinesToFile>
</Target>
<Target Name="RunTests">
<ItemGroup>
<OfficialBuildRID Include="linux-x64" />
<OfficialBuildRID Include="linux-musl-x64" />
+ <OfficialBuildRID Include="linux-bionic-x64" />
<OfficialBuildRID Include="osx-x64" />
<OfficialBuildRID Include="osx-arm64">
<Platform>arm64</Platform>
<OfficialBuildRID Include="linux-musl-arm64">
<Platform>arm64</Platform>
</OfficialBuildRID>
+ <OfficialBuildRID Include="linux-bionic-x86">
+ <Platform>x86</Platform>
+ </OfficialBuildRID>
+ <OfficialBuildRID Include="linux-bionic-arm">
+ <Platform>arm</Platform>
+ </OfficialBuildRID>
+ <OfficialBuildRID Include="linux-bionic-arm64">
+ <Platform>arm64</Platform>
+ </OfficialBuildRID>
<!-- The following RIDs are not officically supported and are not
built during official builds, however we wish to include them
{
internal static partial class Libraries
{
+ // Duplicated from Android for Linux Bionic
+ internal const string Liblog = "liblog";
+
internal const string Odbc32 = "libodbc.so.2";
internal const string OpenLdap = "libldap-2.4.so.2";
internal const string MsQuic = "libmsquic.so";
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task ArgumentValidation_ThrowsExpectedException()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task Disposed_ThrowsObjectDisposedException()
{
StreamPair streams = await CreateConnectedStreamsAsync();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task ReadWriteAsync_PrecanceledOperations_ThrowsCancellationException()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task ReadAsync_CancelPendingTask_ThrowsCancellationException()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task ReadAsync_CancelPendingValueTask_ThrowsCancellationException()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task ReadWriteByte_Success()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
[Theory]
[MemberData(nameof(ReadWrite_Success_MemberData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task ReadWrite_Success(ReadWriteMode mode, int writeSize, bool startWithFlush)
{
foreach (CancellationToken nonCanceledToken in new[] { CancellationToken.None, new CancellationTokenSource().Token })
[Theory]
[MemberData(nameof(ReadWrite_Modes))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task ReadWrite_MessagesSmallerThanReadBuffer_Success(ReadWriteMode mode)
{
if (!FlushGuaranteesAllDataWritten)
[MemberData(nameof(AllReadWriteModesAndValue), false)]
[MemberData(nameof(AllReadWriteModesAndValue), true)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task Read_Eof_Returns0(ReadWriteMode mode, bool dataAvailableFirst)
{
using StreamPair streams = await CreateConnectedStreamsAsync();
[InlineData(ReadWriteMode.AsyncArray)]
[InlineData(ReadWriteMode.AsyncAPM)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task Read_DataStoredAtDesiredOffset(ReadWriteMode mode)
{
using StreamPair streams = await CreateConnectedStreamsAsync();
[InlineData(ReadWriteMode.AsyncArray)]
[InlineData(ReadWriteMode.AsyncAPM)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task Write_DataReadFromDesiredOffset(ReadWriteMode mode)
{
using StreamPair streams = await CreateConnectedStreamsAsync();
[Theory]
[MemberData(nameof(ReadAsync_ContinuesOnCurrentContextIfDesired_MemberData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task ReadAsync_ContinuesOnCurrentSynchronizationContextIfDesired(bool flowExecutionContext, bool? continueOnCapturedContext)
{
await default(JumpToThreadPoolAwaiter); // escape xunit sync ctx
[Theory]
[MemberData(nameof(ReadAsync_ContinuesOnCurrentContextIfDesired_MemberData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task ReadAsync_ContinuesOnCurrentTaskSchedulerIfDesired(bool flowExecutionContext, bool? continueOnCapturedContext)
{
await default(JumpToThreadPoolAwaiter); // escape xunit sync ctx
[InlineData(ReadWriteMode.SyncAPM)]
[InlineData(ReadWriteMode.AsyncAPM)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task ZeroByteRead_BlocksUntilDataAvailableOrNops(ReadWriteMode mode)
{
using StreamPair streams = await CreateConnectedStreamsAsync();
[InlineData(ReadWriteMode.SyncAPM)]
[InlineData(ReadWriteMode.AsyncAPM)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task ZeroByteWrite_OtherDataReceivedSuccessfully(ReadWriteMode mode)
{
byte[][] buffers = new[] { Array.Empty<byte>(), Encoding.UTF8.GetBytes("hello"), Array.Empty<byte>(), Encoding.UTF8.GetBytes("world") };
[InlineData(false)]
[InlineData(true)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task ReadWrite_CustomMemoryManager_Success(bool useAsync)
{
using StreamPair streams = await CreateConnectedStreamsAsync();
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task ConcurrentBidirectionalReadsWrites_Success()
{
if (!SupportsConcurrentBidirectionalUse)
[Theory]
[MemberData(nameof(CopyToAsync_AllDataCopied_MemberData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync)
{
using StreamPair streams = await CreateConnectedStreamsAsync();
[OuterLoop("May take several seconds")]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task Parallel_ReadWriteMultipleStreamsConcurrently()
{
await Task.WhenAll(Enumerable.Range(0, 20).Select(_ => Task.Run(async () =>
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task Timeout_Roundtrips()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task ReadTimeout_Expires_Throws()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task ReadAsync_DuringReadAsync_ThrowsIfUnsupported()
{
if (UnsupportedConcurrentExceptionType is null)
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task Flush_ValidOnWriteableStreamWithNoData_Success()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task Flush_ValidOnReadableStream_Success()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
[InlineData(1)]
[InlineData(2)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task Dispose_ClosesStream(int disposeMode)
{
if (!CansReturnFalseAfterDispose)
public static bool IsSLES => IsDistroAndVersion("sles");
public static bool IsTizen => IsDistroAndVersion("tizen");
public static bool IsFedora => IsDistroAndVersion("fedora");
+ public static bool IsLinuxBionic => IsBionic();
// OSX family
public static bool IsOSXLike => IsOSX || IsiOS || IstvOS || IsMacCatalyst;
}
}
+ /// <summary>
+ /// Assume that Android environment variables but Linux OS mean Android libc
+ /// </summary>
+ private static bool IsBionic()
+ {
+ if (IsLinux)
+ {
+ if (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("ANDROID_STORAGE")))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
private static DistroInfo GetDistroInfo()
{
DistroInfo result = new DistroInfo();
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/60568", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/60568", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public static void IndexOf_TurkishI_TurkishCulture()
{
using (new ThreadCultureChange("tr-TR"))
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/60568", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/60568", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public static void IndexOf_HungarianDoubleCompression_HungarianCulture()
{
using (new ThreadCultureChange("hu-HU"))
// Android has different results w/ tr-TR
// See https://github.com/dotnet/runtime/issues/60568
- if (!PlatformDetection.IsAndroid)
+ if (!PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
tuples.Add(Tuple.Create('\u0049', '\u0131', new CultureInfo("tr-TR")));
tuples.Add(Tuple.Create('\u0130', '\u0069', new CultureInfo("tr-TR")));
{
// Android has different results w/ tr-TR
// See https://github.com/dotnet/runtime/issues/60568
- if (!PlatformDetection.IsAndroid)
+ if (!PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { "h\u0069 world", "H\u0130 WORLD", new CultureInfo("tr-TR") };
yield return new object[] { "h\u0130 world", "H\u0130 WORLD", new CultureInfo("tr-TR") };
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
[MemberData(nameof(ToUpper_TurkishI_TurkishCulture_MemberData))]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/60568", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/60568", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public static void ToUpper_TurkishI_TurkishCulture(string s, string expected)
{
using (new ThreadCultureChange("tr-TR"))
// Android has different results w/ tr-TR
// See https://github.com/dotnet/runtime/issues/60568
- if (PlatformDetection.IsNotInvariantGlobalization && !PlatformDetection.IsAndroid)
+ if (PlatformDetection.IsNotInvariantGlobalization && !PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { "latin i", "Latin I", "tr-TR", false, 1 };
yield return new object[] { "latin i", "Latin I", "tr-TR", true, 1 };
{
// Android has different results w/ tr-TR
// See https://github.com/dotnet/runtime/issues/60568
- if (!PlatformDetection.IsAndroid)
+ if (!PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { "turky \u0131", "TURKY I", "tr-TR" };
yield return new object[] { "turky i", "TURKY \u0130", "tr-TR" };
// Android has different results w/ tr-TR
// See https://github.com/dotnet/runtime/issues/60568
- if (PlatformDetection.IsNotInvariantGlobalization && !PlatformDetection.IsAndroid)
+ if (PlatformDetection.IsNotInvariantGlobalization && !PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { "i latin i", "I Latin", "I", "tr-TR", false, false };
yield return new object[] { "i latin i", "I Latin", "I", "tr-TR", true, false };
],
"android": [
"android",
+ "linux-bionic",
"linux",
"unix",
"any",
"android-arm": [
"android-arm",
"android",
+ "linux-bionic-arm",
+ "linux-bionic",
"linux-arm",
"linux",
"unix-arm",
"android-arm64": [
"android-arm64",
"android",
+ "linux-bionic-arm64",
+ "linux-bionic",
"linux-arm64",
"linux",
"unix-arm64",
"android-x64": [
"android-x64",
"android",
+ "linux-bionic-x64",
+ "linux-bionic",
"linux-x64",
"linux",
"unix-x64",
"android-x86": [
"android-x86",
"android",
+ "linux-bionic-x86",
+ "linux-bionic",
"linux-x86",
"linux",
"unix-x86",
"android.21": [
"android.21",
"android",
+ "linux-bionic",
"linux",
"unix",
"any",
"android.21",
"android-arm",
"android",
+ "linux-bionic-arm",
+ "linux-bionic",
"linux-arm",
"linux",
"unix-arm",
"android.21",
"android-arm64",
"android",
+ "linux-bionic-arm64",
+ "linux-bionic",
"linux-arm64",
"linux",
"unix-arm64",
"android.21",
"android-x64",
"android",
+ "linux-bionic-x64",
+ "linux-bionic",
"linux-x64",
"linux",
"unix-x64",
"android.21",
"android-x86",
"android",
+ "linux-bionic-x86",
+ "linux-bionic",
"linux-x86",
"linux",
"unix-x86",
"android.22",
"android.21",
"android",
+ "linux-bionic",
"linux",
"unix",
"any",
"android.21",
"android-arm",
"android",
+ "linux-bionic-arm",
+ "linux-bionic",
"linux-arm",
"linux",
"unix-arm",
"android.21",
"android-arm64",
"android",
+ "linux-bionic-arm64",
+ "linux-bionic",
"linux-arm64",
"linux",
"unix-arm64",
"android.21",
"android-x64",
"android",
+ "linux-bionic-x64",
+ "linux-bionic",
"linux-x64",
"linux",
"unix-x64",
"android.21",
"android-x86",
"android",
+ "linux-bionic-x86",
+ "linux-bionic",
"linux-x86",
"linux",
"unix-x86",
"android.22",
"android.21",
"android",
+ "linux-bionic",
"linux",
"unix",
"any",
"android.21",
"android-arm",
"android",
+ "linux-bionic-arm",
+ "linux-bionic",
"linux-arm",
"linux",
"unix-arm",
"android.21",
"android-arm64",
"android",
+ "linux-bionic-arm64",
+ "linux-bionic",
"linux-arm64",
"linux",
"unix-arm64",
"android.21",
"android-x64",
"android",
+ "linux-bionic-x64",
+ "linux-bionic",
"linux-x64",
"linux",
"unix-x64",
"android.21",
"android-x86",
"android",
+ "linux-bionic-x86",
+ "linux-bionic",
"linux-x86",
"linux",
"unix-x86",
"android.22",
"android.21",
"android",
+ "linux-bionic",
"linux",
"unix",
"any",
"android.21",
"android-arm",
"android",
+ "linux-bionic-arm",
+ "linux-bionic",
"linux-arm",
"linux",
"unix-arm",
"android.21",
"android-arm64",
"android",
+ "linux-bionic-arm64",
+ "linux-bionic",
"linux-arm64",
"linux",
"unix-arm64",
"android.21",
"android-x64",
"android",
+ "linux-bionic-x64",
+ "linux-bionic",
"linux-x64",
"linux",
"unix-x64",
"android.21",
"android-x86",
"android",
+ "linux-bionic-x86",
+ "linux-bionic",
"linux-x86",
"linux",
"unix-x86",
"android.22",
"android.21",
"android",
+ "linux-bionic",
"linux",
"unix",
"any",
"android.21",
"android-arm",
"android",
+ "linux-bionic-arm",
+ "linux-bionic",
"linux-arm",
"linux",
"unix-arm",
"android.21",
"android-arm64",
"android",
+ "linux-bionic-arm64",
+ "linux-bionic",
"linux-arm64",
"linux",
"unix-arm64",
"android.21",
"android-x64",
"android",
+ "linux-bionic-x64",
+ "linux-bionic",
"linux-x64",
"linux",
"unix-x64",
"android.21",
"android-x86",
"android",
+ "linux-bionic-x86",
+ "linux-bionic",
"linux-x86",
"linux",
"unix-x86",
"android.22",
"android.21",
"android",
+ "linux-bionic",
"linux",
"unix",
"any",
"android.21",
"android-arm",
"android",
+ "linux-bionic-arm",
+ "linux-bionic",
"linux-arm",
"linux",
"unix-arm",
"android.21",
"android-arm64",
"android",
+ "linux-bionic-arm64",
+ "linux-bionic",
"linux-arm64",
"linux",
"unix-arm64",
"android.21",
"android-x64",
"android",
+ "linux-bionic-x64",
+ "linux-bionic",
"linux-x64",
"linux",
"unix-x64",
"android.21",
"android-x86",
"android",
+ "linux-bionic-x86",
+ "linux-bionic",
"linux-x86",
"linux",
"unix-x86",
"android.22",
"android.21",
"android",
+ "linux-bionic",
"linux",
"unix",
"any",
"android.21",
"android-arm",
"android",
+ "linux-bionic-arm",
+ "linux-bionic",
"linux-arm",
"linux",
"unix-arm",
"android.21",
"android-arm64",
"android",
+ "linux-bionic-arm64",
+ "linux-bionic",
"linux-arm64",
"linux",
"unix-arm64",
"android.21",
"android-x64",
"android",
+ "linux-bionic-x64",
+ "linux-bionic",
"linux-x64",
"linux",
"unix-x64",
"android.21",
"android-x86",
"android",
+ "linux-bionic-x86",
+ "linux-bionic",
"linux-x86",
"linux",
"unix-x86",
"android.22",
"android.21",
"android",
+ "linux-bionic",
"linux",
"unix",
"any",
"android.21",
"android-arm",
"android",
+ "linux-bionic-arm",
+ "linux-bionic",
"linux-arm",
"linux",
"unix-arm",
"android.21",
"android-arm64",
"android",
+ "linux-bionic-arm64",
+ "linux-bionic",
"linux-arm64",
"linux",
"unix-arm64",
"android.21",
"android-x64",
"android",
+ "linux-bionic-x64",
+ "linux-bionic",
"linux-x64",
"linux",
"unix-x64",
"android.21",
"android-x86",
"android",
+ "linux-bionic-x86",
+ "linux-bionic",
"linux-x86",
"linux",
"unix-x86",
"android.22",
"android.21",
"android",
+ "linux-bionic",
"linux",
"unix",
"any",
"android.21",
"android-arm",
"android",
+ "linux-bionic-arm",
+ "linux-bionic",
"linux-arm",
"linux",
"unix-arm",
"android.21",
"android-arm64",
"android",
+ "linux-bionic-arm64",
+ "linux-bionic",
"linux-arm64",
"linux",
"unix-arm64",
"android.21",
"android-x64",
"android",
+ "linux-bionic-x64",
+ "linux-bionic",
"linux-x64",
"linux",
"unix-x64",
"android.21",
"android-x86",
"android",
+ "linux-bionic-x86",
+ "linux-bionic",
"linux-x86",
"linux",
"unix-x86",
"android.22",
"android.21",
"android",
+ "linux-bionic",
"linux",
"unix",
"any",
"android.21",
"android-arm",
"android",
+ "linux-bionic-arm",
+ "linux-bionic",
"linux-arm",
"linux",
"unix-arm",
"android.21",
"android-arm64",
"android",
+ "linux-bionic-arm64",
+ "linux-bionic",
"linux-arm64",
"linux",
"unix-arm64",
"android.21",
"android-x64",
"android",
+ "linux-bionic-x64",
+ "linux-bionic",
"linux-x64",
"linux",
"unix-x64",
"android.21",
"android-x86",
"android",
+ "linux-bionic-x86",
+ "linux-bionic",
"linux-x86",
"linux",
"unix-x86",
"android.22",
"android.21",
"android",
+ "linux-bionic",
"linux",
"unix",
"any",
"android.21",
"android-arm",
"android",
+ "linux-bionic-arm",
+ "linux-bionic",
"linux-arm",
"linux",
"unix-arm",
"android.21",
"android-arm64",
"android",
+ "linux-bionic-arm64",
+ "linux-bionic",
"linux-arm64",
"linux",
"unix-arm64",
"android.21",
"android-x64",
"android",
+ "linux-bionic-x64",
+ "linux-bionic",
"linux-x64",
"linux",
"unix-x64",
"android.21",
"android-x86",
"android",
+ "linux-bionic-x86",
+ "linux-bionic",
"linux-x86",
"linux",
"unix-x86",
"android.22",
"android.21",
"android",
+ "linux-bionic",
"linux",
"unix",
"any",
"android.21",
"android-arm",
"android",
+ "linux-bionic-arm",
+ "linux-bionic",
"linux-arm",
"linux",
"unix-arm",
"android.21",
"android-arm64",
"android",
+ "linux-bionic-arm64",
+ "linux-bionic",
"linux-arm64",
"linux",
"unix-arm64",
"android.21",
"android-x64",
"android",
+ "linux-bionic-x64",
+ "linux-bionic",
"linux-x64",
"linux",
"unix-x64",
"android.21",
"android-x86",
"android",
+ "linux-bionic-x86",
+ "linux-bionic",
"linux-x86",
"linux",
"unix-x86",
"any",
"base"
],
+ "linux-bionic": [
+ "linux-bionic",
+ "linux",
+ "unix",
+ "any",
+ "base"
+ ],
+ "linux-bionic-arm": [
+ "linux-bionic-arm",
+ "linux-bionic",
+ "linux-arm",
+ "linux",
+ "unix-arm",
+ "unix",
+ "any",
+ "base"
+ ],
+ "linux-bionic-arm64": [
+ "linux-bionic-arm64",
+ "linux-bionic",
+ "linux-arm64",
+ "linux",
+ "unix-arm64",
+ "unix",
+ "any",
+ "base"
+ ],
+ "linux-bionic-x64": [
+ "linux-bionic-x64",
+ "linux-bionic",
+ "linux-x64",
+ "linux",
+ "unix-x64",
+ "unix",
+ "any",
+ "base"
+ ],
+ "linux-bionic-x86": [
+ "linux-bionic-x86",
+ "linux-bionic",
+ "linux-x86",
+ "linux",
+ "unix-x86",
+ "unix",
+ "any",
+ "base"
+ ],
"linux-loongarch64": [
"linux-loongarch64",
"linux",
},
"android": {
"#import": [
- "linux"
+ "linux-bionic"
]
},
"android-arm": {
"#import": [
"android",
- "linux-arm"
+ "linux-bionic-arm"
]
},
"android-arm64": {
"#import": [
"android",
- "linux-arm64"
+ "linux-bionic-arm64"
]
},
"android-x64": {
"#import": [
"android",
- "linux-x64"
+ "linux-bionic-x64"
]
},
"android-x86": {
"#import": [
"android",
- "linux-x86"
+ "linux-bionic-x86"
]
},
"android.21": {
"unix-armv6"
]
},
+ "linux-bionic": {
+ "#import": [
+ "linux"
+ ]
+ },
+ "linux-bionic-arm": {
+ "#import": [
+ "linux-bionic",
+ "linux-arm"
+ ]
+ },
+ "linux-bionic-arm64": {
+ "#import": [
+ "linux-bionic",
+ "linux-arm64"
+ ]
+ },
+ "linux-bionic-x64": {
+ "#import": [
+ "linux-bionic",
+ "linux-x64"
+ ]
+ },
+ "linux-bionic-x86": {
+ "#import": [
+ "linux-bionic",
+ "linux-x86"
+ ]
+ },
"linux-loongarch64": {
"#import": [
"linux",
<Versions>3.6;3.7;3.8;3.9;3.10;3.11;3.12;3.13;3.14;3.15;3.16</Versions>
</RuntimeGroup>
- <RuntimeGroup Include="android">
+ <RuntimeGroup Include="linux-bionic">
<Parent>linux</Parent>
<Architectures>x64;x86;arm;arm64</Architectures>
+ </RuntimeGroup>
+ <RuntimeGroup Include="android">
+ <Parent>linux-bionic</Parent>
+ <Architectures>x64;x86;arm;arm64</Architectures>
<Versions>21;22;23;24;25;26;27;28;29;30;31;32</Versions>
</RuntimeGroup>
}
[Fact]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/37069", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/37069", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public void Ctor_CultureInfo_Compare_TurkishI()
{
var cultureNames = Helpers.TestCultureNames;
}
[Fact]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/37069", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/37069", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public void Ctor_CultureInfo_GetHashCodeCompare_TurkishI()
{
var cultureNames = Helpers.TestCultureNames;
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/37069", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/37069", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public void Default_Compare_TurkishI()
{
// Turkish has lower-case and upper-case version of the dotted "i", so the upper case of "i" (U+0069) isn't "I" (U+0049)
public partial class FileVersionInfoTest
{
[PlatformSpecific(TestPlatforms.AnyUnix & ~(TestPlatforms.iOS | TestPlatforms.tvOS))]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks mkfifo")]
[Fact]
public void NonRegularFile_Throws()
{
}
[ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "Bionic is not normal Linux, has no normal users/groups")]
public void TestCheckChildProcessUserAndGroupIds()
{
string userName = GetCurrentRealUserName();
public void Extract_SymbolicLinkEntry_TargetInsideDirectory() => Extract_LinkEntry_TargetInsideDirectory_Internal(TarEntryType.SymbolicLink);
[Fact]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/68360", TestPlatforms.Android | TestPlatforms.iOS | TestPlatforms.tvOS)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/68360", TestPlatforms.Android | TestPlatforms.LinuxBionic | TestPlatforms.iOS | TestPlatforms.tvOS)]
public void Extract_HardLinkEntry_TargetInsideDirectory() => Extract_LinkEntry_TargetInsideDirectory_Internal(TarEntryType.HardLink);
private void Extract_LinkEntry_TargetInsideDirectory_Internal(TarEntryType entryType)
// Turkish
yield return new object[] { s_turkishCompare, "i", "I", CompareOptions.None, 1 };
// Android has its own ICU, which doesn't work well with tr
- if (!PlatformDetection.IsAndroid)
+ if (!PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { s_turkishCompare, "i", "I", CompareOptions.IgnoreCase, 1 };
yield return new object[] { s_turkishCompare, "i", "\u0130", CompareOptions.IgnoreCase, 0 };
// Slovak
yield return new object[] { s_slovakCompare, "ch", "h", 0, 2, CompareOptions.None, -1, 0 };
// Android has its own ICU, which doesn't work well with slovak
- if (!PlatformDetection.IsAndroid)
+ if (!PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { s_slovakCompare, "chodit hore", "HO", 0, 11, CompareOptions.IgnoreCase, 7, 2 };
}
// Turkish
// Android has its own ICU, which doesn't work well with tr
- if (!PlatformDetection.IsAndroid)
+ if (!PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { s_turkishCompare, "Hi", "I", 0, 2, CompareOptions.IgnoreCase, -1, 0 };
yield return new object[] { s_turkishCompare, "Hi", "\u0130", 0, 2, CompareOptions.IgnoreCase, 1, 1 };
// Turkish
yield return new object[] { s_turkishCompare, "interesting", "I", CompareOptions.None, false, 0 };
// Android has its own ICU, which doesn't work well with tr
- if (!PlatformDetection.IsAndroid)
+ if (!PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { s_turkishCompare, "interesting", "I", CompareOptions.IgnoreCase, false, 0 };
yield return new object[] { s_turkishCompare, "interesting", "\u0130", CompareOptions.IgnoreCase, true, 1 };
// Turkish
yield return new object[] { s_turkishCompare, "Hi", "I", CompareOptions.None, false, 0 };
// Android has its own ICU, which doesn't work well with tr
- if (!PlatformDetection.IsAndroid)
+ if (!PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { s_turkishCompare, "Hi", "I", CompareOptions.IgnoreCase, false, 0 };
yield return new object[] { s_turkishCompare, "Hi", "\u0130", CompareOptions.IgnoreCase, true, 1 };
// Slovak
yield return new object[] { s_slovakCompare, "ch", "h", 0, 1, CompareOptions.None, -1, 0 };
// Android has its own ICU, which doesn't work well with slovak
- if (!PlatformDetection.IsAndroid)
+ if (!PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { s_slovakCompare, "hore chodit", "HO", 11, 12, CompareOptions.IgnoreCase, 0, 2 };
}
// Turkish
// Android has its own ICU, which doesn't work well with tr
- if (!PlatformDetection.IsAndroid)
+ if (!PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { s_turkishCompare, "Hi", "I", 1, 2, CompareOptions.IgnoreCase, -1, 0 };
yield return new object[] { s_turkishCompare, "Hi", "\u0130", 1, 2, CompareOptions.IgnoreCase, 1, 1 };
// Turkish
yield return new object[] { s_turkishCompare, "i", "I", CompareOptions.None, 1 };
// Android has its own ICU, which doesn't work well with tr
- if (!PlatformDetection.IsAndroid)
+ if (!PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { s_turkishCompare, "i", "I", CompareOptions.IgnoreCase, 1 };
yield return new object[] { s_turkishCompare, "i", "\u0130", CompareOptions.IgnoreCase, 0 };
}
[PlatformSpecific(TestPlatforms.AnyUnix)] // Windows locale support doesn't rely on LANG variable
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "Bionic is not normal Linux, has no normal locales")]
[ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
[InlineData("en-US.UTF-8", "en-US")]
[InlineData("en-US", "en-US")]
}
[PlatformSpecific(TestPlatforms.AnyUnix)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "Remote executor has problems with exit codes")]
[ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
[InlineData("")]
[InlineData(null)]
private static void CopyEssentialTestEnvironment(IDictionary<string, string> environment)
{
- string[] essentialVariables = { "HOME", "LD_LIBRARY_PATH" };
+ string[] essentialVariables = { "HOME", "LD_LIBRARY_PATH", "ICU_DATA" };
string[] prefixedVariables = { "DOTNET_", "COMPlus_" };
foreach (DictionaryEntry de in Environment.GetEnvironmentVariables())
}
[ConditionalTheory(nameof(PlatformSupportsFakeCultureAndRemoteExecutor))]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "Remote executor has problems with exit codes")]
[InlineData("1", "xx-XY")]
[InlineData("1", "zx-ZY")]
[InlineData("0", "xx-XY")]
}
[ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "Remote executor has problems with exit codes")]
[InlineData(true, true, false)]
[InlineData(true, true, true)]
[InlineData(true, false, true)]
foreach (string cultureName in GetTestLocales())
{
// Android has its own ICU, which doesn't work well with tr
- if (!PlatformDetection.IsAndroid)
+ if (!PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { cultureName, "I", "\u0131" };
yield return new object[] { cultureName, "HI!", "h\u0131!" };
foreach (string cultureName in GetTestLocales())
{
// Android has its own ICU, which doesn't work well with tr
- if (!PlatformDetection.IsAndroid)
+ if (!PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { cultureName, "i", "\u0130" };
yield return new object[] { cultureName, "H\u0131\n\0Hi\u0009!", "HI\n\0H\u0130\t!" };
[Fact]
[PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser & ~TestPlatforms.tvOS & ~TestPlatforms.iOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "Bionic is not normal Linux, has no normal file permissions")]
public async Task CanZipNamedPipe()
{
string destPath = Path.Combine(TestDirectory, "dest.zip");
[PlatformSpecific(TestPlatforms.AnyUnix)]
public void PropertiesOfValidDrive()
{
- var driveName = PlatformDetection.IsAndroid ? "/data" : "/";
+ var driveName = PlatformDetection.IsAndroid || PlatformDetection.IsLinuxBionic ? "/data" : "/";
var driveInfo = new DriveInfo(driveName);
var format = driveInfo.DriveFormat;
Assert.Equal(PlatformDetection.IsBrowser ? DriveType.Unknown : DriveType.Fixed, driveInfo.DriveType);
[Fact]
[PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task NamedPipe_ReadWrite()
{
string fifoPath = GetTestFilePath();
[Fact]
[PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task NamedPipe_ReadWrite_Async()
{
string fifoPath = GetTestFilePath();
[InlineData(0)]
[InlineData(1)]
[SkipOnPlatform(TestPlatforms.Browser, "mkfifo is not supported on WASM")]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks fifo")]
public async Task OpeningMemoryMappedFileFromFileStreamThatWrapsPipeThrowsNotSupportedException(long capacity)
{
(string pipePath, NamedPipeServerStream? serverStream) = CreatePipe();
[InlineData(0)]
[InlineData(1)]
[SkipOnPlatform(TestPlatforms.Browser, "mkfifo is not supported on WASM")]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks fifo")]
public void OpeningMemoryMappedFileFromPipePathThrowsNotSupportedException(long capacity)
{
(string pipePath, NamedPipeServerStream? serverStream) = CreatePipe();
AssertExtensions.Throws<ArgumentOutOfRangeException>("pipeName", () => new NamedPipeServerStream(reservedName, direction, 1, PipeTransmissionMode.Byte, PipeOptions.None, 0, 0));}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public static void Create_PipeName()
{
new NamedPipeServerStream(PipeStreamConformanceTests.GetUniquePipeName()).Dispose();
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public static void Create_PipeName_Direction_MaxInstances()
{
new NamedPipeServerStream(PipeStreamConformanceTests.GetUniquePipeName(), PipeDirection.Out, 1).Dispose();
[Fact]
[PlatformSpecific(TestPlatforms.AnyUnix)] // accessing SafePipeHandle on Unix fails for a non-connected stream
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public static void Unix_GetHandleOfNewServerStream_Throws_InvalidOperationException()
{
using (var pipe = new NamedPipeServerStream(PipeStreamConformanceTests.GetUniquePipeName(), PipeDirection.Out, 1, PipeTransmissionMode.Byte))
public sealed class NamedPipeTest_CrossProcess
{
[ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public void InheritHandles_AvailableInChildProcess()
{
string pipeName = PipeStreamConformanceTests.GetUniquePipeName();
}
[ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public void PingPong_Sync()
{
// Create names for two pipes
}
[ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task PingPong_Async()
{
// Create names for two pipes
[Theory]
[InlineData(1)]
[InlineData(3)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task MultipleWaitingClients_ServerServesOneAtATime(int numClients)
{
string name = PipeStreamConformanceTests.GetUniquePipeName();
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public void MaxNumberOfServerInstances_TooManyServers_Throws()
{
string name = PipeStreamConformanceTests.GetUniquePipeName();
[Theory]
[InlineData(1)]
[InlineData(4)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task MultipleServers_ServeMultipleClientsConcurrently(int numServers)
{
string name = PipeStreamConformanceTests.GetUniquePipeName();
[Fact]
[PlatformSpecific(TestPlatforms.AnyUnix)] // Uses P/Invoke to verify the user name
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task Unix_GetImpersonationUserName_Succeed()
{
string pipeName = PipeStreamConformanceTests.GetUniquePipeName();
[InlineData(PipeDirection.Out)]
[InlineData(PipeDirection.InOut)]
[PlatformSpecific(TestPlatforms.AnyUnix)] // Unix implementation uses bidirectional sockets
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public static void Unix_BufferSizeRoundtripping(PipeDirection direction)
{
int desiredBufferSize = 0;
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task PipeTransmissionMode_Returns_Byte()
{
string pipeName = PipeStreamConformanceTests.GetUniquePipeName();
[Fact]
[PlatformSpecific(TestPlatforms.AnyUnix)] // Unix doesn't currently support message mode
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public void Unix_SetReadModeTo__PipeTransmissionModeByte()
{
string pipeName = PipeStreamConformanceTests.GetUniquePipeName();
[Theory]
[InlineData(PipeDirection.Out, PipeDirection.In)]
[InlineData(PipeDirection.In, PipeDirection.Out)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public void InvalidReadMode_Throws_ArgumentOutOfRangeException(PipeDirection serverDirection, PipeDirection clientDirection)
{
string pipeName = PipeStreamConformanceTests.GetUniquePipeName();
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[PlatformSpecific(TestPlatforms.AnyUnix)] // Checks MaxLength for PipeName on Unix
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public void NameTooLong_MaxLengthPerPlatform()
{
// Increase a name's length until it fails
{
[Fact]
[PlatformSpecific(TestPlatforms.AnyUnix)]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/49873", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/49873", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public void NamedPipeServer_Connects_With_UnixDomainSocketEndPointClient()
{
string pipeName = Path.Combine("/tmp", "pipe-tests-corefx-" + Path.GetRandomFileName());
[Fact]
[PlatformSpecific(TestPlatforms.AnyUnix)]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/49873", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/49873", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public async Task NamedPipeClient_Connects_With_UnixDomainSocketEndPointServer()
{
string pipeName = Path.Combine("/tmp", "pipe-tests-corefx-" + Path.GetRandomFileName());
select new object[] { serverOption, clientOption, asyncServerOps, asyncClientOps };
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task ClonedServer_ActsAsOriginalServer()
{
byte[] msg1 = new byte[] { 5, 7, 9, 10 };
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task ClonedClient_ActsAsOriginalClient()
{
byte[] msg1 = new byte[] { 5, 7, 9, 10 };
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task ConnectOnAlreadyConnectedClient_Throws_InvalidOperationException()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task WaitForConnectionOnAlreadyConnectedServer_Throws_InvalidOperationException()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task CancelTokenOn_ServerWaitForConnectionAsync_Throws_OperationCanceledException()
{
(NamedPipeServerStream server, NamedPipeClientStream client) = CreateServerAndClientStreams();
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task OperationsOnDisconnectedServer()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public virtual async Task OperationsOnDisconnectedClient()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task Windows_OperationsOnNamedServerWithDisposedClient()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public void OperationsOnUnconnectedServer()
{
(NamedPipeServerStream server, NamedPipeClientStream client) = CreateServerAndClientStreams();
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public void OperationsOnUnconnectedClient()
{
(NamedPipeServerStream server, NamedPipeClientStream client) = CreateServerAndClientStreams();
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task DisposedServerPipe_Throws_ObjectDisposedException()
{
(NamedPipeServerStream server, NamedPipeClientStream client) = CreateServerAndClientStreams();
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task DisposedClientPipe_Throws_ObjectDisposedException()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task ReadAsync_DisconnectDuringRead_Returns0()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
}
[PlatformSpecific(TestPlatforms.Windows)] // Unix named pipes are on sockets, where small writes with an empty buffer will succeed immediately
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
[Fact]
public async Task WriteAsync_DisconnectDuringWrite_Throws()
{
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task Server_ReadWriteCancelledToken_Throws_OperationCanceledException()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task Client_ReadWriteCancelledToken_Throws_OperationCanceledException()
{
using StreamPair streams = await CreateConnectedStreamsAsync();
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task TwoServerInstances_OnceDisposed_Throws()
{
string pipeName = GetUniquePipeName();
[InlineData(1, false)]
[InlineData(1, true)]
[SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser.")]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51390", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
public async Task ReadAsync_Canceled_ThrowsException(int method, bool precanceled)
{
namespace System.Net.NetworkInformation.Tests
{
- [PlatformSpecific(TestPlatforms.Android)]
+ [PlatformSpecific(TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public class IPInterfacePropertiesTest_Android
{
private readonly ITestOutputHelper _log;
namespace System.Net.NetworkInformation.Tests
{
[PlatformSpecific(TestPlatforms.Linux)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "Bionic is not normal Linux, has no normal /proc")]
public class IPInterfacePropertiesTest_Linux
{
private readonly ITestOutputHelper _log;
[Fact]
[PlatformSpecific(TestPlatforms.Linux)] // Some APIs are not supported on Linux
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "Bionic is not normal Linux, has no normal /proc")]
public void BasicTest_GetIPInterfaceStatistics_Success_Linux()
{
foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
[Fact]
[PlatformSpecific(TestPlatforms.Linux)] // Some APIs are not supported on Windows and OSX
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "Bionic is not normal Linux, has no normal /proc")]
public void BasicTest_GetIPv4InterfaceStatistics_Success_Linux()
{
// This API is not actually IPv4 specific.
[PlatformSpecific(TestPlatforms.AnyUnix)]
[Fact]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/50568", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/50568", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public void IOControl_SIOCATMARK_Unix_Success()
{
using (var client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
[Theory]
[MemberData(nameof(TcpReceiveSendGetsCanceledByDispose_Data))]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/50568", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/50568", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public async Task TcpReceiveSendGetsCanceledByDispose(bool receiveOrSend, bool ipv6Server, bool dualModeClient)
{
// RHEL7 kernel has a bug preventing close(AF_UNKNOWN) to succeed with IPv6 sockets.
[ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_Success()
{
string path = null;
[ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public void Socket_SendReceive_Success()
{
string path = GetRandomNonExistingFilePath();
[ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public void Socket_SendReceive_Clone_Success()
{
string path = GetRandomNonExistingFilePath();
[ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task Socket_SendReceiveAsync_Success()
{
string path = GetRandomNonExistingFilePath();
[InlineData(500, 21, 18)]
[InlineData(5, 128000, 64000)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task Socket_SendReceiveAsync_PropagateToStream_Success(int iterations, int writeBufferSize, int readBufferSize)
{
var writeBuffer = new byte[writeBufferSize * iterations];
[InlineData(false)]
[InlineData(true)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task ConcurrentSendReceive(bool forceNonBlocking)
{
using (Socket server = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified))
[ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public async Task ConcurrentSendReceiveAsync()
{
using (Socket server = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified))
[InlineData(false)]
[InlineData(true)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51392", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public void UnixDomainSocketEndPoint_RemoteEndPointEqualsBindAddress(bool abstractAddress)
{
string serverAddress;
[ConditionalFact(nameof(PlatformSupportsUnixDomainSockets))]
[PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Linux)] // Don't support abstract socket addresses.
- [ActiveIssue("https://github.com/dotnet/runtime/issues/50568", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/50568", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public void UnixDomainSocketEndPoint_UsingAbstractSocketAddressOnUnsupported_Throws()
{
// An abstract socket address starts with a zero byte.
}
[ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
public void UnixDomainSocketEndPoint_RelativePathDeletesFile()
{
if (!PlatformSupportsUnixDomainSockets)
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.GetCwd.cs">
<Link>Common\Interop\Unix\System.Native\Interop.GetCwd.cs</Link>
</Compile>
- <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.GetDefaultTimeZone.Android.cs" Condition="'$(TargetsAndroid)' == 'true'">
+ <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.GetDefaultTimeZone.Android.cs" Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true'">
<Link>Common\Interop\Unix\System.Native\Interop.GetDefaultTimeZone.Android.cs</Link>
</Compile>
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.GetHostName.cs">
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Internal\Console.Unix.cs" Condition="'$(TargetsAndroid)' != 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)Internal\Console.Android.cs" Condition="'$(TargetsAndroid)' == 'true'" />
- <Compile Include="$(CommonPath)Interop\Android\Interop.Logcat.cs" Condition="'$(TargetsAndroid)' == 'true'">
+ <Compile Include="$(CommonPath)Interop\Android\Interop.Logcat.cs" Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true'">
<Link>Common\Interop\Android\Interop.Logcat.cs</Link>
</Compile>
+ <Compile Include="$(CommonPath)Interop\Linux\Interop.Libraries.cs" Condition="'$(TargetsLinuxBionic)' == 'true'">
+ <Link>Common\Interop\Linux\Interop.Libraries.cs</Link>
+ </Compile>
<Compile Include="$(CommonPath)Interop\Android\Interop.Libraries.cs" Condition="'$(TargetsAndroid)' == 'true'">
<Link>Common\Interop\Android\Interop.Libraries.cs</Link>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\DebugProvider.Unix.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\Stopwatch.Unix.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\Tracing\RuntimeEventSourceHelper.Unix.cs" Condition="'$(FeaturePerfTracing)' == 'true'" />
- <Compile Include="$(MSBuildThisFileDirectory)System\Environment.Android.cs" Condition="'$(TargetsAndroid)' == 'true'" />
+ <Compile Include="$(MSBuildThisFileDirectory)System\Environment.Android.cs" Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\Environment.NoRegistry.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Environment.UnixOrBrowser.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Environment.OSVersion.OSX.cs" Condition="'$(IsOSXLike)' == 'true' AND '$(TargetsMacCatalyst)' != 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\Environment.OSVersion.MacCatalyst.cs" Condition="'$(TargetsMacCatalyst)' == 'true'" />
- <Compile Include="$(MSBuildThisFileDirectory)System\Environment.GetFolderPathCore.Unix.cs" Condition="'$(IsiOSLike)' != 'true' and '$(TargetsAndroid)' != 'true'" />
+ <Compile Include="$(MSBuildThisFileDirectory)System\Environment.GetFolderPathCore.Unix.cs" Condition="'$(IsiOSLike)' != 'true' and '$(TargetsAndroid)' != 'true' and '$(TargetsLinuxBionic)' != 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CalendarData.Unix.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CultureData.Unix.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CultureInfo.Unix.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\LowLevelMonitor.Unix.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\TimerQueue.Unix.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\TimeZoneInfo.Unix.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)System\TimeZoneInfo.Unix.Android.cs" Condition="'$(TargetsAndroid)' == 'true'" />
- <Compile Include="$(MSBuildThisFileDirectory)System\TimeZoneInfo.Unix.NonAndroid.cs" Condition="'$(TargetsAndroid)' != 'true'" />
+ <Compile Include="$(MSBuildThisFileDirectory)System\TimeZoneInfo.Unix.Android.cs" Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true'" />
+ <Compile Include="$(MSBuildThisFileDirectory)System\TimeZoneInfo.Unix.NonAndroid.cs" Condition="'$(TargetsAndroid)' != 'true' and '$(TargetsLinuxBionic)' != 'true'" />
</ItemGroup>
<ItemGroup Condition="('$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true') and '$(IsOSXLike)' != 'true'">
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStatus.SetTimes.OtherUnix.cs" />
yield return new object[] { "abcd", "ABCD", "en-US" };
yield return new object[] { "latin i", "LATIN I", "en-US" };
- if (PlatformDetection.IsNotInvariantGlobalization && !PlatformDetection.IsAndroid)
+ if (PlatformDetection.IsNotInvariantGlobalization && !PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { "turky \u0131", "TURKY I", "tr-TR" };
yield return new object[] { "turky i", "TURKY \u0130", "tr-TR" };
yield return new object[] { "latin i", "LATIN I", "en-US", CompareOptions.IgnoreCase, true};
// Android has its own ICU, which doesn't work well with tr
- if (!PlatformDetection.IsAndroid)
+ if (!PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { "turky \u0131", "TURKY I", "tr-TR", CompareOptions.IgnoreCase, true};
yield return new object[] { "turky i", "TURKY \u0130", "tr-TR", CompareOptions.IgnoreCase, true};
}
[Fact, PlatformSpecific(TestPlatforms.Linux)]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "Bionic is not normal Linux, has no LSB /etc/os-release")]
public void VerifyLinuxRid()
{
string expectedOSName = File.ReadAllLines("/etc/os-release")
public static bool NotMobileAndRemoteExecutable => PlatformDetection.IsNotMobile && RemoteExecutor.IsSupported;
[ConditionalTheory(nameof(NotMobileAndRemoteExecutable))]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "Remote executor has problems with exit codes")]
[MemberData(nameof(SupportedSignals))]
public void SignalHandlerCalledForKnownSignals(PosixSignal s)
{
}
[ConditionalTheory(nameof(NotMobileAndRemoteExecutable))]
+ [SkipOnPlatform(TestPlatforms.LinuxBionic, "Remote executor has problems with exit codes")]
[MemberData(nameof(PosixSignalAsRawValues))]
public void SignalHandlerCalledForRawSignals(PosixSignal s)
{
if (PlatformDetection.IsNotInvariantGlobalization)
{
// Android has issues w/ tr-TR, see https://github.com/dotnet/runtime/issues/37069
- if (!PlatformDetection.IsAndroid)
+ if (!PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { '\u0131', 'I', "tr-TR" };
yield return new object[] { 'i', '\u0130', "tr-TR" };
[Theory]
[MemberData(nameof(ToString_MatchesExpected_MemberData))]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/60562", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/60562", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public static void ToString_MatchesExpected(DateTimeOffset dateTimeOffset, string format, IFormatProvider provider, string expected)
{
if (provider == null)
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
[MemberData(nameof(ToString_MatchesExpected_MemberData))]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/60562", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/60562", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public static void TryFormat_MatchesExpected(DateTimeOffset dateTimeOffset, string format, IFormatProvider provider, string expected)
{
var destination = new char[expected.Length];
[Theory]
[MemberData(nameof(ToString_MatchesExpected_MemberData))]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/60562", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/60562", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public void ToString_Invoke_ReturnsExpected(DateTime dateTime, string format, IFormatProvider provider, string expected)
{
if (provider == null)
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
[MemberData(nameof(ToString_MatchesExpected_MemberData))]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/60562", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/60562", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public static void TryFormat_MatchesExpected(DateTime dateTime, string format, IFormatProvider provider, string expected)
{
var destination = new char[expected.Length];
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/60568", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/60568", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public static void Contains_StringComparison_TurkishI()
{
const string Source = "\u0069\u0130";
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/60568", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/60568", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public void Replace_StringComparison_TurkishI()
{
const string Source = "\u0069\u0130";
// Android has different results w/ tr-TR
// See https://github.com/dotnet/runtime/issues/60568
- if (!PlatformDetection.IsAndroid)
+ if (!PlatformDetection.IsAndroid && !PlatformDetection.IsLinuxBionic)
{
yield return new object[] { "\u0069\u0130", "\u0069", "a", false, new CultureInfo("tr-TR"), "a\u0130" };
yield return new object[] { "\u0069\u0130", "\u0069", "a", true, new CultureInfo("tr-TR"), "aa" };
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/60568", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/60568", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public static void IndexOf_TurkishI_TurkishCulture_Char()
{
using (new ThreadCultureChange("tr-TR"))
/// </summary>
[Theory]
[MemberData(nameof(TurkishI_Is_Differently_LowerUpperCased_In_Turkish_Culture_TestData))]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/37069", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/37069", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public void TurkishI_Is_Differently_LowerUpperCased_In_Turkish_Culture(int length, RegexOptions options)
{
var turkish = new CultureInfo("tr-TR");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Doesn't support NonBacktracking")]
[Fact]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/60568", TestPlatforms.Android)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/60568", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public async Task TurkishI_Is_Differently_LowerUpperCased_In_Turkish_Culture_NonBacktracking()
{
var turkish = new CultureInfo("tr-TR");
<BinPlaceNative>true</BinPlaceNative>
<BinPlaceRuntime>false</BinPlaceRuntime>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
- <UseLiveBuiltDotNetHost Condition="'$(DotNetBuildFromSource)' == 'true' or '$(TargetArchitecture)' == 's390x' or '$(TargetArchitecture)' == 'armv6'">true</UseLiveBuiltDotNetHost>
+ <UseLiveBuiltDotNetHost Condition="'$(DotNetBuildFromSource)' == 'true' or '$(TargetArchitecture)' == 's390x' or '$(TargetArchitecture)' == 'armv6' or '$(TargetsLinuxBionic)' == 'true'">true</UseLiveBuiltDotNetHost>
</PropertyGroup>
<PropertyGroup>
https://github.com/dotnet/arcade/tree/master/src/Microsoft.DotNet.Helix/Sdk,
to send test jobs to Helix.
-->
-
<PropertyGroup>
- <WindowsShell Condition="'$(TargetOS)' == 'windows' or '$(BrowserHost)' == 'windows'">true</WindowsShell>
+ <WindowsShell Condition="'$(TargetOS)' == 'windows' or '$(BrowserHost)' == 'windows' or ($(TargetRuntimeIdentifier.ToLowerInvariant().StartsWith('linux-bionic')) and $(HelixTargetQueue.ToLowerInvariant().Contains('windows')))">true</WindowsShell>
<!-- Set Helix build to build number if available -->
<HelixBuild Condition="'$(HelixBuild)' == ''">$(BUILD_BUILDNUMBER)</HelixBuild>
<HelixCommandPrefixItem Condition="'$(TestUsingWorkloads)' == 'true'" Include="TEST_USING_WORKLOADS=true" />
</ItemGroup>
+ <PropertyGroup Condition="$(TargetRuntimeIdentifier.ToLowerInvariant().StartsWith('linux-bionic'))">
+ <IncludeXHarnessCli>true</IncludeXHarnessCli>
+ <UseDotNetCliVersionFromGlobalJson>true</UseDotNetCliVersionFromGlobalJson>
+ <NeedsDotNetSdk>true</NeedsDotNetSdk>
+ <EnableAzurePipelinesReporter>true</EnableAzurePipelinesReporter>
+ </PropertyGroup>
+
<PropertyGroup Condition="'$(NeedsDotNetSdk)' == 'true'">
<IncludeDotNetCli>true</IncludeDotNetCli>
<DotNetCliPackageType>sdk</DotNetCliPackageType>
<HelixCorrelationPayload Include="$(MicrosoftNetCoreAppRefPackDir)" Destination="microsoft.netcore.app.ref" />
</ItemGroup>
+ <ItemGroup>
+ <HelixCorrelationPayload Include="openssl" Uri="https://netcorenativeassets.blob.core.windows.net/resource-packages/external/android/openssl-1.1.1l-beta-1.zip" Destination="openssl" />
+ </ItemGroup>
+
<ItemGroup Condition="'$(EnableDefaultBuildHelixWorkItems)' == 'true'">
<HelixCorrelationPayload Include="$(HelixCorrelationPayload)"
Condition="'$(IncludeHelixCorrelationPayload)' == 'true'"
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Ping\tests\FunctionalTests\System.Net.Ping.Functional.Tests.csproj" />
</ItemGroup>
- <ItemGroup Condition="'$(TargetsMobile)' == 'true' or '$(TargetArchitecture)' == 'ARMv6'">
+ <ItemGroup Condition="'$(TargetsMobile)' == 'true' or '$(TargetsLinuxBionic)' == 'true' or '$(TargetArchitecture)' == 'ARMv6'">
<!-- LibraryImportGenerator runtime tests depend on DNNE, which does not support mobile platforms. -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.InteropServices\tests\LibraryImportGenerator.Tests\LibraryImportGenerator.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.InteropServices\tests\LibraryImportGenerator.UnitTests\LibraryImportGenerator.Unit.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Security.Cryptography.OpenSsl\tests\System.Security.Cryptography.OpenSsl.Tests.csproj" />
</ItemGroup>
- <ItemGroup Condition="'$(TargetOS)' == 'Android' and '$(RunDisabledAndroidTests)' != 'true'">
+ <ItemGroup Condition="'$(TargetsLinuxBionic)' == 'true' and '$(TargetArchitecture)' == 'x64' and '$(RunDisabledAndroidTests)' != 'true'">
+ <!-- Fails on Helix, cannot repro locally -->
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Threading.Tasks.Parallel\tests\System.Threading.Tasks.Parallel.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Threading.ThreadPool\tests\System.Threading.ThreadPool.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.FileProviders.Physical\tests\Microsoft.Extensions.FileProviders.Physical.Tests.csproj" />
+
+ <!-- Timeout on Helix, cannot repro locally -->
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Security\tests\FunctionalTests\System.Net.Security.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Requests\tests\System.Net.Requests.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Mail\tests\Functional\System.Net.Mail.Functional.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.FileSystem\tests\DisabledFileLockingTests\System.IO.FileSystem.DisabledFileLocking.Tests.csproj" />
+ </ItemGroup>
+
+ <ItemGroup Condition="('$(TargetOS)' == 'Android' or '$(TargetsLinuxBionic)' == 'true') and '$(RunDisabledAndroidTests)' != 'true'">
<!-- Tests time out intermittently -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Hosting\tests\UnitTests\Microsoft.Extensions.Hosting.Unit.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Dynamic.Runtime/tests/System.Dynamic.Runtime.Tests.csproj"/>
</ItemGroup>
- <ItemGroup Condition="'$(TargetOS)' == 'Android' and '$(TargetArchitecture)' == 'arm64' and '$(RunDisabledAndroidTests)' != 'true'">
+ <ItemGroup Condition="('$(TargetOS)' == 'Android' or '$(TargetsLinuxBionic)' == 'true') and '$(TargetArchitecture)' == 'arm64' and '$(RunDisabledAndroidTests)' != 'true'">
<!-- Crashes on CI (possibly flakey) https://github.com/dotnet/runtime/issues/52615 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Configuration/tests/FunctionalTests/Microsoft.Extensions.Configuration.Functional.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Configuration.Binder/tests/Microsoft.Extensions.Configuration.Binder.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection.DispatchProxy/tests/System.Reflection.DispatchProxy.Tests.csproj" />
</ItemGroup>
- <ItemGroup Condition="'$(TargetOS)' == 'Android' and '$(TargetArchitecture)' == 'x64' and '$(RunDisabledAndroidTests)' != 'true'">
+ <ItemGroup Condition="('$(TargetOS)' == 'Android' or '$(TargetsLinuxBionic)' == 'true') and '$(TargetArchitecture)' == 'x64' and '$(RunDisabledAndroidTests)' != 'true'">
<!-- Test flakiness on x64 https://github.com/dotnet/runtime/issues/49937 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Threading\tests\System.Threading.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Security.Cryptography\tests\System.Security.Cryptography.Tests.csproj" />
</ItemGroup>
- <ItemGroup Condition="'$(TargetOS)' == 'Android' and '$(TargetArchitecture)' == 'x86' and '$(RunDisabledAndroidTests)' != 'true'">
+ <ItemGroup Condition="('$(TargetOS)' == 'Android' or '$(TargetsLinuxBionic)' == 'true') and '$(TargetArchitecture)' == 'x86' and '$(RunDisabledAndroidTests)' != 'true'">
<!-- Crashes only on x86 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Primitives\tests\Microsoft.Extensions.Primitives.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Extensions\tests\System.Runtime.Extensions.Tests.csproj" />
<CoreClrLibName>coreclr</CoreClrLibName>
<CoreClrFileName>$(LibPrefix)$(CoreClrLibName)$(LibSuffix)</CoreClrFileName>
<MonoLibName>monosgen-2.0</MonoLibName>
- <MonoSharedLibName Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true' or '$(TargetsAndroid)' == 'true' or '$(TargetsBrowser)' == 'true'">$(MonoLibName)</MonoSharedLibName>
+ <MonoSharedLibName Condition="('$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true' or '$(TargetsAndroid)' == 'true' or '$(TargetsBrowser)' == 'true') and '$(TargetsLinuxBionic)' != 'true'">$(MonoLibName)</MonoSharedLibName>
<MonoSharedLibName Condition="'$(MonoSharedLibName)' == ''">$(CoreClrLibName)</MonoSharedLibName>
<MonoSharedLibFileName>$(LibPrefix)$(MonoSharedLibName)$(LibSuffix)</MonoSharedLibFileName>
<MonoStaticLibFileName>$(LibPrefix)$(MonoLibName)$(StaticLibSuffix)</MonoStaticLibFileName>
<Error Condition="'$(TargetsiOSSimulator)' != 'true' and '$(TargetsiOS)' == 'true' and '$(Platform)' != 'arm64' and '$(Platform)' != 'arm'" Text="Error: Invalid platform for $(TargetOS): $(Platform)." />
<Error Condition="'$(TargetsiOSSimulator)' == 'true' and '$(TargetsiOS)' == 'true' and '$(Platform)' != 'x64' and '$(Platform)' != 'x86' and '$(Platform)' != 'arm64'" Text="Error: Invalid platform for $(TargetOS): $(Platform)." />
<Error Condition="('$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true') and !$([MSBuild]::IsOSPlatform('OSX'))" Text="Error: $(TargetOS) can only be built on macOS." />
- <Error Condition="'$(TargetsAndroid)' == 'true' and '$(Platform)' != 'x64' and '$(Platform)' != 'x86' and '$(Platform)' != 'arm64' and '$(Platform)' != 'arm'" Text="Error: Invalid platform for $(TargetOS): $(Platform)." />
+ <Error Condition="('$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true') and '$(Platform)' != 'x64' and '$(Platform)' != 'x86' and '$(Platform)' != 'arm64' and '$(Platform)' != 'arm'" Text="Error: Invalid platform for $(TargetOS): $(Platform)." />
<Error Condition="'$(TargetsBrowser)' == 'true' and '$(EMSDK_PATH)' == '' and '$(SkipMonoCrossJitConfigure)' != 'true'" Text="The EMSDK_PATH environment variable should be set pointing to the emscripten SDK root dir."/>
- <Error Condition="'$(TargetsAndroid)' == 'true' and '$(ANDROID_NDK_ROOT)' == '' and '$(SkipMonoCrossJitConfigure)' != 'true'" Text="Error: You need to set the ANDROID_NDK_ROOT environment variable pointing to the Android NDK root." />
+ <Error Condition="('$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true') and '$(ANDROID_NDK_ROOT)' == '' and '$(SkipMonoCrossJitConfigure)' != 'true'" Text="Error: You need to set the ANDROID_NDK_ROOT environment variable pointing to the Android NDK root." />
<Error Condition="'$(HostOS)' == 'windows' and ('$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true')" Text="Error: Mono runtime for $(TargetOS) can't be built on Windows." />
<!-- check if Ninja is available and default to it on Unix platforms -->
</ItemGroup>
<!-- ARM Linux cross build options on CI -->
- <ItemGroup Condition="'$(TargetsAndroid)' != 'true' and '$(MonoCrossDir)' != '' and ('$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'armv6' or '$(TargetArchitecture)' == 'arm64')">
+ <ItemGroup Condition="'$(TargetsAndroid)' != 'true' and '$(TargetsLinuxBionic)' != 'true' and '$(MonoCrossDir)' != '' and ('$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'armv6' or '$(TargetArchitecture)' == 'arm64')">
<_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" />
<_MonoCMakeArgs Condition="'$(TargetOS)' == 'Linux' and ('$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'armv6')" Include="-DMONO_ARM_FPU=vfp-hard" />
<_MonoBuildEnv Condition="'$(Platform)' == 'arm64'" Include="TARGET_BUILD_ARCH=arm64" />
<_MonoCXXFLAGS Include="-fexceptions" />
</ItemGroup>
<!-- Android specific options -->
- <PropertyGroup Condition="'$(TargetsAndroid)' == 'true'">
+ <PropertyGroup Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true'">
<_MonoRunInitCompiler>false</_MonoRunInitCompiler>
</PropertyGroup>
- <ItemGroup Condition="'$(TargetsAndroid)' == 'true'">
+ <ItemGroup Condition="'$(TargetsLinuxBionic)' == 'true'">
+ <_MonoCPPFLAGS Include="-DANDROID_FORCE_ICU_DATA_DIR" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true'">
<_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(ANDROID_NDK_ROOT)/build/cmake/android.toolchain.cmake"/>
<_MonoCMakeArgs Include="-DANDROID_NDK=$(ANDROID_NDK_ROOT)"/>
<_MonoCMakeArgs Include="-DANDROID_STL=none"/>
<_MonoCMakeArgs Include="-DDISABLE_LINK_STATIC_COMPONENTS=1" Condition="!('$(TargetsiOSSimulator)' == 'true' or '$(TargetstvOSSimulator)' == 'true')"/>
</ItemGroup>
- <ItemGroup Condition="'$(TargetsAndroid)' == 'true'">
+ <ItemGroup Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true'">
<_MonoCMakeArgs Include="-DFEATURE_PERFTRACING_PAL_TCP=1"/>
<_MonoCMakeArgs Include="-DFEATURE_PERFTRACING_DISABLE_DEFAULT_LISTEN_PORT=1"/>
</ItemGroup>
<MonoToolchainPrebuiltOS Condition="$([MSBuild]::IsOSPlatform('OSX'))">darwin-x86_64</MonoToolchainPrebuiltOS>
<MonoToolchainPrebuiltOS Condition="'$(HostOS)' == 'windows'">windows-x86_64</MonoToolchainPrebuiltOS>
<_MonoRuntimeFilePath>$(MonoObjDir)out\lib\$(MonoFileName)</_MonoRuntimeFilePath>
- <_LinuxAbi Condition="'$(TargetsAndroid)' != 'true'">gnu</_LinuxAbi>
- <_LinuxAbi Condition="'$(TargetsAndroid)' == 'true'">android</_LinuxAbi>
- <_LinuxFloatAbi Condition="'$(TargetsAndroid)' != 'true'">hf</_LinuxFloatAbi>
+ <_LinuxAbi Condition="'$(TargetsAndroid)' != 'true' and '$(TargetsLinuxBionic)' != 'true'">gnu</_LinuxAbi>
+ <_LinuxAbi Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true'">android</_LinuxAbi>
+ <_LinuxFloatAbi Condition="'$(TargetsAndroid)' != 'true' and '$(TargetsLinuxBionic)' != 'true'">hf</_LinuxFloatAbi>
<_Objcopy>objcopy</_Objcopy>
<_Objcopy Condition="'$(Platform)' == 'arm'">arm-linux-$(_LinuxAbi)eabi$(_LinuxFloatAbi)-$(_Objcopy)</_Objcopy>
<_Objcopy Condition="'$(Platform)' == 'armv6'">arm-linux-$(_LinuxAbi)eabi$(_LinuxFloatAbi)-$(_Objcopy)</_Objcopy>
<_Objcopy Condition="'$(Platform)' == 's390x'">s390x-linux-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
<_Objcopy Condition="'$(Platform)' == 'x64'">x86_64-linux-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
<_Objcopy Condition="'$(Platform)' == 'x86'">i686-linux-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
- <_Objcopy Condition="'$(TargetsAndroid)' == 'true'">$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/bin/llvm-objcopy</_Objcopy>
+ <_Objcopy Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true'">$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/bin/llvm-objcopy</_Objcopy>
</PropertyGroup>
<!-- test viability of objcopy command -->
- <Exec Condition="'$(BuildMonoAOTCrossCompilerOnly)' != 'true' and ('$(TargetsLinux)' == 'true' or '$(TargetsAndroid)' == 'true')" Command="$(_Objcopy) -V" IgnoreStandardErrorWarningFormat="true" ContinueOnError="WarnAndContinue" IgnoreExitCode="true" EchoOff="true" ConsoleToMsBuild="true">
+ <Exec Condition="'$(BuildMonoAOTCrossCompilerOnly)' != 'true' and ('$(TargetsLinux)' == 'true' or '$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true')" Command="$(_Objcopy) -V" IgnoreStandardErrorWarningFormat="true" ContinueOnError="WarnAndContinue" IgnoreExitCode="true" EchoOff="true" ConsoleToMsBuild="true">
<Output TaskParameter="ExitCode" PropertyName="_ObjcopyFound"/>
</Exec>
<PropertyGroup>
</ItemGroup>
<!-- Android specific options -->
- <PropertyGroup Condition="'$(TargetsAndroid)' == 'true'">
+ <PropertyGroup Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true'">
<MonoToolchainPrebuiltOS Condition="$([MSBuild]::IsOSPlatform('Linux'))">linux-x86_64</MonoToolchainPrebuiltOS>
<MonoToolchainPrebuiltOS Condition="$([MSBuild]::IsOSPlatform('OSX'))">darwin-x86_64</MonoToolchainPrebuiltOS>
<MonoToolchainPrebuiltOS Condition="'$(HostOS)' == 'windows'">windows-x86_64</MonoToolchainPrebuiltOS>
<PropertyGroup Condition="'$(BuildMonoAOTCrossCompilerOnly)' != 'true'">
<_MonoRuntimeFilePath Condition="'$(TargetsWindows)' == 'true'">$(MonoObjDir)out\bin\$(MonoFileName)</_MonoRuntimeFilePath>
<_MonoRuntimeFilePath Condition="'$(_MonoRuntimeFilePath)' == ''">$(MonoObjDir)out\lib\$(MonoFileName)</_MonoRuntimeFilePath>
- <_MonoRuntimeStaticFilePath Condition="'$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsAndroid)' == 'true'">$(MonoObjDir)out\lib\$(MonoStaticLibFileName)</_MonoRuntimeStaticFilePath>
+ <_MonoRuntimeStaticFilePath Condition="'$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true'">$(MonoObjDir)out\lib\$(MonoStaticLibFileName)</_MonoRuntimeStaticFilePath>
<_MonoIncludeInterpStaticFiles Condition="'$(TargetsBrowser)' == 'true'">true</_MonoIncludeInterpStaticFiles>
<_MonoIncludeIcuFiles Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true'">true</_MonoIncludeIcuFiles>
</PropertyGroup>
<Copy SourceFiles="@(_MonoIncludeArtifacts)"
DestinationFiles="@(_MonoIncludeArtifacts->'$(RuntimeBinDir)include\%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="true"
- Condition="'$(MonoGenerateOffsetsOSGroups)' == '' and ('$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsAndroid)' == 'true' or '$(TargetsBrowser)' == 'true')"/>
+ Condition="'$(MonoGenerateOffsetsOSGroups)' == '' and ('$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true' or '$(TargetsBrowser)' == 'true')"/>
<Copy SourceFiles="@(_MonoRuntimeBuildArtifacts)"
DestinationFiles="@(_MonoRuntimeBuildArtifacts->'$(RuntimeBinDir)build\%(RecursiveDir)%(Filename)%(Extension)')"
<CMakeBuildDir>$(IntermediateOutputRootPath)corehost\cmake\</CMakeBuildDir>
<BuildScript>$([MSBuild]::NormalizePath('$(MSBuildThisFileDirectory)', 'build.sh'))</BuildScript>
- <BuildArgs>$(Configuration) $(TargetArchitecture) -apphostver "$(AppHostVersion)" -hostver "$(HostVersion)" -fxrver "$(HostResolverVersion)" -policyver "$(HostPolicyVersion)" -commithash "$([MSBuild]::ValueOrDefault('$(SourceRevisionId)', 'N/A'))" -os $(TargetOS)</BuildArgs>
+ <_CoreHostUnixTargetOS>$(TargetOS)</_CoreHostUnixTargetOS>
+ <_CoreHostUnixTargetOS Condition="'$(TargetsLinuxBionic)' == 'true'">linux-bionic</_CoreHostUnixTargetOS>
+ <BuildArgs>$(Configuration) $(TargetArchitecture) -apphostver "$(AppHostVersion)" -hostver "$(HostVersion)" -fxrver "$(HostResolverVersion)" -policyver "$(HostPolicyVersion)" -commithash "$([MSBuild]::ValueOrDefault('$(SourceRevisionId)', 'N/A'))" -os $(_CoreHostUnixTargetOS)</BuildArgs>
<BuildArgs>$(BuildArgs) -cmakeargs "-DVERSION_FILE_PATH=$(NativeVersionFile)"</BuildArgs>
<BuildArgs Condition="'$(ConfigureOnly)' == 'true'">$(BuildArgs) -configureonly</BuildArgs>
<BuildArgs Condition="'$(PortableBuild)' != 'true'">$(BuildArgs) -portablebuild=false</BuildArgs>
#define FALLBACK_HOST_RID _X("solaris")
#elif defined(TARGET_LINUX_MUSL)
#define FALLBACK_HOST_RID _X("linux-musl")
+#elif defined(TARGET_ANDROID)
+#define FALLBACK_HOST_RID _X("linux-bionic")
#else
#define FALLBACK_HOST_RID _X("linux")
#endif
#add_subdirectory(System.Net.Security.Native) # no gssapi on tvOS, see https://developer.apple.com/documentation/gss
# System.Security.Cryptography.Native is intentionally disabled on tvOS
# it is only used for interacting with OpenSSL which isn't useful there
- elseif (CLR_CMAKE_TARGET_ANDROID)
+ elseif (CLR_CMAKE_TARGET_ANDROID AND NOT FORCE_ANDROID_OPENSSL)
add_subdirectory(System.Security.Cryptography.Native.Android)
+ elseif (FORCE_ANDROID_OPENSSL)
+ add_subdirectory(System.Security.Cryptography.Native)
else ()
add_subdirectory(System.Globalization.Native)
add_subdirectory(System.Net.Security.Native)
}
#endif // TARGET_WINDOWS || TARGET_OSX
+#if defined(ANDROID_FORCE_ICU_DATA_DIR)
+ setenv ("ICU_DATA", "/system/usr/icu/", 0);
+#endif
FOR_ALL_ICU_FUNCTIONS
ValidateICUDataCanLoad();
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
endif(CMAKE_STATIC_LIB_LINK)
+ # This is bad and wrong, but good enough to satisfy the build
+ # We only care about having "enough" OpenSSL to get the native lib built
+ # here, and it's on the end user to ship libssl/libcrypto from Google
+ if(FORCE_ANDROID_OPENSSL)
+ set(OPENSSL_CRYPTO_LIBRARY /usr/lib/x86_64-linux-gnu/libcrypto.so)
+ set(OPENSSL_SSL_LIBRARY /usr/lib/x86_64-linux-gnu/libssl.so)
+ # Things get more wrong. We need Desktop OpenSSL headers, but
+ # /usr/include is special cased and forbidden. We need to copy
+ # the headers to a different location and use them
+ if(NOT DEFINED OPENSSL_INCLUDE_DIR)
+ string(RANDOM LENGTH 24 _s)
+ set(OPENSSL_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/${_s}/opensslheaders CACHE PATH "temporary directory")
+ file(MAKE_DIRECTORY ${OPENSSL_INCLUDE_DIR})
+ file(COPY /usr/include/openssl DESTINATION ${OPENSSL_INCLUDE_DIR})
+ file(GLOB_RECURSE opensslconf /usr/include/*/openssl/*conf*.h)
+ file(COPY ${opensslconf} DESTINATION ${OPENSSL_INCLUDE_DIR}/openssl/)
+ endif()
+ endif()
+
find_package(OpenSSL)
if(NOT OPENSSL_FOUND)
#define DYLIBNAME_SUFFIX ".dylib"
#define MAKELIB(v) DYLIBNAME_PREFIX v DYLIBNAME_SUFFIX
#else
-#define SONAME_BASE "libssl.so."
+#define LIBNAME "libssl.so"
+#define SONAME_BASE LIBNAME "."
#define MAKELIB(v) SONAME_BASE v
#endif
DlOpen(soName);
}
+#ifdef TARGET_ANDROID
+ if (libssl == NULL)
+ {
+ // Android OpenSSL has no soname
+ DlOpen(LIBNAME);
+ }
+#endif
+
if (libssl == NULL)
{
// Prefer OpenSSL 3.x
<NativeVersionFile Condition="'$(TargetOS)' == 'windows'">$(ArtifactsObjDir)_version.h</NativeVersionFile>
<NativeVersionFile Condition="'$(TargetOS)' != 'windows'">$(ArtifactsObjDir)_version.c</NativeVersionFile>
<AssemblyName>.NET Runtime</AssemblyName>
- <_BuildNativeArgs>$(TargetArchitecture) $(Configuration) outconfig $(NetCoreAppCurrent)-$(TargetOS)-$(Configuration)-$(TargetArchitecture) -os $(TargetOS)</_BuildNativeArgs>
+ <_BuildNativeTargetOS>$(TargetOS)</_BuildNativeTargetOS>
+ <_BuildNativeTargetOS Condition="'$(TargetsLinuxBionic)' == 'true'">linux-bionic</_BuildNativeTargetOS>
+ <_BuildNativeArgs>$(TargetArchitecture) $(Configuration) outconfig $(NetCoreAppCurrent)-$(TargetOS)-$(Configuration)-$(TargetArchitecture) -os $(_BuildNativeTargetOS)</_BuildNativeArgs>
<_BuildNativeArgs Condition="'$(OfficialBuildId)' != ''">$(_BuildNativeArgs) /p:OfficialBuildId="$(OfficialBuildId)"</_BuildNativeArgs>
</PropertyGroup>
__CMakeArgs="-DFEATURE_DISTRO_AGNOSTIC_SSL=$__PortableBuild $__CMakeArgs"
__CMakeArgs="-DCMAKE_STATIC_LIB_LINK=$__StaticLibLink $__CMakeArgs"
- if [[ "$__TargetArch" != x86 && "$__TargetArch" != x64 && "$__TargetArch" != "$__HostArch" ]]; then
+ if [[ "$__TargetOS" != linux-bionic && "$__TargetArch" != x86 && "$__TargetArch" != x64 && "$__TargetArch" != "$__HostArch" ]]; then
__CrossBuild=1
echo "Set CrossBuild for $__TargetArch build"
fi
if [[ "$__TargetOS" == Android && -z "$ROOTFS_DIR" ]]; then
# Android SDK defaults to c++_static; we only need C support
__CMakeArgs="-DANDROID_STL=none $__CMakeArgs"
+elif [[ "$__TargetOS" == linux-bionic && -z "$ROOTFS_DIR" ]]; then
+ # Android SDK defaults to c++_static; we only need C support
+ __CMakeArgs="-DFORCE_ANDROID_OPENSSL=1 -DANDROID_STL=none $__CMakeArgs"
elif [[ "$__TargetOS" == iOSSimulator ]]; then
# set default iOS simulator deployment target
# keep in sync with src/mono/Directory.Build.props