CI: add build for windows arm64ec

This commit is contained in:
Markus F.X.J. Oberhumer
2023-02-12 19:27:56 +01:00
parent c5059231dc
commit 8d364c82e2
3 changed files with 32 additions and 23 deletions
+29 -18
View File
@@ -47,6 +47,7 @@ jobs:
if ! git diff --quiet; then git diff; exit 1; fi if ! git diff --quiet; then git diff; exit 1; fi
job-linux-cmake: job-linux-cmake:
if: ${{ true }}
needs: [ job-rebuild-and-verify-stubs ] needs: [ job-rebuild-and-verify-stubs ]
name: ${{ format('{0} cmake', matrix.os) }} name: ${{ format('{0} cmake', matrix.os) }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@@ -123,6 +124,7 @@ jobs:
env -C build/extra/gcc/release upx_exe=./upx bash "$testsuite_1" env -C build/extra/gcc/release upx_exe=./upx bash "$testsuite_1"
job-macos-cmake: job-macos-cmake:
if: ${{ true }}
needs: [ job-rebuild-and-verify-stubs ] needs: [ job-rebuild-and-verify-stubs ]
name: ${{ format('{0} cmake', matrix.os) }} name: ${{ format('{0} cmake', matrix.os) }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@@ -192,8 +194,9 @@ jobs:
env -C build/extra/clang/release upx_exe=./upx bash "$testsuite_1" env -C build/extra/clang/release upx_exe=./upx bash "$testsuite_1"
job-windows-cmake: job-windows-cmake:
if: ${{ true }}
needs: [ job-rebuild-and-verify-stubs ] needs: [ job-rebuild-and-verify-stubs ]
name: ${{ format('{0} cmake', matrix.os) }} name: ${{ format('{0} cmake', matrix.name) }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false fail-fast: false
@@ -203,8 +206,8 @@ jobs:
# update; we cannot download that image for inspection, and debugging the # update; we cannot download that image for inspection, and debugging the
# remote image is painful, so disable for now # remote image is painful, so disable for now
# see https://github.com/actions/runner-images.git # see https://github.com/actions/runner-images.git
####- { os: windows-2019 } ####- { name: windows-2019-amd64, os: windows-2019 }
- { os: windows-2022 } - { name: windows-2022-amd64, os: windows-2022 }
steps: steps:
- name: 'Check out code' - name: 'Check out code'
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -236,10 +239,12 @@ jobs:
name: ${{ env.artifact_name }} name: ${{ env.artifact_name }}
path: tmp/artifact path: tmp/artifact
- name: 'Run basic tests' - name: 'Run basic tests'
if: ${{ matrix.arch != 'amd64_arm64' }}
run: | run: |
cmake --build build/debug --config Debug --target RUN_TESTS cmake --build build/debug --config Debug --target RUN_TESTS
cmake --build build/release --config Release --target RUN_TESTS cmake --build build/release --config Release --target RUN_TESTS
- name: 'Run test suite build/release' - name: 'Run test suite build/release'
if: ${{ matrix.arch != 'amd64_arm64' }}
shell: bash shell: bash
run: | run: |
export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)" export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)"
@@ -247,6 +252,7 @@ jobs:
env -C build/release/Release upx_exe=./upx bash "$testsuite_1" env -C build/release/Release upx_exe=./upx bash "$testsuite_1"
job-windows-toolchains: job-windows-toolchains:
if: ${{ true }}
needs: [ job-rebuild-and-verify-stubs ] needs: [ job-rebuild-and-verify-stubs ]
name: ${{ format('windows {0}', matrix.name) }} name: ${{ format('windows {0}', matrix.name) }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@@ -258,12 +264,14 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- { name: amd64-win64-vs2019, os: windows-2019, C: msvc-14.2-x64, arch: amd64 } - { name: amd64-win64-vs2019, vsversion: 2019, os: windows-2019, C: msvc-14.2-x64, arch: amd64 }
- { name: amd64-win64-vs2022, os: windows-2022, C: msvc-14.3-x64, arch: amd64 } - { name: amd64-win64-vs2022, vsversion: 2022, os: windows-2022, C: msvc-14.3-x64, arch: amd64 }
- { name: arm64-win64-vs2019, os: windows-2019, C: msvc-14.2-arm64, arch: amd64_arm64 } - { name: arm64-win64-vs2019, vsversion: 2019, os: windows-2019, C: msvc-14.2-arm64, arch: amd64_arm64 }
- { name: arm64-win64-vs2022, os: windows-2022, C: msvc-14.3-arm64, arch: amd64_arm64 } - { name: arm64-win64-vs2022, vsversion: 2022, os: windows-2022, C: msvc-14.3-arm64, arch: amd64_arm64 }
- { name: i386-win32-vs2019, os: windows-2019, C: msvc-14.2-x86, arch: amd64_x86 } - { name: arm64ec-win64-vs2022, vsversion: 2022, os: windows-2022, C: msvc-14.3-arm64ec, arch: amd64_arm64, cl_extra_flags: -arm64EC, link_machine_flags: '/machine:arm64ec' }
- { name: i386-win32-vs2022, os: windows-2022, C: msvc-14.3-x86, arch: amd64_x86 } ####- { name: arm64x-win64-vs2022, vsversion: 2022, os: windows-2022, C: msvc-14.3-arm64x, arch: amd64_arm64, cl_extra_flags: -arm64EC, link_machine_flags: '/machine:arm64x' }
- { name: i386-win32-vs2019, vsversion: 2019, os: windows-2019, C: msvc-14.2-x86, arch: amd64_x86 }
- { name: i386-win32-vs2022, vsversion: 2022, os: windows-2022, C: msvc-14.3-x86, arch: amd64_x86 }
steps: steps:
- name: 'Check out code' - name: 'Check out code'
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -279,35 +287,38 @@ jobs:
uses: ilammy/msvc-dev-cmd@v1 uses: ilammy/msvc-dev-cmd@v1
with: with:
arch: ${{ matrix.arch }} arch: ${{ matrix.arch }}
vsversion: ${{ matrix.vsversion }}
- name: 'Build' - name: 'Build'
shell: cmd shell: cmd
run: | run: |
@REM setup directories @REM setup directories
where cl & where link where cl & where link
set RUN_CL=cl -MT ${{ matrix.cl_extra_flags }}
set RUN_LIB=link -lib ${{ matrix.link_machine_flags }}
set BDIR=%H%\build\%C%\%B% set BDIR=%H%\build\%C%\%B%
set DEFS=-D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS set DEFS=-D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS
git rev-parse --short=12 HEAD > %BDIR%\upx\.GITREV.txt git rev-parse --short=12 HEAD > %BDIR%\upx\.GITREV.txt
@REM ===== build UCL ===== @REM ===== build UCL =====
cd %BDIR%\ucl cd %BDIR%\ucl
set s=%H%\vendor\ucl set s=%H%\vendor\ucl
cl -MT -J -O2 -W4 -WX %DEFS% -I%s%\include -I%s% -c %s%\src\*.c %RUN_CL% -J -O2 -W4 -WX %DEFS% -I%s%\include -I%s% -c %s%\src\*.c
link -lib -out:ucl.lib *.obj %RUN_LIB% -out:ucl.lib *.obj
@REM ===== build zlib ===== @REM ===== build zlib =====
cd %BDIR%\zlib cd %BDIR%\zlib
cl -MT -J -O2 -W3 -WX %DEFS% -c %H%\vendor\zlib\*.c %RUN_CL% -J -O2 -W3 -WX %DEFS% -c %H%\vendor\zlib\*.c
link -lib -out:zlib.lib *.obj %RUN_LIB% -out:zlib.lib *.obj
@REM ===== build zstd ===== @REM ===== build zstd =====
@rem cd %BDIR%\zstd @rem cd %BDIR%\zstd
@rem set s=%H%\vendor\zstd\lib @rem set s=%H%\vendor\zstd\lib
@rem cl -MT -J -O2 -W4 -WX -DDYNAMIC_BMI2=0 -DZSTD_DISABLE_ASM %DEFS% -c %s%\common\*.c %s%\compress\*.c %s%\decompress\*.c @rem %RUN_CL% -J -O2 -W4 -WX -DDYNAMIC_BMI2=0 -DZSTD_DISABLE_ASM %DEFS% -c %s%\common\*.c %s%\compress\*.c %s%\decompress\*.c
@rem link -lib -out:zstd.lib *.obj @rem %RUN_LIB% -out:zstd.lib *.obj
@REM ===== build UPX ===== @REM ===== build UPX =====
cd %BDIR%\upx cd %BDIR%\upx
set s=%H%\src set s=%H%\src
cat .GITREV.txt cat .GITREV.txt
set /p GITREV=<.GITREV.txt set /p GITREV=<.GITREV.txt
set sources=%s%\*.cpp %s%\check\*.cpp %s%\compress\*.cpp %s%\console\*.cpp %s%\filter\*.cpp %s%\util\*.cpp set sources=%s%\*.cpp %s%\check\*.cpp %s%\compress\*.cpp %s%\console\*.cpp %s%\filter\*.cpp %s%\util\*.cpp
cl -MT -std:c++17 -Zc:__cplusplus -EHsc -J -O2 -W4 -WX -DUPX_VERSION_GITREV="""%GITREV%""" -DWITH_ZSTD=0 %DEFS% -I%H%\vendor -I%H%\vendor\boost-pfr\include -Feupx.exe %sources% %BDIR%\ucl\ucl.lib %BDIR%\zlib\zlib.lib /link setargv.obj %RUN_CL% -std:c++17 -Zc:__cplusplus -EHsc -J -O2 -W4 -WX -DUPX_VERSION_GITREV="""%GITREV%""" -DWITH_ZSTD=0 %DEFS% -I%H%\vendor -Feupx.exe %sources% %BDIR%\ucl\ucl.lib %BDIR%\zlib\zlib.lib /link ${{ matrix.link_machine_flags }} setargv.obj
- name: 'Make artifact' - name: 'Make artifact'
shell: bash shell: bash
run: | run: |
@@ -366,8 +377,8 @@ jobs:
- { zig_target: x86_64-macos.13-none } - { zig_target: x86_64-macos.13-none }
- { zig_target: x86_64-windows-gnu } - { zig_target: x86_64-windows-gnu }
env: env:
# 2023-02-10 # 2023-02-12
ZIG_DIST_VERSION: 0.11.0-dev.1593+d24ebf1d1 ZIG_DIST_VERSION: 0.11.0-dev.1605+abc9530a8
# for zig-cc wrapper scripts (see below): # for zig-cc wrapper scripts (see below):
ZIG_CPPFLAGS: -DUPX_DOCTEST_CONFIG_MULTITHREADING ZIG_CPPFLAGS: -DUPX_DOCTEST_CONFIG_MULTITHREADING
ZIG_FLAGS: ${{ matrix.zig_flags }} ZIG_FLAGS: ${{ matrix.zig_flags }}
+3 -3
View File
@@ -7,13 +7,13 @@ ENV LANG=C.UTF-8
RUN dpkg --add-architecture i386 \ RUN dpkg --add-architecture i386 \
&& apt-get update && apt-get upgrade -y \ && apt-get update && apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \ && apt-get install -y --no-install-recommends \
aria2 bash ca-certificates git less libmpc3 libncurses5 make \ aria2 bash-completion ca-certificates git less libmpc3 libncurses5 \
ncurses-term perl-base python2-minimal wget xz-utils \ make ncurses-term perl-base python2-minimal wget xz-utils \
libc6:i386 zlib1g:i386 \ libc6:i386 zlib1g:i386 \
# the following packages are not required for rebuilding the stubs, but # the following packages are not required for rebuilding the stubs, but
# they do make the image much more convenient and also allow building # they do make the image much more convenient and also allow building
# the full UPX binary inside the container via CMake: # the full UPX binary inside the container via CMake:
7zip bfs bzip2 chrpath cmake cpio curl elfutils fd-find file fzf g++ gdb gojq \ 7zip bfs bzip2 cabextract chrpath cmake cpio curl elfutils fd-find file fzf g++ gdb gojq \
ht htop hyperfine jq libzstd-dev lsb-release lz4 lzip lzop moreutils ninja-build \ ht htop hyperfine jq libzstd-dev lsb-release lz4 lzip lzop moreutils ninja-build \
p7zip patch patchelf parallel pax-utils paxctl re2c ripgrep rsync \ p7zip patch patchelf parallel pax-utils paxctl re2c ripgrep rsync \
screen universal-ctags unzip vim zip zlib1g-dev zsh zstd \ screen universal-ctags unzip vim zip zlib1g-dev zsh zstd \
-2
View File
@@ -37,8 +37,6 @@
// static const CLANG_FORMAT_DUMMY_STATEMENT // static const CLANG_FORMAT_DUMMY_STATEMENT
// #include "stub/arm64-win64.pe.h" // #include "stub/arm64-win64.pe.h"
// static const CLANG_FORMAT_DUMMY_STATEMENT
// #include "stub/arm64ce-win64.pe.h" // TODO ???
/************************************************************************* /*************************************************************************
// //