Linux-bionic (Android libc w/o Android interop) initial implementation (#66147)
authorJo Shields <directhex@apebox.org>
Thu, 19 May 2022 19:27:40 +0000 (15:27 -0400)
committerGitHub <noreply@github.com>
Thu, 19 May 2022 19:27:40 +0000 (15:27 -0400)
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

76 files changed:
Directory.Build.props
eng/Subsets.props
eng/Version.Details.xml
eng/Versions.props
eng/native/build-commons.sh
eng/native/init-distro-rid.sh
eng/pipelines/common/global-build-job.yml
eng/pipelines/common/platform-matrix.yml
eng/pipelines/common/xplat-setup.yml
eng/pipelines/libraries/helix-queues-setup.yml
eng/pipelines/runtime-staging.yml
eng/targetingpacks.targets
eng/testing/BionicRunOnDevice.sh [new file with mode: 0755]
eng/testing/BionicRunnerTemplate.cmd [new file with mode: 0644]
eng/testing/BionicRunnerTemplate.sh [new file with mode: 0644]
eng/testing/tests.targets
src/installer/pkg/projects/netcoreappRIDs.props
src/libraries/Common/src/Interop/Linux/Interop.Libraries.cs
src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs
src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs
src/libraries/Common/tests/Tests/System/StringTests.cs
src/libraries/Microsoft.NETCore.Platforms/src/runtime.compatibility.json
src/libraries/Microsoft.NETCore.Platforms/src/runtime.json
src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props
src/libraries/System.Collections.NonGeneric/tests/CaseInsensitiveComparerTests.cs
src/libraries/System.Collections.NonGeneric/tests/CaseInsensitiveHashCodeProviderTests.cs
src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/FileVersionInfoTest.Unix.cs
src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs
src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectory.Stream.Tests.cs
src/libraries/System.Globalization/tests/CompareInfo/CompareInfoTests.Compare.cs
src/libraries/System.Globalization/tests/CompareInfo/CompareInfoTests.IndexOf.cs
src/libraries/System.Globalization/tests/CompareInfo/CompareInfoTests.IsPrefix.cs
src/libraries/System.Globalization/tests/CompareInfo/CompareInfoTests.IsSuffix.cs
src/libraries/System.Globalization/tests/CompareInfo/CompareInfoTests.LastIndexOf.cs
src/libraries/System.Globalization/tests/CompareInfo/CompareInfoTests.cs
src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCurrentCulture.cs
src/libraries/System.Globalization/tests/CultureInfo/GetCultureInfo.cs
src/libraries/System.Globalization/tests/System/Globalization/TextInfoTests.cs
src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Unix.cs
src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs
src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs
src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateFromFile.Tests.cs
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.UnixDomainSockets.cs
src/libraries/System.IO.Pipes/tests/PipeStreamConformanceTests.cs
src/libraries/System.IO/tests/StreamReader/StreamReaderTests.cs
src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/IPInterfacePropertiesTest_Android.cs
src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/IPInterfacePropertiesTest_Linux.cs
src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/NetworkInterfaceBasicTest.cs
src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/NetworkInterfaceIPv4Statistics.cs
src/libraries/System.Net.Sockets/tests/FunctionalTests/OSSupport.cs
src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceive.cs
src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
src/libraries/System.Runtime.Extensions/tests/System/StringComparer.cs
src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/RuntimeIdentifierTests.cs
src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/PosixSignalRegistrationTests.Unix.cs
src/libraries/System.Runtime/tests/System/CharTests.cs
src/libraries/System.Runtime/tests/System/DateTimeOffsetTests.cs
src/libraries/System.Runtime/tests/System/DateTimeTests.cs
src/libraries/System.Runtime/tests/System/StringTests.cs
src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/RegexCultureTests.cs
src/libraries/externals.csproj
src/libraries/sendtohelixhelp.proj
src/libraries/tests.proj
src/mono/mono.proj
src/native/corehost/corehost.proj
src/native/corehost/hostmisc/pal.h
src/native/libs/CMakeLists.txt
src/native/libs/System.Globalization.Native/pal_icushim.c
src/native/libs/System.Security.Cryptography.Native/extra_libs.cmake
src/native/libs/System.Security.Cryptography.Native/opensslshim.c
src/native/libs/build-native.proj
src/native/libs/build-native.sh

index acee2f3..d1068b2 100644 (file)
@@ -22,6 +22,7 @@
     <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>
index f967b3e..4fbd6b5 100644 (file)
        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>
 
index b17ba35..f82a031 100644 (file)
       <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>
index 4504a03..db3f738 100644 (file)
     <!-- 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>
index ae802f4..dca6127 100755 (executable)
@@ -78,7 +78,7 @@ build_native()
         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
index 97fd647..024f95c 100644 (file)
@@ -168,6 +168,8 @@ initDistroRidGlobal()
         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
index 3105bf8..e1a8e45 100644 (file)
@@ -79,6 +79,10 @@ jobs:
         - 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 }}
@@ -156,7 +160,7 @@ jobs:
 
     # 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 }}
index 02e2aff..33e5e44 100644 (file)
@@ -185,6 +185,59 @@ jobs:
         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')) }}:
index 2864830..d576b6a 100644 (file)
@@ -46,6 +46,12 @@ jobs:
       - 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 }}
 
index 72b370a..fbc5a74 100644 (file)
@@ -96,9 +96,9 @@ jobs:
       - 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
index 6f66971..35cc083 100644 (file)
@@ -174,6 +174,47 @@ jobs:
           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
index 7e2b8e1..744a0cd 100644 (file)
@@ -31,7 +31,7 @@
                              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"
diff --git a/eng/testing/BionicRunOnDevice.sh b/eng/testing/BionicRunOnDevice.sh
new file mode 100755 (executable)
index 0000000..911ae76
--- /dev/null
@@ -0,0 +1,69 @@
+#!/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
diff --git a/eng/testing/BionicRunnerTemplate.cmd b/eng/testing/BionicRunnerTemplate.cmd
new file mode 100644 (file)
index 0000000..50fb204
--- /dev/null
@@ -0,0 +1,56 @@
+@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
diff --git a/eng/testing/BionicRunnerTemplate.sh b/eng/testing/BionicRunnerTemplate.sh
new file mode 100644 (file)
index 0000000..e1eb394
--- /dev/null
@@ -0,0 +1,61 @@
+#!/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
index 5874fa5..df308f3 100644 (file)
@@ -1,28 +1,39 @@
 <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 -->
@@ -71,8 +82,8 @@
   <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">
index 6282d87..6b64c90 100644 (file)
@@ -4,6 +4,7 @@
   <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
index f97cd05..836bd00 100644 (file)
@@ -5,6 +5,9 @@ internal static partial class Interop
 {
     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";
index 104849c..f12aa87 100644 (file)
@@ -1600,6 +1600,7 @@ namespace System.IO.Tests
 
         [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();
@@ -1612,6 +1613,7 @@ namespace System.IO.Tests
 
         [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();
@@ -1625,6 +1627,7 @@ namespace System.IO.Tests
 
         [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();
@@ -1637,6 +1640,7 @@ namespace System.IO.Tests
 
         [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();
@@ -1647,6 +1651,7 @@ namespace System.IO.Tests
 
         [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();
@@ -1657,6 +1662,7 @@ namespace System.IO.Tests
 
         [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();
@@ -1730,6 +1736,7 @@ namespace System.IO.Tests
         [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 })
@@ -1787,6 +1794,7 @@ namespace System.IO.Tests
         [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)
@@ -1836,6 +1844,7 @@ namespace System.IO.Tests
         [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();
@@ -1875,6 +1884,7 @@ namespace System.IO.Tests
         [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();
@@ -1905,6 +1915,7 @@ namespace System.IO.Tests
         [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();
@@ -2004,6 +2015,7 @@ namespace System.IO.Tests
         [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
@@ -2087,6 +2099,7 @@ namespace System.IO.Tests
         [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
@@ -2177,6 +2190,7 @@ namespace System.IO.Tests
         [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();
@@ -2244,6 +2258,7 @@ namespace System.IO.Tests
         [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") };
@@ -2298,6 +2313,7 @@ namespace System.IO.Tests
         [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();
@@ -2362,6 +2378,7 @@ namespace System.IO.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public virtual async Task ConcurrentBidirectionalReadsWrites_Success()
         {
             if (!SupportsConcurrentBidirectionalUse)
@@ -2419,6 +2436,7 @@ namespace System.IO.Tests
         [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();
@@ -2447,6 +2465,7 @@ namespace System.IO.Tests
 
         [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 () =>
@@ -2457,6 +2476,7 @@ namespace System.IO.Tests
 
         [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();
@@ -2492,6 +2512,7 @@ namespace System.IO.Tests
 
         [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();
@@ -2606,6 +2627,7 @@ namespace System.IO.Tests
         }
 
         [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public virtual async Task ReadAsync_DuringReadAsync_ThrowsIfUnsupported()
         {
             if (UnsupportedConcurrentExceptionType is null)
@@ -2627,6 +2649,7 @@ namespace System.IO.Tests
 
         [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();
@@ -2642,6 +2665,7 @@ namespace System.IO.Tests
 
         [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();
@@ -2660,6 +2684,7 @@ namespace System.IO.Tests
         [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)
index f1aa8fc..33c4f5f 100644 (file)
@@ -32,6 +32,7 @@ namespace System
         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;
@@ -173,6 +174,21 @@ namespace System
             }
         }
 
+        /// <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();
index 6e863d2..0d62819 100644 (file)
@@ -2918,7 +2918,7 @@ namespace System.Tests
         }
 
         [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"))
@@ -3002,7 +3002,7 @@ namespace System.Tests
         }
 
         [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"))
@@ -5129,7 +5129,7 @@ namespace System.Tests
 
             // 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")));
@@ -5618,7 +5618,7 @@ namespace System.Tests
         {
             // 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") };
@@ -5694,7 +5694,7 @@ namespace System.Tests
 
         [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"))
@@ -6788,7 +6788,7 @@ namespace System.Tests
 
             // 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  };
@@ -6810,7 +6810,7 @@ namespace System.Tests
             {
                 // 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" };
@@ -6831,7 +6831,7 @@ namespace System.Tests
 
             // 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  };
index 2c2b5af..caf1063 100644 (file)
   ],
   "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",
index ad727a5..2e5e6aa 100644 (file)
     },
     "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",
index c9d93d3..1a04ed9 100644 (file)
       <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>
 
index 14261e4..7974d07 100644 (file)
@@ -65,7 +65,7 @@ namespace System.Collections.Tests
         }
 
         [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;
index e9120f9..64d6533 100644 (file)
@@ -95,7 +95,7 @@ namespace System.Collections.Tests
         }
 
         [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;
@@ -151,7 +151,7 @@ namespace System.Collections.Tests
         }
 
         [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)
index 8613734..ae303df 100644 (file)
@@ -10,6 +10,7 @@ namespace System.Diagnostics.Tests
     public partial class FileVersionInfoTest
     {
         [PlatformSpecific(TestPlatforms.AnyUnix & ~(TestPlatforms.iOS | TestPlatforms.tvOS))]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks mkfifo")]
         [Fact]
         public void NonRegularFile_Throws()
         {
index e4fd9cf..1039f7a 100644 (file)
@@ -571,6 +571,7 @@ namespace System.Diagnostics.Tests
         }
 
         [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();
index 179bb22..5bb0d9b 100644 (file)
@@ -98,7 +98,7 @@ namespace System.Formats.Tar.Tests
         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)
index 521dad5..be60d6f 100644 (file)
@@ -184,7 +184,7 @@ namespace System.Globalization.Tests
             // 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 };
index 8c19567..58d66e9 100644 (file)
@@ -42,7 +42,7 @@ namespace System.Globalization.Tests
             // 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 };
             }
@@ -50,7 +50,7 @@ namespace System.Globalization.Tests
 
             // 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 };
index a59910f..2b20169 100644 (file)
@@ -37,7 +37,7 @@ namespace System.Globalization.Tests
             // 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 };
index ee054f0..edac588 100644 (file)
@@ -43,7 +43,7 @@ namespace System.Globalization.Tests
             // 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 };
index e5bd894..0bbd781 100644 (file)
@@ -55,7 +55,7 @@ namespace System.Globalization.Tests
             // 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 };
             }
@@ -63,7 +63,7 @@ namespace System.Globalization.Tests
 
             // 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 };
index 638ce7d..5947273 100644 (file)
@@ -260,7 +260,7 @@ namespace System.Globalization.Tests
             // 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 };
index 44afcce..1dbebd7 100644 (file)
@@ -111,6 +111,7 @@ namespace System.Globalization.Tests
         }
 
         [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")]
@@ -137,6 +138,7 @@ namespace System.Globalization.Tests
         }
 
         [PlatformSpecific(TestPlatforms.AnyUnix)]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "Remote executor has problems with exit codes")]
         [ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
         [InlineData("")]
         [InlineData(null)]
@@ -179,7 +181,7 @@ namespace System.Globalization.Tests
 
         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())
index 8312abd..0e78738 100644 (file)
@@ -130,6 +130,7 @@ namespace System.Globalization.Tests
         }
 
         [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")]
@@ -156,6 +157,7 @@ namespace System.Globalization.Tests
         }
 
         [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)]
index c36ba96..11b4dd5 100644 (file)
@@ -279,7 +279,7 @@ namespace System.Globalization.Tests
             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!" };
@@ -407,7 +407,7 @@ namespace System.Globalization.Tests
             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!" };
index 89e8b38..b84dae6 100644 (file)
@@ -142,6 +142,7 @@ namespace System.IO.Compression.Tests
 
         [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");
index 14abd97..e9b30da 100644 (file)
@@ -64,7 +64,7 @@ namespace System.IO.FileSystem.Tests
         [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);
index f5b532e..04d04aa 100644 (file)
@@ -64,6 +64,7 @@ namespace System.IO.Tests
         [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();
@@ -85,6 +86,7 @@ namespace System.IO.Tests
         [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();
index c9feabe..e99b727 100644 (file)
@@ -975,6 +975,7 @@ namespace System.IO.MemoryMappedFiles.Tests
         [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();
@@ -994,6 +995,7 @@ namespace System.IO.MemoryMappedFiles.Tests
         [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();
index f605093..30c1025 100644 (file)
@@ -55,12 +55,14 @@ namespace System.IO.Pipes.Tests
             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();
@@ -205,6 +207,7 @@ namespace System.IO.Pipes.Tests
 
         [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))
index 83e5234..858c7a7 100644 (file)
@@ -14,6 +14,7 @@ namespace System.IO.Pipes.Tests
     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();
@@ -45,6 +46,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public void PingPong_Sync()
         {
             // Create names for two pipes
@@ -71,6 +73,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public async Task PingPong_Async()
         {
             // Create names for two pipes
index 99c2c5d..6f653c8 100644 (file)
@@ -85,6 +85,7 @@ namespace System.IO.Pipes.Tests
         [Theory]
         [InlineData(1)]
         [InlineData(3)]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public async Task MultipleWaitingClients_ServerServesOneAtATime(int numClients)
         {
             string name = PipeStreamConformanceTests.GetUniquePipeName();
@@ -120,6 +121,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public void MaxNumberOfServerInstances_TooManyServers_Throws()
         {
             string name = PipeStreamConformanceTests.GetUniquePipeName();
@@ -157,6 +159,7 @@ namespace System.IO.Pipes.Tests
         [Theory]
         [InlineData(1)]
         [InlineData(4)]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public async Task MultipleServers_ServeMultipleClientsConcurrently(int numServers)
         {
             string name = PipeStreamConformanceTests.GetUniquePipeName();
@@ -353,6 +356,7 @@ namespace System.IO.Pipes.Tests
 
         [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();
@@ -383,6 +387,7 @@ namespace System.IO.Pipes.Tests
         [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;
@@ -446,6 +451,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public async Task PipeTransmissionMode_Returns_Byte()
         {
             string pipeName = PipeStreamConformanceTests.GetUniquePipeName();
@@ -501,6 +507,7 @@ namespace System.IO.Pipes.Tests
 
         [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();
@@ -541,6 +548,7 @@ namespace System.IO.Pipes.Tests
         [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();
@@ -558,6 +566,7 @@ namespace System.IO.Pipes.Tests
 
         [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
index ff7fa15..7eba21d 100644 (file)
@@ -11,7 +11,7 @@ namespace System.IO.Pipes.Tests
     {
         [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());
@@ -29,7 +29,7 @@ namespace System.IO.Pipes.Tests
 
         [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());
index 930b875..6db6334 100644 (file)
@@ -118,6 +118,7 @@ namespace System.IO.Pipes.Tests
             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 };
@@ -155,6 +156,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public async Task ClonedClient_ActsAsOriginalClient()
         {
             byte[] msg1 = new byte[] { 5, 7, 9, 10 };
@@ -192,6 +194,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public async Task ConnectOnAlreadyConnectedClient_Throws_InvalidOperationException()
         {
             using StreamPair streams = await CreateConnectedStreamsAsync();
@@ -202,6 +205,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public async Task WaitForConnectionOnAlreadyConnectedServer_Throws_InvalidOperationException()
         {
             using StreamPair streams = await CreateConnectedStreamsAsync();
@@ -212,6 +216,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public async Task CancelTokenOn_ServerWaitForConnectionAsync_Throws_OperationCanceledException()
         {
             (NamedPipeServerStream server, NamedPipeClientStream client) = CreateServerAndClientStreams();
@@ -255,6 +260,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public async Task OperationsOnDisconnectedServer()
         {
             using StreamPair streams = await CreateConnectedStreamsAsync();
@@ -291,6 +297,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public virtual async Task OperationsOnDisconnectedClient()
         {
             using StreamPair streams = await CreateConnectedStreamsAsync();
@@ -335,6 +342,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public async Task Windows_OperationsOnNamedServerWithDisposedClient()
         {
             using StreamPair streams = await CreateConnectedStreamsAsync();
@@ -358,6 +366,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public void OperationsOnUnconnectedServer()
         {
             (NamedPipeServerStream server, NamedPipeClientStream client) = CreateServerAndClientStreams();
@@ -393,6 +402,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public void OperationsOnUnconnectedClient()
         {
             (NamedPipeServerStream server, NamedPipeClientStream client) = CreateServerAndClientStreams();
@@ -424,6 +434,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public async Task DisposedServerPipe_Throws_ObjectDisposedException()
         {
             (NamedPipeServerStream server, NamedPipeClientStream client) = CreateServerAndClientStreams();
@@ -436,6 +447,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public async Task DisposedClientPipe_Throws_ObjectDisposedException()
         {
             using StreamPair streams = await CreateConnectedStreamsAsync();
@@ -448,6 +460,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public async Task ReadAsync_DisconnectDuringRead_Returns0()
         {
             using StreamPair streams = await CreateConnectedStreamsAsync();
@@ -459,6 +472,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [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()
         {
@@ -471,6 +485,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public async Task Server_ReadWriteCancelledToken_Throws_OperationCanceledException()
         {
             using StreamPair streams = await CreateConnectedStreamsAsync();
@@ -560,6 +575,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public async Task Client_ReadWriteCancelledToken_Throws_OperationCanceledException()
         {
             using StreamPair streams = await CreateConnectedStreamsAsync();
@@ -649,6 +665,7 @@ namespace System.IO.Pipes.Tests
         }
 
         [Fact]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public async Task TwoServerInstances_OnceDisposed_Throws()
         {
             string pipeName = GetUniquePipeName();
index 810cbe5..842af0d 100644 (file)
@@ -555,6 +555,7 @@ namespace System.IO.Tests
         [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)
         {
index 61e57c8..a010c73 100644 (file)
@@ -12,7 +12,7 @@ using Xunit.Abstractions;
 
 namespace System.Net.NetworkInformation.Tests
 {
-    [PlatformSpecific(TestPlatforms.Android)]
+    [PlatformSpecific(TestPlatforms.Android | TestPlatforms.LinuxBionic)]
     public class IPInterfacePropertiesTest_Android
     {
         private readonly ITestOutputHelper _log;
index 6f30a1a..b7efb54 100644 (file)
@@ -13,6 +13,7 @@ using Xunit.Abstractions;
 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;
index a467655..4b4a4ad 100644 (file)
@@ -219,6 +219,7 @@ namespace System.Net.NetworkInformation.Tests
 
         [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())
index 9b73374..43a8e20 100644 (file)
@@ -46,6 +46,7 @@ namespace System.Net.NetworkInformation.Tests
 
         [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.
index 8dcf51f..03a5bdf 100644 (file)
@@ -97,7 +97,7 @@ namespace System.Net.Sockets.Tests
 
         [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))
index 4d43977..b431b25 100644 (file)
@@ -999,7 +999,7 @@ namespace System.Net.Sockets.Tests
 
         [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.
index 9ed4e70..2e6b503 100644 (file)
@@ -31,6 +31,7 @@ namespace System.Net.Sockets.Tests
 
         [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;
@@ -125,6 +126,7 @@ namespace System.Net.Sockets.Tests
 
         [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();
@@ -157,6 +159,7 @@ namespace System.Net.Sockets.Tests
 
         [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();
@@ -202,6 +205,7 @@ namespace System.Net.Sockets.Tests
 
         [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();
@@ -239,6 +243,7 @@ namespace System.Net.Sockets.Tests
         [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];
@@ -295,6 +300,7 @@ namespace System.Net.Sockets.Tests
         [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))
@@ -338,6 +344,7 @@ namespace System.Net.Sockets.Tests
 
         [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))
@@ -393,6 +400,7 @@ namespace System.Net.Sockets.Tests
         [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;
@@ -442,7 +450,7 @@ namespace System.Net.Sockets.Tests
 
         [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.
@@ -472,6 +480,7 @@ namespace System.Net.Sockets.Tests
         }
 
         [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets")]
         public void UnixDomainSocketEndPoint_RelativePathDeletesFile()
         {
             if (!PlatformSupportsUnixDomainSockets)
index 7464a11..478bd1c 100644 (file)
     <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" />
index f4e28a3..cb38777 100644 (file)
@@ -87,7 +87,7 @@ namespace System.Tests
             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" };
@@ -173,7 +173,7 @@ namespace System.Tests
             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};
index d25b747..2fd5054 100644 (file)
@@ -66,6 +66,7 @@ namespace System.Runtime.InteropServices.RuntimeInformationTests
         }
 
         [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")
index 3ae21b3..0fd5420 100644 (file)
@@ -41,6 +41,7 @@ namespace System.Tests
         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)
         {
@@ -75,6 +76,7 @@ namespace System.Tests
         }
 
         [ConditionalTheory(nameof(NotMobileAndRemoteExecutable))]
+        [SkipOnPlatform(TestPlatforms.LinuxBionic, "Remote executor has problems with exit codes")]
         [MemberData(nameof(PosixSignalAsRawValues))]
         public void SignalHandlerCalledForRawSignals(PosixSignal s)
         {
index 3900388..b449efb 100644 (file)
@@ -1190,7 +1190,7 @@ namespace System.Tests
             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" };
index 149442d..6c4ae73 100644 (file)
@@ -1308,7 +1308,7 @@ namespace System.Tests
 
         [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)
@@ -1408,7 +1408,7 @@ namespace System.Tests
 
         [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];
index 236ba3c..7b619cc 100644 (file)
@@ -2297,7 +2297,7 @@ namespace System.Tests
 
         [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)
@@ -2543,7 +2543,7 @@ namespace System.Tests
 
         [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];
index 993f5c9..080c200 100644 (file)
@@ -315,7 +315,7 @@ namespace System.Tests
         }
 
         [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";
@@ -783,7 +783,7 @@ namespace System.Tests
         }
 
         [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";
@@ -830,7 +830,7 @@ namespace System.Tests
 
                 // 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" };
@@ -1112,7 +1112,7 @@ namespace System.Tests
         }
 
         [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"))
index cfecdd4..c228a0e 100644 (file)
@@ -106,7 +106,7 @@ namespace System.Text.RegularExpressions.Tests
         /// </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");
@@ -161,7 +161,7 @@ namespace System.Text.RegularExpressions.Tests
 
         [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");
index 20a643a..9d6d108 100644 (file)
@@ -9,7 +9,7 @@
     <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>
index 909559e..59cd956 100644 (file)
@@ -4,9 +4,8 @@
        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'"
index 784906c..5bae35e 100644 (file)
@@ -83,7 +83,7 @@
     <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" />
index bdc8003..0140971 100644 (file)
@@ -24,7 +24,7 @@
     <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>
@@ -94,9 +94,9 @@
     <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)')"
index 287ac46..11604cb 100644 (file)
@@ -57,7 +57,9 @@
       <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>
index 4e484b1..55d03f5 100644 (file)
@@ -83,6 +83,8 @@
 #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
index a6087be..c15ca54 100644 (file)
@@ -162,8 +162,10 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER)
         #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)
index dd9e5ac..9f89943 100644 (file)
@@ -464,6 +464,9 @@ int32_t GlobalizationNative_LoadICU()
     }
 #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();
 
index 422b2b0..be1d86d 100644 (file)
@@ -4,6 +4,25 @@ macro(append_extra_cryptography_libs NativeLibsExtra)
        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)
index 5b046a8..35949f4 100644 (file)
@@ -36,7 +36,8 @@ FOR_ALL_OPENSSL_FUNCTIONS
 #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
 
@@ -76,6 +77,14 @@ static void OpenLibraryOnce()
         DlOpen(soName);
     }
 
+#ifdef TARGET_ANDROID
+    if (libssl == NULL)
+    {
+        // Android OpenSSL has no soname
+        DlOpen(LIBNAME);
+    }
+#endif
+
     if (libssl == NULL)
     {
         // Prefer OpenSSL 3.x
index b35a2b3..b102a6b 100644 (file)
@@ -4,7 +4,9 @@
     <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>
 
index a9eb4fb..f896736 100755 (executable)
@@ -64,7 +64,7 @@ else
     __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
@@ -73,6 +73,9 @@ 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