Skip to content

Commit 390973d

Browse files
Update Android and Linux-Bionic images (dotnet#102928)
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
1 parent 43dbffa commit 390973d

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

eng/pipelines/common/platform-matrix.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ jobs:
571571
targetRid: android-x64
572572
platform: android_x64
573573
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
574-
container: linux_bionic
574+
container: android
575575
jobParameters:
576576
runtimeFlavor: mono
577577
buildConfig: ${{ parameters.buildConfig }}
@@ -611,7 +611,7 @@ jobs:
611611
targetRid: android-x86
612612
platform: android_x86
613613
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
614-
container: linux_bionic
614+
container: android
615615
jobParameters:
616616
runtimeFlavor: mono
617617
buildConfig: ${{ parameters.buildConfig }}
@@ -631,7 +631,7 @@ jobs:
631631
targetRid: android-arm
632632
platform: android_arm
633633
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
634-
container: linux_bionic
634+
container: android
635635
jobParameters:
636636
runtimeFlavor: mono
637637
buildConfig: ${{ parameters.buildConfig }}
@@ -651,7 +651,7 @@ jobs:
651651
targetRid: android-arm64
652652
platform: android_arm64
653653
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
654-
container: linux_bionic
654+
container: android
655655
jobParameters:
656656
runtimeFlavor: mono
657657
buildConfig: ${{ parameters.buildConfig }}

eng/pipelines/common/templates/pipeline-with-resources.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ extends:
4747
ROOTFS_DIR: /crossrootfs/arm64
4848

4949
# This container contains all required toolsets to build for Android and for Linux with bionic libc.
50+
android:
51+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-android-amd64-net9.0
52+
53+
# This container contains all required toolsets to build for Android and for Linux with bionic libc and a special layout of OpenSSL.
5054
linux_bionic:
51-
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-android-amd64
55+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-android-openssl-net9.0
5256

5357
# This container contains all required toolsets to build for Android as well as tooling to build docker images.
5458
android_docker:

src/native/libs/System.Security.Cryptography.Native/extra_libs.cmake

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,27 @@ macro(append_extra_cryptography_libs NativeLibsExtra)
44
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
55
endif(CMAKE_STATIC_LIB_LINK)
66

7+
find_package(OpenSSL)
78
# This is bad and wrong, but good enough to satisfy the build
89
# We only care about having "enough" OpenSSL to get the native lib built
910
# here, and it's on the end user to ship libssl/libcrypto from Google
10-
if(FORCE_ANDROID_OPENSSL)
11-
set(OPENSSL_CRYPTO_LIBRARY /usr/lib/x86_64-linux-gnu/libcrypto.so)
12-
set(OPENSSL_SSL_LIBRARY /usr/lib/x86_64-linux-gnu/libssl.so)
11+
if(FORCE_ANDROID_OPENSSL AND NOT OPENSSL_FOUND)
12+
set(OPENSSL_CRYPTO_LIBRARY /usr/lib/x86_64-linux-gnu/libcrypto.so CACHE PATH "libcrypto.so" FORCE)
13+
set(OPENSSL_SSL_LIBRARY /usr/lib/x86_64-linux-gnu/libssl.so CACHE PATH "libcrypto.so" FORCE)
1314
# Things get more wrong. We need Desktop OpenSSL headers, but
1415
# /usr/include is special cased and forbidden. We need to copy
1516
# the headers to a different location and use them
16-
if(NOT DEFINED OPENSSL_INCLUDE_DIR)
17+
if(NOT OPENSSL_INCLUDE_DIR)
1718
string(RANDOM LENGTH 24 _s)
18-
set(OPENSSL_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/${_s}/opensslheaders CACHE PATH "temporary directory")
19+
set(OPENSSL_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/${_s}/opensslheaders CACHE PATH "temporary directory" FORCE)
1920
file(MAKE_DIRECTORY ${OPENSSL_INCLUDE_DIR})
2021
file(COPY /usr/include/openssl DESTINATION ${OPENSSL_INCLUDE_DIR})
2122
file(GLOB_RECURSE opensslconf /usr/include/*/openssl/*conf*.h)
2223
file(COPY ${opensslconf} DESTINATION ${OPENSSL_INCLUDE_DIR}/openssl/)
2324
endif()
25+
set(OPENSSL_FOUND TRUE CACHE BOOL "OpenSSL found" FORCE)
2426
endif()
2527

26-
find_package(OpenSSL)
2728

2829
if(NOT OPENSSL_FOUND)
2930
message(FATAL_ERROR "!!! Cannot find libssl and System.Security.Cryptography.Native cannot build without it. Try installing libssl-dev (on Linux, but this may vary by distro) or openssl (on macOS) !!!. See the requirements document for your specific operating system: https://github.com/dotnet/runtime/tree/main/docs/workflow/requirements.")

0 commit comments

Comments
 (0)