Skip to content

Commit 43c4724

Browse files
Update Android and Linux-Bionic images (#102928) (#112354)
Co-authored-by: Alexander Köplinger <[email protected]> (cherry picked from commit 390973d) Co-authored-by: Jeremy Koritzinsky <[email protected]>
1 parent c593d86 commit 43c4724

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

eng/pipelines/common/platform-matrix.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ jobs:
573573
targetRid: android-x64
574574
platform: android_x64
575575
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
576-
container: linux_bionic
576+
container: android
577577
jobParameters:
578578
runtimeFlavor: mono
579579
buildConfig: ${{ parameters.buildConfig }}
@@ -613,7 +613,7 @@ jobs:
613613
targetRid: android-x86
614614
platform: android_x86
615615
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
616-
container: linux_bionic
616+
container: android
617617
jobParameters:
618618
runtimeFlavor: mono
619619
buildConfig: ${{ parameters.buildConfig }}
@@ -633,7 +633,7 @@ jobs:
633633
targetRid: android-arm
634634
platform: android_arm
635635
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
636-
container: linux_bionic
636+
container: android
637637
jobParameters:
638638
runtimeFlavor: mono
639639
buildConfig: ${{ parameters.buildConfig }}
@@ -653,7 +653,7 @@ jobs:
653653
targetRid: android-arm64
654654
platform: android_arm64
655655
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
656-
container: linux_bionic
656+
container: android
657657
jobParameters:
658658
runtimeFlavor: mono
659659
buildConfig: ${{ parameters.buildConfig }}

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,13 @@ extends:
4848
ROOTFS_DIR: /crossrootfs/arm64
4949

5050
# This container contains all required toolsets to build for Android and for Linux with bionic libc.
51-
linux_bionic:
51+
android:
5252
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-android-amd64
5353

54+
# This container contains all required toolsets to build for Android and for Linux with bionic libc and a special layout of OpenSSL.
55+
linux_bionic:
56+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-android-openssl
57+
5458
# This container contains all required toolsets to build for Android as well as tooling to build docker images.
5559
android_docker:
5660
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-android-docker-amd64

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

+7-6
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)