Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add native arm64 build slice to all Windows dependencies #190

Merged
merged 6 commits into from
Jan 23, 2025
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
76 changes: 70 additions & 6 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,14 @@ jobs:
strategy:
fail-fast: true
matrix:
target: [x64]
target: [x64, arm64]
include:
- target: x64
config: Release
type: static
- target: arm64
config: Release
type: static
defaults:
run:
shell: pwsh
Expand Down Expand Up @@ -443,14 +446,17 @@ jobs:
strategy:
fail-fast: true
matrix:
target: [x64, x86]
target: [x64, x86, arm64]
include:
- target: x64
config: Release
type: static
- target: x86
config: Release
type: static
- target: arm64
config: Release
type: static
defaults:
run:
shell: pwsh
Expand Down Expand Up @@ -501,7 +507,7 @@ jobs:
Remove-Item -Recurse -Force ${{ github.workspace }}/windows_build_temp

- name: Build qrcodegencpp Debug
if: matrix.target == 'x64'
if: matrix.target == 'x64' || matrix.target == 'arm64'
shell: pwsh
run: |
# Build qrcodegencpp Debug
Expand Down Expand Up @@ -559,6 +565,63 @@ jobs:
target: ${{ matrix.target }}
config: ${{ matrix.config }}

- name: Publish Build Artifacts
if: matrix.target == 'x64' || (github.event_name != 'pull_request' || fromJSON(needs.pre-checks.outputs.seekingTesters))
uses: actions/upload-artifact@v4
with:
name: ${{ steps.setup.outputs.artifactName }}
path: ${{ github.workspace }}/windows/${{ steps.setup.outputs.artifactFileName }}

windows-qt6-arm64-build:
name: Build Qt6 (Windows ARM64)
runs-on: windows-2022
needs: [pre-checks, windows-qt6-build]
strategy:
fail-fast: true
matrix:
config: [RelWithDebInfo, Debug]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Environment
id: setup
run: |
# Setup Environment
$HostArtifactName="qt6-windows-x64-${{ matrix.config }}-${{ needs.pre-checks.outputs.shortHash }}"
$HostFileName="windows-deps-qt6-$(Get-Date -Format 'yyyy-MM-dd')-x64-${{ matrix.config }}.zip"

$ArtifactName="qt6-windows-arm64-${{ matrix.config }}-${{ needs.pre-checks.outputs.shortHash }}"
$FileName="windows-deps-qt6-$(Get-Date -Format 'yyyy-MM-dd')-arm64-${{ matrix.config }}.zip"

"hostArtifactName=${HostArtifactName}" >> $env:GITHUB_OUTPUT
"hostArtifactFileName=${HostFileName}" >> $env:GITHUB_OUTPUT
"qtHostPath=${env:GITHUB_WORKSPACE}/Qt6Host" >> $env:GITHUB_OUTPUT
"artifactName=${ArtifactName}" >> $env:GITHUB_OUTPUT
"artifactFileName=${FileName}" >> $env:GITHUB_OUTPUT

- name: Download Host Tools Artifact
uses: actions/download-artifact@v4
with:
name: ${{ steps.setup.outputs.hostArtifactName }}
path: ${{ github.workspace }}/Qt6Host

- name: Setup Host Tools Artifact
run: |
. ${{ github.workspace }}/utils.pwsh/Expand-ArchiveExt

Set-Location ${{ github.workspace }}/Qt6Host
Expand-ArchiveExt -Path ${{ steps.setup.outputs.hostArtifactFileName }} -DestinationPath (Get-Location | Convert-Path)

- name: Build Windows Qt
uses: ./.github/actions/build-qt
env:
QtHostPath: ${{ steps.setup.outputs.qtHostPath }}
with:
target: arm64
config: ${{ matrix.config }}

- name: Publish Build Artifacts
if: github.event_name != 'pull_request' || fromJSON(needs.pre-checks.outputs.seekingTesters)
uses: actions/upload-artifact@v4
Expand All @@ -572,8 +635,8 @@ jobs:
strategy:
fail-fast: true
matrix:
target: [x64]
needs: [pre-checks, windows-qt6-build]
target: [x64, arm64]
needs: [pre-checks, windows-qt6-build, windows-qt6-arm64-build]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -611,7 +674,7 @@ jobs:
shopt -s extglob
shopt -s nullglob

for arch in x64 x86; do
for arch in x64 x86 arm64; do
_temp=$(mktemp -d)
pushd "${_temp}" > /dev/null

Expand Down Expand Up @@ -679,6 +742,7 @@ jobs:
body_path: ${{ github.workspace }}/CHECKSUMS.txt
files: |
${{ github.workspace }}/windows-*-x64*.zip
${{ github.workspace }}/windows-*-arm64*.zip
${{ github.workspace }}/windows-*-x86*.zip
${{ github.workspace }}/macos-*-arm64.tar.xz
${{ github.workspace }}/macos-*-x86_64.tar.xz
Expand Down
71 changes: 68 additions & 3 deletions .github/workflows/scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
strategy:
fail-fast: true
matrix:
target: [x64]
target: [x64, arm64]
include:
- target: x64
config: Release
Expand Down Expand Up @@ -224,14 +224,17 @@ jobs:
strategy:
fail-fast: true
matrix:
target: [x64, x86]
target: [x64, x86, arm64]
include:
- target: x64
config: Release
type: static
- target: x86
config: Release
type: static
- target: arm64
config: Release
type: static
defaults:
run:
shell: pwsh
Expand Down Expand Up @@ -270,7 +273,7 @@ jobs:
Remove-Item -Recurse -Force ${{ github.workspace }}/windows_build_temp

- name: Build qrcodegencpp Debug
if: matrix.target == 'x64'
if: matrix.target == 'x64' || matrix.target == 'arm64'
shell: pwsh
run: |
# Build qrcodegencpp Debug
Expand Down Expand Up @@ -351,8 +354,70 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Environment
id: setup
run: |
# Setup Environment
$ArtifactName="qt6-windows-${{ matrix.target }}-${{ matrix.config }}-nightly"
$FileName="windows-deps-qt6-$(Get-Date -Format 'yyyy-MM-dd')-${{ matrix.target }}-${{ matrix.config }}.zip"

"artifactName=${ArtifactName}" >> $env:GITHUB_OUTPUT
"artifactFileName=${FileName}" >> $env:GITHUB_OUTPUT

- name: Build Windows Qt
uses: ./.github/actions/build-qt
with:
target: ${{ matrix.target }}
config: ${{ matrix.config }}

- name: Publish Build Artifacts
if: matrix.target == 'x64'
uses: actions/upload-artifact@v4
with:
name: ${{ steps.setup.outputs.artifactName }}
path: ${{ github.workspace }}/windows/${{ steps.setup.outputs.artifactFileName }}

windows-qt6-arm64-build:
name: Build Qt6 (Windows ARM64)
runs-on: windows-2022
needs: [windows-qt6-build]
strategy:
fail-fast: true
matrix:
config: [RelWithDebInfo, Debug]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Environment
id: setup
run: |
# Setup Environment
$HostArtifactName="qt6-windows-x64-${{ matrix.config }}-nightly"
$HostFileName="windows-deps-qt6-$(Get-Date -Format 'yyyy-MM-dd')-x64-${{ matrix.config }}.zip"

"hostArtifactName=${HostArtifactName}" >> $env:GITHUB_OUTPUT
"hostArtifactFileName=${HostFileName}" >> $env:GITHUB_OUTPUT
"qtHostPath=${env:GITHUB_WORKSPACE}/Qt6Host" >> $env:GITHUB_OUTPUT

- name: Download Host Tools Artifact
uses: actions/download-artifact@v4
with:
name: ${{ steps.setup.outputs.hostArtifactName }}
path: ${{ github.workspace }}/Qt6Host

- name: Setup Host Tools Artifact
run: |
. ${{ github.workspace }}/utils.pwsh/Expand-ArchiveExt

Set-Location ${{ github.workspace }}/Qt6Host
Expand-ArchiveExt -Path ${{ steps.setup.outputs.hostArtifactFileName }} -DestinationPath (Get-Location | Convert-Path)

- name: Build Windows Qt
uses: ./.github/actions/build-qt
env:
QtHostPath: ${{ steps.setup.outputs.qtHostPath }}
with:
target: arm64
config: ${{ matrix.config }}
6 changes: 3 additions & 3 deletions Build-Dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ param(
[ValidateSet('dependencies', 'ffmpeg', 'qt')]
[string] $PackageName = 'dependencies',
[string[]] $Dependencies,
[ValidateSet('x86', 'x64')]
[ValidateSet('arm64', 'x64', 'x86')]
[string] $Target,
[switch] $Clean,
[switch] $Quiet,
Expand Down Expand Up @@ -123,8 +123,8 @@ function Package-Dependencies {
switch ( $PackageName ) {
ffmpeg {
Get-ChildItem ./bin/* -Include '*.exe','srt-ffplay' -Exclude 'ffmpeg.exe','ffprobe.exe' | Remove-Item -Force -Recurse
Get-ChildItem ./lib -Exclude 'librist.lib','zlibstatic.lib','srt.lib','libx264.lib','mbed*.lib','zlib.lib','datachannel.lib','cmake' | Remove-Item -Force -Recurse
Get-ChildItem ./lib/cmake -Exclude 'LibDataChannel' | Remove-Item -Force -Recurse
Get-ChildItem ./lib -Exclude 'librist.lib','zlibstatic.lib','srt.lib','libx264.lib','mbed*.lib','everest.lib','p256m.lib','zlib.lib','datachannel.lib','cmake' | Remove-Item -Force -Recurse
Get-ChildItem ./lib/cmake -Exclude 'LibDataChannel','MbedTLS' | Remove-Item -Force -Recurse
Get-ChildItem ./share/* | Remove-Item -Force -Recurse
Get-ChildItem ./bin/*.lib | Move-Item -Destination ./lib
Get-ChildItem -Attribute Directory -Recurse -Include 'pkgconfig' | Remove-Item -Force -Recurse
Expand Down
2 changes: 1 addition & 1 deletion deps.ffmpeg/10-zlib.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ param(
HashSum = "2114ff9ebfc79765019353b06915a09f4dc4802ce722d2df6e640a59666dd875"
}
),
[array] $Targets = @('x64')
[array] $Targets = @('x64', 'arm64')
)

function Setup {
Expand Down
25 changes: 24 additions & 1 deletion deps.ffmpeg/20-libpng.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ param(
[string] $Version = '1.6.43',
[string] $Uri = 'https://sourceforge.net/projects/libpng/files/libpng16/1.6.43/lpng1643.zip',
[string] $Hash = "${PSScriptRoot}/checksums/lpng1643.zip.sha256",
[array] $Targets = @('x64')
[array] $Targets = @('x64', 'arm64'),
[array] $Patches = @(
@{
PatchFile = "${PSScriptRoot}/patches/libpng/0001-enable-ARM-NEON-optimisations-windows.patch"
HashSum = "6d84fe660b89a4841a67e8167172af2dcc72cef7a1f9bfec981fc84fc7421dd8"
}
)
)

function Setup {
Expand All @@ -18,6 +24,16 @@ function Clean {
}
}

function Patch {
Log-Information "Patch (${Target})"
Set-Location $Path

$Patches | ForEach-Object {
$Params = $_
Safe-Patch @Params
}
}

function Configure {
Log-Information "Configure (${Target})"
Set-Location $Path
Expand All @@ -30,6 +46,13 @@ function Configure {
"-DPNG_SHARED:BOOL=$($OnOff[$script:Shared.isPresent])"
)

if ( $Target -eq 'arm64' ) {
$Options += @(
'-DCMAKE_ASM_FLAGS="-DPNG_ARM_NEON_IMPLEMENTATION=1'
'-DPNG_ARM_NEON=on'
)
}

if ( $Configuration -eq 'Debug' ) {
$Options += '-DPNG_DEBUG:BOOL=ON'
} else {
Expand Down
2 changes: 1 addition & 1 deletion deps.ffmpeg/20-opus.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ param(
[string] $Version = '1.5.2',
[string] $Uri = 'https://github.com/xiph/opus.git',
[string] $Hash = "ddbe48383984d56acd9e1ab6a090c54ca6b735a6",
[array] $Targets = @('x64')
[array] $Targets = @('x64', 'arm64')
)

function Setup {
Expand Down
2 changes: 1 addition & 1 deletion deps.ffmpeg/30-libogg.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ param(
[string] $Version = '1.3.5',
[string] $Uri = 'https://github.com/xiph/ogg/releases/download/v1.3.5/libogg-1.3.5.zip',
[string] $Hash = "${PSScriptRoot}/checksums/libogg-1.3.5.zip.sha256",
[array] $Targets = @('x64')
[array] $Targets = @('x64', 'arm64')
)

function Setup {
Expand Down
2 changes: 1 addition & 1 deletion deps.ffmpeg/30-libvorbis.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ param(
[string] $Version = '1.3.7',
[string] $Uri = 'https://github.com/xiph/vorbis.git',
[string] $Hash = "84c023699cdf023a32fa4ded32019f194afcdad0",
[array] $Targets = @('x64')
[array] $Targets = @('x64', 'arm64')
)

function Setup {
Expand Down
6 changes: 4 additions & 2 deletions deps.ffmpeg/30-libvpx.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ param(
[string] $Version = '1.14.1',
[string] $Uri = 'https://github.com/webmproject/libvpx/archive/refs/tags/v1.14.1.zip',
[string] $Hash = "${PSScriptRoot}/checksums/v1.14.1.zip.sha256",
[array] $Targets = @('x64')
[array] $Targets = @('x64', 'arm64')
)

function Setup {
Setup-Dependency -Uri $Uri -Hash $Hash -DestinationPath .
Setup-Dependency -Uri $Uri -Hash $Hash -DestinationPath "."

if ( ! ( $SkipAll -or $SkipDeps ) ) {
Invoke-External pacman.exe -S --noconfirm --needed --noprogressbar nasm
Expand All @@ -31,6 +31,7 @@ function Configure {
$BuildTargets = @{
x64 = 'x86_64-win64-vs17'
x86 = 'x86-win32-vs17'
arm64 = 'arm64-win64-vs17-clangcl'
}

New-Item -ItemType Directory -Force "build_${Target}" > $null
Expand All @@ -41,6 +42,7 @@ function Configure {
('--prefix="' + $($script:ConfigData.OutputPath -replace '([A-Fa-f]):','/$1' -replace '\\','/') + '"')
('--target=' + $($BuildTargets[$Target]))
'--enable-runtime-cpu-detect'
RytoEX marked this conversation as resolved.
Show resolved Hide resolved
$(if ( $Target -eq 'arm64' ) { '--disable-neon_dotprod --disable-neon_i8mm' })
'--enable-vp8'
'--enable-vp9'
'--enable-vp9-highbitdepth'
Expand Down
4 changes: 2 additions & 2 deletions deps.ffmpeg/30-svt-av1.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ param(
[string] $Version = '2.2.1',
[string] $Uri = 'https://gitlab.com/AOMediaCodec/SVT-AV1.git',
[string] $Hash = '55a01def732bb9e7016d23cc512384f7a88d6e86',
[array] $Targets = @('x64'),
[array] $Patches = @(
@{
PatchFile = "${PSScriptRoot}/patches/svt-av1/0001-cpuinfo-MSVC-detection.patch"
HashSum = "27c0de86f8a8e9a3ae87f7c3cc3c8677551ffea2e62e28dcbf2b40ac5bc7a38b"
}
),
[array] $Targets = @('x64')
)
)

function Setup {
Expand Down
Loading