Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions eng/pipelines/common/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ jobs:
targetRid: android-x64
platform: android_x64
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
container: linux_bionic
container: android
jobParameters:
runtimeFlavor: mono
buildConfig: ${{ parameters.buildConfig }}
Expand Down Expand Up @@ -613,7 +613,7 @@ jobs:
targetRid: android-x86
platform: android_x86
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
container: linux_bionic
container: android
jobParameters:
runtimeFlavor: mono
buildConfig: ${{ parameters.buildConfig }}
Expand All @@ -633,7 +633,7 @@ jobs:
targetRid: android-arm
platform: android_arm
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
container: linux_bionic
container: android
jobParameters:
runtimeFlavor: mono
buildConfig: ${{ parameters.buildConfig }}
Expand All @@ -653,7 +653,7 @@ jobs:
targetRid: android-arm64
platform: android_arm64
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
container: linux_bionic
container: android
jobParameters:
runtimeFlavor: mono
buildConfig: ${{ parameters.buildConfig }}
Expand Down
6 changes: 5 additions & 1 deletion eng/pipelines/common/templates/pipeline-with-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ extends:
ROOTFS_DIR: /crossrootfs/arm64

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

# This container contains all required toolsets to build for Android and for Linux with bionic libc and a special layout of OpenSSL.
linux_bionic:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-android-openssl

# This container contains all required toolsets to build for Android as well as tooling to build docker images.
android_docker:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-android-docker-amd64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,27 @@ macro(append_extra_cryptography_libs NativeLibsExtra)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
endif(CMAKE_STATIC_LIB_LINK)

find_package(OpenSSL)
# 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)
if(FORCE_ANDROID_OPENSSL AND NOT OPENSSL_FOUND)
set(OPENSSL_CRYPTO_LIBRARY /usr/lib/x86_64-linux-gnu/libcrypto.so CACHE PATH "libcrypto.so" FORCE)
set(OPENSSL_SSL_LIBRARY /usr/lib/x86_64-linux-gnu/libssl.so CACHE PATH "libcrypto.so" FORCE)
# 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)
if(NOT OPENSSL_INCLUDE_DIR)
string(RANDOM LENGTH 24 _s)
set(OPENSSL_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/${_s}/opensslheaders CACHE PATH "temporary directory")
set(OPENSSL_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/${_s}/opensslheaders CACHE PATH "temporary directory" FORCE)
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()
set(OPENSSL_FOUND TRUE CACHE BOOL "OpenSSL found" FORCE)
endif()

find_package(OpenSSL)

if(NOT OPENSSL_FOUND)
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.")
Expand Down
Loading