Build M1 OpenSSL Builds, Create Universal Binaries (#1414)

* Add support to M1 Mac builds in CI
This commit is contained in:
Thad House 2021-03-31 08:41:29 -07:00 коммит произвёл GitHub
Родитель b1940ba5ec
Коммит 4136685957
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 81 добавлений и 17 удалений

Просмотреть файл

@ -200,7 +200,6 @@ stages:
arch: x64
tls: openssl
extraName: 'sanitize'
skipOpenSSLCache: true
extraBuildArgs: -SanitizeAddress -ExtraArtifactDir Sanitize
config: Debug
- template: ./templates/build-config-user.yml
@ -278,19 +277,27 @@ stages:
tls: openssl
config: Debug
#
# Disabled because arm will not build on CI.
#
# - stage: build_macos_nontest
# displayName: Build macOS - NonTest
# dependsOn: []
# jobs:
# - template: ./templates/build-config-user.yml
# parameters:
# image: macOS-10.15
# platform: macos
# arch: arm64
# tls: openssl
- stage: build_macos_nontest
displayName: Build macOS - NonTest
dependsOn: []
jobs:
- template: ./templates/build-config-user.yml
parameters:
image: macOS-10.15
platform: macos
arch: arm64
tls: openssl
- stage: merge_darwin
displayName: Merge Darwin (macOS)
dependsOn:
- build_macos_nontest
- build_macos_release
- build_macos_debug
jobs:
- template: ./templates/merge-darwin.yml
parameters:
image: macOS-10.15
#
# Performance Tests
@ -565,8 +572,9 @@ stages:
- build_winkernel_nontest
- build_linux_nontest
- build_macos_release
# - build_macos_nontest Skipped because of arm
- build_macos_nontest
- build_macos_debug
- merge_darwin
jobs:
- job: mirror
displayName: Mirror
@ -598,5 +606,6 @@ stages:
- build_linux_debug
- build_windows_nontest
- build_linux_nontest
- merge_darwin
jobs:
- template: ./templates/build-distribution.yml

Просмотреть файл

@ -73,6 +73,12 @@ jobs:
arch: arm
tls: openssl
- template: ./download-artifacts.yml
parameters:
platform: macos
arch: universal
tls: openssl
- task: PowerShell@2
displayName: Package Distribution
inputs:

Просмотреть файл

@ -0,0 +1,40 @@
parameters:
image: ''
jobs:
- job: merge_darwin
displayName: Merge Darwin (macOS)
pool:
vmImage: ${{ parameters.image }}
variables:
runCodesignValidationInjection: false
steps:
- checkout: self
- template: ./download-artifacts.yml
parameters:
platform: macos
arch: x64
tls: openssl
- template: ./download-artifacts.yml
parameters:
platform: macos
arch: arm64
tls: openssl
- task: PowerShell@2
displayName: Merge (Debug)
inputs:
pwsh: true
filePath: scripts/merge-darwin.ps1
arguments: -DeleteSource -Config Debug
- task: PowerShell@2
displayName: Merge (Release)
inputs:
pwsh: true
filePath: scripts/merge-darwin.ps1
arguments: -DeleteSource -Config Release
- template: ./upload-artifacts.yml

Просмотреть файл

@ -499,6 +499,7 @@ if(QUIC_TLS STREQUAL "openssl")
else()
set(OPENSSL_CONFIG_CMD ${CMAKE_CURRENT_SOURCE_DIR}/submodules/openssl/config)
endif()
list(APPEND OPENSSL_CONFIG_FLAGS -isysroot ${CMAKE_OSX_SYSROOT})
else()
set(OPENSSL_CONFIG_CMD ${CMAKE_CURRENT_SOURCE_DIR}/submodules/openssl/config
CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER})

Просмотреть файл

@ -23,7 +23,7 @@ param (
[string]$Config = "Release",
[Parameter(Mandatory = $true)]
[ValidateSet("x86", "x64", "arm", "arm64")]
[ValidateSet("x86", "x64", "arm", "arm64", "universal")]
[string]$Arch,
[Parameter(Mandatory = $true)]

Просмотреть файл

@ -21,7 +21,10 @@ param (
[Parameter(Mandatory = $false)]
[ValidateSet("schannel", "openssl")]
[string]$Tls = ""
[string]$Tls = "",
[Parameter(Mandatory = $false)]
[switch]$DeleteSource = $false
)
Set-StrictMode -Version 'Latest'
@ -61,3 +64,8 @@ foreach ($X64Artifact in $X64Artifacts) {
lipo -create -output $UniversalArtifact $X64Artifact $ArmArtifact
}
if ($DeleteSource) {
Remove-Item -Path $X64ArtifactsDir -Recurse -Force
Remove-Item -Path $Arm64ArtifactsDir -Recurse -Force
}