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

ARM TESTING ZONE #10229

Draft
wants to merge 41 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a1f0cbb
WIP WIP WIP
strseb Jan 28, 2025
613a0b5
Extra symbol for condapack
strseb Jan 28, 2025
51a40cb
Do i have new toys now?
strseb Jan 29, 2025
73f9276
Update toolchain-alias and worker-type for qt-windows-aarch64-6.6
strseb Jan 29, 2025
221b31a
Update msvc_download.sh script permissions
strseb Jan 29, 2025
fe4c057
Start an updated build script for qt-windows
strseb Jan 29, 2025
28b4351
Add shebang and license header to msvc_download.sh
strseb Jan 29, 2025
9a8a82a
Update Python version in msvc_download.sh script
strseb Jan 29, 2025
f903099
Add Python script for MSVC toolchain download
strseb Jan 29, 2025
ebb6b51
Update toolchain script path for vsdownload.py
strseb Jan 29, 2025
7e6347e
Add PowerShell script to msvc bundle
strseb Jan 29, 2025
f04a712
Update conda environment setup script for Windows
strseb Jan 30, 2025
62c3dcf
Update script for compiling Qt on Windows
strseb Jan 30, 2025
275d129
Check dev env before downloading qt, i dont have *that* much time
strseb Jan 30, 2025
dc9f3f9
Add msitools to images
strseb Jan 30, 2025
ebf6047
Add conda-windows-base-x86_64 fetch to qt-windows-x86_64-6.6 and qt-w…
strseb Jan 30, 2025
3df209f
Finding the correct path?
strseb Jan 30, 2025
76c31cb
FOUND
strseb Jan 30, 2025
845f586
Update toolchain scripts for Windows ARM64 development
strseb Jan 30, 2025
dc8a8be
fix toolchain dep
strseb Jan 30, 2025
fe6e5f6
Update msvc_download.sh to use ARM64 for both host and target archite…
strseb Jan 30, 2025
c4d5aa5
Update toolchain scripts for ARM64 support
strseb Jan 30, 2025
b02cf13
retry?
strseb Jan 31, 2025
27b90d1
limit packages
strseb Feb 3, 2025
6c7dae9
give it more time
strseb Feb 3, 2025
e238b2d
Ignore the wierd package
strseb Feb 3, 2025
eb99e49
Give it more resources?
strseb Feb 3, 2025
bd8b258
Give it more resources?
strseb Feb 3, 2025
22cb0cf
is it too old ?
strseb Feb 3, 2025
fb0da02
AAAH add more echos
strseb Feb 3, 2025
88fcbdb
AAAH
strseb Feb 3, 2025
01bc8c3
Fix HOST_ARCH substitution
strseb Feb 3, 2025
bb08bde
Compile using a git clone
strseb Feb 3, 2025
0a16180
remove unused variable
strseb Feb 3, 2025
9cd3b12
Fix Cmake invocation
strseb Feb 4, 2025
20ee4e9
unity build was a dumb idea :(
strseb Feb 4, 2025
bac6377
typo
strseb Feb 4, 2025
a20fe92
HMMMM
strseb Feb 4, 2025
10cba8d
fix tpyo
strseb Feb 4, 2025
6af1066
android deploy qt is missing ://
strseb Feb 4, 2025
974ffca
Force build the thing?
strseb Feb 5, 2025
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
10 changes: 10 additions & 0 deletions taskcluster/conda/env-win-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: win-base
channels:
- conda-forge
dependencies:
- python=3.9
- pip=22.3.1
- cmake=3.26.3
- ninja=1.11.0
- conda-pack=0.8.0
- vswhere
5 changes: 5 additions & 0 deletions taskcluster/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ workers:
implementation: generic-worker
os: windows
worker-type: b-win2022
b-win11-2024h2-arm64:
provisioner: 'mozillavpn-{level}'
implementation: generic-worker
os: windows
worker-type: win11-a64-24h2-builder
b-macos:
provisioner: 'releng-hardware'
implementation: generic-worker
Expand Down
1 change: 1 addition & 0 deletions taskcluster/docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ RUN apt-get update -qq \
rpm \
libglib2.0-0 \
ccache \
msitools \
&& apt-get clean

RUN pip install --upgrade pip
Expand Down
15 changes: 15 additions & 0 deletions taskcluster/kinds/toolchain/conda_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,18 @@ windows-conda-pack:
- scripts/windows/conda-setup-xwin-sdk.ps1
toolchain-alias: conda-windows-x86_64
toolchain-artifact: public/build/conda-windows.tar.gz


windows-conda-pack-base:
fetches:
fetch:
- win-conda
treeherder:
symbol: TL(conda-base)
platform: windows/x86_64
run:
script: conda_pack_win_base.ps1
resources:
- taskcluster/conda/env-win-base.yml
toolchain-alias: conda-windows-base-x86_64
toolchain-artifact: public/build/conda-windows.tar.gz
3 changes: 2 additions & 1 deletion taskcluster/kinds/toolchain/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ task-defaults:
tier: 1

tasks-from:
- qt.yml
- conda_android.yml
- conda_windows.yml
- conda_osx.yml
- cargo.yml
- msvc.yml
- qt.yml
21 changes: 21 additions & 0 deletions taskcluster/kinds/toolchain/msvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
---
bundle-msvc:
description: "MSVC Bundle"
worker-type: b-linux-large
worker:
env:
FOO: bar # Bug: taskcluster fails if there is no env key?
max-run-time: 14400
docker-image: {in-tree: build}
treeherder:
symbol: TL(msvc)
run:
script: msvc_download.sh
resources:
- taskcluster/scripts/vsdownload.py
- taskcluster/scripts/toolchain/enter_dev_shell.ps1.in
toolchain-alias: bundle-msvc
toolchain-artifact: public/build/msvc.tar.xz
20 changes: 20 additions & 0 deletions taskcluster/kinds/toolchain/qt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,26 @@ qt-windows-x86_64-6.6:
platform: windows/x86_64
worker-type: b-win2022

qt-windows-aarch64-6.6:
description: "Windows QT compile Task"
fetches:
fetch:
- win-conda
toolchain:
- bundle-msvc
- conda-windows-base-x86_64
run:
script: compile_qt_fancy.ps1
resources:
- taskcluster/scripts/toolchain/configure_qt.ps1
toolchain-alias: qt-windows-aarch64-6.6
toolchain-artifact: public/build/qt6_win.zip
treeherder:
symbol: TL(qt-win-6.6)
platform: windows/aarch64
worker-type: b-win11-2024h2-arm64


qt-ios:
description: "QT ios bundle Task"
run:
Expand Down
32 changes: 5 additions & 27 deletions taskcluster/scripts/build/windows_clang_cl.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

$REPO_ROOT_PATH =resolve-path "$PSScriptRoot/../../../"
$TASK_WORKDIR =resolve-path "$REPO_ROOT_PATH/../../"
$FETCHES_PATH =resolve-path "$TASK_WORKDIR/fetches"
. "$PSScriptRoot/../common/helpers.ps1"


$QTPATH =resolve-path "$FETCHES_PATH/QT_OUT/"

# Prep Env:
Expand All @@ -17,33 +17,11 @@ Set-Location -Path $TASK_WORKDIR
# doesn't handle recursive submodules, so we'll need to do it ourselves.
git -C "$REPO_ROOT_PATH" submodule update --init --recursive

# Setup Openssl Import
$SSL_PATH = "$FETCHES_PATH/QT_OUT/SSL"
if (Test-Path -Path $SSL_PATH) {
$env:OPENSSL_ROOT_DIR = (resolve-path "$SSL_PATH").toString()
$env:OPENSSL_USE_STATIC_LIBS = "TRUE"
}


## Use vendored rust crates, if present
if (Test-Path -Path "$FETCHES_PATH\cargo-vendor") {
$CARGO_VENDOR_PATH = "$FETCHES_PATH/cargo-vendor" -replace @('\\', '/')
New-Item -Path "$REPO_ROOT_PATH\.cargo" -ItemType "directory" -Force
@"
[source.vendored-sources]
directory = "$CARGO_VENDOR_PATH"

[source.crates-io]
replace-with = "vendored-sources"
"@ | Out-File -Encoding utf8 $REPO_ROOT_PATH\.cargo\config.toml
}

Add-CargoVendor
## Install MiniConda
New-Item -ItemType Directory -Force -Path "$TASK_WORKDIR/miniconda"
$MINICONDA_DIR =resolve-path "$TASK_WORKDIR/miniconda"
Start-Process -NoNewWindow "$FETCHES_PATH\miniconda_installer.exe" -Wait -ArgumentList @('/S',"/D=$MINICONDA_DIR")
. $MINICONDA_DIR\shell\condabin\conda-hook.ps1

Install-MiniConda
## Unpack and activate the conda environment.
$CONDA_DIR = resolve-path "$FETCHES_PATH\conda-windows"
Start-Process -NoNewWindow "$CONDA_DIR\Scripts\conda-unpack.exe" -Wait
Expand Down
38 changes: 38 additions & 0 deletions taskcluster/scripts/common/helpers.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

$REPO_ROOT_PATH =resolve-path "$PSScriptRoot/../../../"
$TASK_WORKDIR =resolve-path "$REPO_ROOT_PATH/../../"
$FETCHES_PATH =resolve-path "$TASK_WORKDIR/fetches"


function Install-MiniConda {
if (!(Test-Path -Path "$FETCHES_PATH\miniconda_installer.exe") ) {
Write-Error "Miniconda installer was not fetched: $FETCHES_PATH\miniconda_installer.exe"
return
}
## Install MiniConda
New-Item -ItemType Directory -Force -Path "$TASK_WORKDIR/miniconda"
$MINICONDA_DIR =resolve-path "$TASK_WORKDIR/miniconda"
Start-Process -NoNewWindow "$FETCHES_PATH\miniconda_installer.exe" -Wait -ArgumentList @('/S',"/D=$MINICONDA_DIR")
. $MINICONDA_DIR\shell\condabin\conda-hook.ps1

}

function Add-CargoVendor {
if (!(Test-Path -Path "$FETCHES_PATH\cargo-vendor") ) {
Write-Output "No Cargo Vendor Fetched!"
return
}
$CARGO_VENDOR_PATH = "$FETCHES_PATH/cargo-vendor" -replace @('\\', '/')
New-Item -Path "$REPO_ROOT_PATH\.cargo" -ItemType "directory" -Force
@"
[source.vendored-sources]
directory = "$CARGO_VENDOR_PATH"

[source.crates-io]
replace-with = "vendored-sources"
"@ | Out-File -Encoding utf8 $REPO_ROOT_PATH\.cargo\config.toml
Write-Output "Added $CARGO_VENDOR_PATH as Cargo Vendor Path"
}
83 changes: 0 additions & 83 deletions taskcluster/scripts/fetch/enter_dev_shell.ps1

This file was deleted.

77 changes: 77 additions & 0 deletions taskcluster/scripts/toolchain/compile_qt_fancy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

. "$PSScriptRoot/../common/helpers.ps1"

$ErrorActionPreference = "Stop"
# Unpack Conda-Base
Install-MiniConda
ls $FETCHES_PATH
$CONDA_DIR = resolve-path "$FETCHES_PATH\"
Start-Process -NoNewWindow "$CONDA_DIR\Scripts\conda-unpack.exe" -Wait
conda activate $CONDA_DIR
conda info

# Enter the DEV Shell
. "$FETCHES_PATH/msvc/enter_dev_shell.ps1" -arch arm64
Get-ChildItem env:

# Clone QT Code
git clone --branch $env:QT_VERSION --depth 1 --single-branch git://code.qt.io/qt/qt5.git qt
Set-Location qt
git submodule init qt5compat qtactiveqt qtbase qtdeclarative qtimageformats qtlanguageserver qtnetworkauth qtrepotools qtwebsockets qtshadertools qttools qtsvg
git submodule update --depth 1 --recursive

# Note: QtTools has more submoudles!
git submodule update --init --recursive --depth 1 --shallow-submodules qttools

# Setup Output Dirs
if(!(Test-Path $REPO_ROOT_PATH/QT_OUT)){
New-Item -Path $REPO_ROOT_PATH/QT_OUT -ItemType "directory"
}
$BUILD_PREFIX = (resolve-path "$REPO_ROOT_PATH/QT_OUT").toString()

$ErrorActionPreference = "Stop"
# For newer qt versions, let's trim what we dont need.
# See for general config: https://github.com/qt/qtbase/blob/dev/config_help.txt
# For detailed feature flags, run the configuration, then check the CMakeLists.txt
# Variables with FEATURE_XYZ can be switched off using -no-feature
# Whole folders can be skipped using -skip <folder>

cmake -S . -B build `
-GNinja `
-DFEATURE_relocatable=ON `
-DQT_FEATURE_debug_and_release=ON `
-DQT_BUILD_TESTS=OFF `
-DFEATURE_developer_build=OFF `
-DBUILD_SHARED_LIBS=OFF `
-DFEATURE_assistant=OFF `
-DFEATURE_designer=OFF `
-DFEATURE_qtdiag=OFF `
-DFEARTURE_androiddeployqt=OFF `
-DFEATURE_sql=OFF

cmake --build build --parallel

# This does not get build by default but cmake --install will expect it.
cmake --build build --target androiddeployqt

cmake --install build --prefix $BUILD_PREFIX


Set-Location $REPO_ROOT_PATH
Copy-Item -Path taskcluster/scripts/toolchain/configure_qt.ps1 -Destination QT_OUT/



New-Item -ItemType Directory -Path "$TASK_WORKDIR/public/build" -Force
zip -r "$TASK_WORKDIR/public/build/qt6_win.zip" QT_OUT


Write-Output "Build complete, zip created: $TASK_WORKDIR/public/build/qt6_win.zip"

# mspdbsrv might be stil running after the build, so we need to kill it
Stop-Process -Name "mspdbsrv.exe" -Force -ErrorAction SilentlyContinue
Stop-Process -Name "mspdbsrv" -Force -ErrorAction SilentlyContinue

19 changes: 19 additions & 0 deletions taskcluster/scripts/toolchain/conda_pack_win_base.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.


# This Script will build a conda-environment containing non-compiler essentials
# needed to build (cmake, python)
# It does not ship a compiler not a Windows SDK
#

. "$PSScriptRoot/../common/helpers.ps1"

Install-MiniConda

## Conda is now ready - let's enable the env
conda env create --force -f $REPO_ROOT_PATH/taskcluster/conda/env-win-base.yml

New-Item -ItemType Directory $TASK_WORKDIR\public\build
conda run -n win-base conda-pack --name win-base -o $TASK_WORKDIR\public\build\conda-windows.tar.gz
Loading
Loading