1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

CI updates

This commit is contained in:
Markus F.X.J. Oberhumer 2023-11-04 06:30:07 +01:00
parent d618716ec1
commit 11970d276d
11 changed files with 47 additions and 26 deletions

View File

@ -13,8 +13,8 @@ env:
CTEST_OUTPUT_ON_FAILURE: "ON"
DEBIAN_FRONTEND: noninteractive
UPX_CMAKE_BUILD_FLAGS: --verbose
# 2023-11-01
ZIG_DIST_VERSION: 0.12.0-dev.1369+a09ba455c
# 2023-11-03
ZIG_DIST_VERSION: 0.12.0-dev.1390+94cee4fb2
jobs:
job-rebuild-and-verify-stubs:
@ -146,8 +146,8 @@ jobs:
fail-fast: false
matrix:
include:
# NOTE: macos does not have "env -C"; only with coreutils
# NOTE: macos-11 does not have "readlink -f"; only on macos >= 12 or with coreutils
# NOTE: macos does not have "env -C"; only with brew coreutils
# NOTE: macos-11 does not have "readlink -f"; only on macos >= 12 or with brew coreutils
- { os: macos-11, gcc: gcc-10, gxx: 'g++-10', testsuite: true }
- { os: macos-12, gcc: gcc-11, gxx: 'g++-11', testsuite: true }
- { os: macos-13, gcc: gcc-12, gxx: 'g++-12', testsuite: true }
@ -278,7 +278,7 @@ jobs:
env -C build/release/Release upx_exe=./upx bash "$testsuite_1"
job-windows-toolchains: # build "by hand" using cmd.exe
if: true
if: github.repository_owner == 'upx'
needs: [ job-rebuild-and-verify-stubs ]
name: ${{ format('windows {0}', matrix.name) }}
runs-on: ${{ matrix.os }}

View File

@ -104,6 +104,7 @@ jobs:
job-by-hand-macos-clang: # uses a POSIX-compliant shell
# ...and also uses a subdirectory "upx with space" in order to detect possible quoting issues
# ...and also uses ccache as we are running the same build-script again and again
if: github.repository_owner == 'upx'
strategy:
fail-fast: false
@ -168,7 +169,7 @@ jobs:
export zlib_extra_flags="-DHAVE_VSNPRINTF"
export AR=false # link without using $AR
CC="clang $xflags" CXX="clang++ -std=gnu++17 $xflags" bash "./upx with space/misc/scripts/build_upx_by_hand.sh"
ls -l build/by-hand || true
ls -l "upx with space"/build/by-hand || true
- name: 'Build by-hand with bash - gcc'
if: success() || failure() # run this step even if the previous step failed
shell: bash
@ -176,3 +177,4 @@ jobs:
xflags="-static -Wall -Wextra -Werror"
# gcc uses the MingGW headers, so no extra settings are needed
CC="gcc $xflags" CXX="g++ -std=gnu++17 $xflags" bash "./upx with space/misc/scripts/build_upx_by_hand.sh"
ls -l "upx with space"/build/by-hand || true

View File

@ -13,6 +13,7 @@ env:
jobs:
BS0:
if: github.repository_owner == 'upx'
runs-on: ubuntu-latest
container: 'alpine:edge'
steps:

View File

@ -38,8 +38,8 @@ jobs:
- { container: 'alpine:3.16', use_cxx20: 1, use_cxx2b: 1, use_lto: 1 } # May 2022: C++2b; clang-13 & gcc-11
- { container: 'alpine:3.17', use_cxx20: 1, use_cxx2b: 1, use_lto: 1 }
- { container: 'alpine:3.18', use_cxx20: 1, use_cxx2b: 1, use_lto: 1 }
- { container: 'alpine:edge', use_cxx20: 1, use_cxx2b: 1, use_lto: 1 }
- { container: 'i386/alpine:edge', use_cxx20: 1, use_cxx2b: 1, use_lto: 1 }
- { container: 'alpine:edge', use_cxx20: 1, use_cxx23: 1, use_lto: 1 }
- { container: 'i386/alpine:edge', use_cxx20: 1, use_cxx23: 1, use_lto: 1 }
# more 32-bit i386 versions, just for testing
# { container: 'i386/alpine:3.9' } # clang-5, gcc-8; BROKEN: clang -m32 problem
- { container: 'i386/alpine:3.10' } # clang-8, gcc-8
@ -185,6 +185,7 @@ jobs:
for dir in "upx with space"/build/xtarget/*-cxx*/*; do
echo "===== $dir"
make -C "$dir" test
(cd "$dir" && ./upx --sysinfo -v)
done
- name: 'Run file system test suite (busybox)'

View File

@ -55,16 +55,19 @@ jobs:
CC="$CC -D_WIN32_WINNT=0x0400"; CXX="$CXX -D_WIN32_WINNT=0x0400"
make UPX_XTARGET=aarch64-w64-mingw32-clang xtarget/debug xtarget/release
- name: 'Build clang armv7'
if: success() || failure() # run this step even if the previous step failed
run: |
export CC="armv7-w64-mingw32-clang -static" CXX="armv7-w64-mingw32-clang++ -static"
CC="$CC -D_WIN32_WINNT=0x0400"; CXX="$CXX -D_WIN32_WINNT=0x0400"
make UPX_XTARGET=armv7-w64-mingw32-clang xtarget/debug xtarget/release
- name: 'Build clang i686'
if: success() || failure() # run this step even if the previous step failed
run: |
export CC="i686-w64-mingw32-clang -static" CXX="i686-w64-mingw32-clang++ -static"
CC="$CC -D_WIN32_WINNT=0x0400"; CXX="$CXX -D_WIN32_WINNT=0x0400"
make UPX_XTARGET=i686-w64-mingw32-clang xtarget/debug xtarget/release
- name: 'Build clang x86_64'
if: success() || failure() # run this step even if the previous step failed
run: |
export CC="x86_64-w64-mingw32-clang -static" CXX="x86_64-w64-mingw32-clang++ -static"
CC="$CC -D_WIN32_WINNT=0x0400"; CXX="$CXX -D_WIN32_WINNT=0x0400"

View File

@ -11,8 +11,8 @@ env:
CMAKE_REQUIRED_QUIET: "OFF"
CTEST_OUTPUT_ON_FAILURE: "ON"
DEBIAN_FRONTEND: noninteractive
# 2023-11-01
ZIG_DIST_VERSION: 0.12.0-dev.1369+a09ba455c
# 2023-11-03
ZIG_DIST_VERSION: 0.12.0-dev.1390+94cee4fb2
jobs:
job-linux-zigcc: # uses cmake + make

View File

@ -524,7 +524,7 @@ include(CTest)
if(NOT CMAKE_CROSSCOMPILING)
add_test(NAME upx-version COMMAND upx --version)
add_test(NAME upx-help COMMAND upx --help)
add_test(NAME upx-sysinfo COMMAND upx --sysinfo)
add_test(NAME upx-sysinfo COMMAND upx --sysinfo -v)
endif()
if(NOT CMAKE_CROSSCOMPILING AND NOT UPX_CONFIG_DISABLE_SELF_PACK_TEST)
# IMPORTANT NOTE: these tests can only work if the host executable format is supported by UPX!

View File

@ -3,20 +3,21 @@
set -e; set -o pipefail
# "Gofmt's style is nobody's favourite, but gofmt is everybody's favourite." --Rob Pike
#
# NOTE: we are using clang-format-15.0.6 from upx-stubtools
# see https://github.com/upx/upx-stubtools/releases
#
# NOTE: we use .clang-format config from upx.git/.clang-format
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
if [[ ! -f $UPX_CLANG_FORMAT ]]; then
UPX_CLANG_FORMAT="$HOME/local/bin/bin-upx/clang-format-15.0.6"
UPX_CLANG_FORMAT="$HOME/local/bin/bin-upx/clang-format-15.0.6"
fi
if [[ ! -f $UPX_CLANG_FORMAT ]]; then
UPX_CLANG_FORMAT="$HOME/.local/bin/bin-upx/clang-format-15.0.6"
UPX_CLANG_FORMAT="$HOME/.local/bin/bin-upx/clang-format-15.0.6"
fi
if [[ ! -f $UPX_CLANG_FORMAT ]]; then
UPX_CLANG_FORMAT="$HOME/bin/bin-upx/clang-format-15.0.6"
UPX_CLANG_FORMAT="$HOME/bin/bin-upx/clang-format-15.0.6"
fi
if [[ ! -f $UPX_CLANG_FORMAT ]]; then
echo "ERROR: $0: cannot find clang-format-15.0.6"
@ -29,4 +30,4 @@ ulimit -v 1048576 || true
#echo $UPX_CLANG_FORMAT
exec "$UPX_CLANG_FORMAT" -style=file "$@"
exit 1
exit 99

View File

@ -3,16 +3,25 @@
set -e; set -o pipefail
argv0=$0; argv0abs=$(readlink -fn "$argv0"); argv0dir=$(dirname "$argv0abs")
#
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
# test file system behaviour with symlinks; requires:
# $upx_exe (required, but with convenience fallback "./upx")
# optional settings:
# $upx_exe_runner (e.g. "qemu-x86_64 -cpu Westmere" or "valgrind")
#
# IMPORTANT NOTE: do NOT run as user root!!
# IMPORTANT NOTE: this script only works on Unix!!
umask 0022
# disable on macOS for now, see https://github.com/upx/upx/issues/612
if [[ "$(uname)" == Darwin ]]; then
echo "$0: SKIPPED"
exit 0
fi
# IMPORTANT NOTE: do NOT run as user root!!
# IMPORTANT NOTE: this script only works on Unix!!
umask 0022
id || true
echo "PWD='$PWD'"
if [[ $UID == 0 || $EUID == 0 ]]; then
@ -20,11 +29,6 @@ if [[ $UID == 0 || $EUID == 0 ]]; then
exit 91
fi
# test file system behaviour with symlinks; requires:
# $upx_exe (required, but with convenience fallback "./upx")
# optional settings:
# $upx_exe_runner (e.g. "qemu-x86_64 -cpu Westmere" or "valgrind")
#***********************************************************************
# init & checks
#***********************************************************************

View File

@ -3,6 +3,9 @@
set -e; set -o pipefail
argv0=$0; argv0abs=$(readlink -fn "$argv0"); argv0dir=$(dirname "$argv0abs")
#
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
# very first version of the upx-testsuite; requires:
# $upx_exe (required, but with convenience fallback "./upx")
# $upx_testsuite_SRCDIR (required, but with convenience fallback)
@ -14,6 +17,7 @@ argv0=$0; argv0abs=$(readlink -fn "$argv0"); argv0dir=$(dirname "$argv0abs")
# $UPX_TESTSUITE_LEVEL
#
# see https://github.com/upx/upx-testsuite.git
#
#***********************************************************************
# init & checks

View File

@ -467,6 +467,11 @@ void show_sysinfo(const char *options_var) {
con_fprintf(f, fmt, v);
con_fprintf(f, "\n");
};
// language
cf_print("__cplusplus", "%lld", __cplusplus + 0, 3);
#if defined(_MSVC_LANG)
cf_print("_MSVC_LANG", "%lld", _MSVC_LANG + 0, 3);
#endif
// compiler
#if defined(ACC_CC_CLANG)
cf_print("ACC_CC_CLANG", "0x%06llx", ACC_CC_CLANG + 0, 3);