From 6a56291a2a7dc5ea1443f29f3715c7491152f034 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Tue, 4 Dec 2018 20:12:20 +0000 Subject: [PATCH] Add a test run of MSVC ARM64 cross on Windows x64 Add a cross-file for MSVC UWP ARM64. Bump cidata tag to get an updated install.ps1 script (run by run.ps1) which sets the vcvars environment correctly when cross-compiling. Since arranging the correct environment for simultaneous cross and native 'cl' use is hard, this is test run uses '--cross-only' so we don't require a native compiler. Extend '--cross-only' so it also explicitly uses a machine file which makes all build machine compilers unusable. --- azure-pipelines.yml | 5 +++++ ci/run.ps1 | 8 ++++---- cross/arm64cl.txt | 17 +++++++++++++++++ cross/none.txt | 18 ++++++++++++++++++ run_cross_test.py | 9 ++++++++- 5 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 cross/arm64cl.txt create mode 100644 cross/none.txt diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1ff542a02..e4fe8b685 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -56,6 +56,11 @@ jobs: arch: x64 compiler: msvc2019 backend: vs2019 + vc2019arm64ninjacross: + arch: arm64 + compiler: msvc2019 + backend: ninja + extraargs: --cross arm64cl.txt --cross-only steps: - task: UsePythonVersion@0 diff --git a/ci/run.ps1 b/ci/run.ps1 index 5065b8749..424af72e7 100644 --- a/ci/run.ps1 +++ b/ci/run.ps1 @@ -34,10 +34,10 @@ function DownloadFile([String] $Source, [String] $Destination) { } -if ($env:backend -eq 'ninja') { $dmd = $true } else { $dmd = $false } +if (($env:backend -eq 'ninja') -and ($env:arch -ne 'arm64')) { $dmd = $true } else { $dmd = $false } -DownloadFile -Source https://github.com/mesonbuild/cidata/releases/download/ci2/ci_data.zip -Destination $env:AGENT_WORKFOLDER\ci_data.zip -echo "Extracting ci_data.zip" +DownloadFile -Source https://github.com/mesonbuild/cidata/releases/download/ci3/ci_data.zip -Destination $env:AGENT_WORKFOLDER\ci_data.zip +echo "Extracting ci_data.zip" Expand-Archive $env:AGENT_WORKFOLDER\ci_data.zip -DestinationPath $env:AGENT_WORKFOLDER\ci_data & "$env:AGENT_WORKFOLDER\ci_data\install.ps1" -Arch $env:arch -Compiler $env:compiler -Boost $true -DMD $dmd @@ -75,4 +75,4 @@ echo "=== Start running tests ===" # Starting from VS2019 Powershell(?) will fail the test run # if it prints anything to stderr. Python's test runner # does that by default so we need to forward it. -cmd /c 'python 2>&1' run_tests.py --backend $env:backend +cmd /c "python 2>&1 run_tests.py --backend $env:backend $env:extraargs" diff --git a/cross/arm64cl.txt b/cross/arm64cl.txt new file mode 100644 index 000000000..2d7bf2dc1 --- /dev/null +++ b/cross/arm64cl.txt @@ -0,0 +1,17 @@ +[binaries] +c = 'cl' +cpp = 'cl' +ar = 'lib' +windres = 'rc' + +[properties] +c_args = ['-DWINAPI_FAMILY=WINAPI_FAMILY_APP'] +c_link_args = ['-APPCONTAINER', 'WindowsApp.lib'] +cpp_args = ['-DWINAPI_FAMILY=WINAPI_FAMILY_APP'] +cpp_link_args = ['-APPCONTAINER', 'WindowsApp.lib'] + +[host_machine] +system = 'windows' +cpu_family = 'aarch64' +cpu = 'armv8' +endian = 'little' diff --git a/cross/none.txt b/cross/none.txt new file mode 100644 index 000000000..8727e27f4 --- /dev/null +++ b/cross/none.txt @@ -0,0 +1,18 @@ +# native file used to make the build machine compiler unusable + +[host_machine] +system = 'none' +cpu_family = 'none' +cpu = 'none' +endian = 'little' + +[properties] + +[binaries] +c = ['false'] +cpp = ['false'] +objc = ['false'] +objcpp = ['false'] +ar = ['false'] +pkgconfig = ['false'] +cmake = ['false'] diff --git a/run_cross_test.py b/run_cross_test.py index 70db66721..6cba3244f 100755 --- a/run_cross_test.py +++ b/run_cross_test.py @@ -29,7 +29,14 @@ def runtests(cross_file, failfast, cross_only): tests = ['--only', 'common'] if not cross_only: tests.append('native') - cmd = mesonlib.python_command + ['run_project_tests.py', '--backend', 'ninja'] + (['--failfast'] if failfast else []) + tests + ['--cross-file', cross_file] + cmd = mesonlib.python_command + ['run_project_tests.py', '--backend', 'ninja'] + if failfast: + cmd += ['--failfast'] + cmd += tests + cmd += ['--cross-file', cross_file] + cmd += ['--'] # args following this are passed directly to meson + if cross_only: + cmd += ['--native-file', 'cross/none.txt'] return subprocess.call(cmd) def main():