diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72c8bffe..7f20b675 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,7 +123,7 @@ jobs: - name: 'Run test suite build/extra/gcc/release' run: | export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)" - testsuite_1=$(readlink -en ./.github/travis_testsuite_1.sh) + testsuite_1=$(readlink -en ./misc/testsuite/upx_testsuite_1.sh) env -C build/extra/gcc/release upx_exe=./upx bash "$testsuite_1" job-macos-cmake: @@ -195,7 +195,7 @@ jobs: run: | export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)" - testsuite_1=$(readlink -en ./.github/travis_testsuite_1.sh) + testsuite_1=$(readlink -en ./misc/testsuite/upx_testsuite_1.sh) env -C build/extra/clang/release upx_exe=./upx bash "$testsuite_1" job-windows-cmake: @@ -210,21 +210,19 @@ jobs: # windows-2019 used to work but got broken with the 20220821.1 runner-image # update; we cannot download that image for inspection, and debugging the # remote image is painful, so disable for now - ####- { name: windows-2019-amd64, os: windows-2019 } - - { name: windows-2022-amd64, os: windows-2022 } + ####- { name: windows-2019-amd64, os: windows-2019, vsversion: 2019, arch: amd64 } + - { name: windows-2022-amd64, os: windows-2022, vsversion: 2022, arch: amd64 } steps: - name: 'Check out code' uses: actions/checkout@v3 with: { submodules: true } - name: 'Check out test suite' run: 'git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite' - - name: 'Inspect runner-image settings' - # debug remote image; see https://github.com/actions/runner-images.git - if: ${{ false }} - run: | - Get-Command bash; Get-Command cmake; Get-Command make - bash --version; cmake --version; make --version - Get-Command cl -ErrorAction SilentlyContinue + - name: 'Set up Developer Command Prompt' + uses: ilammy/msvc-dev-cmd@v1 + with: + vsversion: ${{ matrix.vsversion }} + arch: ${{ matrix.arch }} - name: 'Build cmake debug' run: 'make build/debug' - name: 'Build cmake release' @@ -252,7 +250,7 @@ jobs: shell: bash run: | export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)" - testsuite_1=$(readlink -en ./.github/travis_testsuite_1.sh) + testsuite_1=$(readlink -en ./misc/testsuite/upx_testsuite_1.sh) env -C build/release/Release upx_exe=./upx bash "$testsuite_1" job-windows-toolchains: @@ -261,21 +259,21 @@ jobs: name: ${{ format('windows {0}', matrix.name) }} runs-on: ${{ matrix.os }} env: - C: ${{ matrix.C }} + C: ${{ matrix.name }} B: release H: 'd:\a\upx\upx' strategy: fail-fast: false matrix: include: - - { name: amd64-win64-vs2019, vsversion: 2019, os: windows-2019, C: msvc-14.2-x64, arch: amd64 } - - { name: amd64-win64-vs2022, vsversion: 2022, os: windows-2022, C: msvc-14.3-x64, arch: amd64 } - - { name: arm64-win64-vs2019, vsversion: 2019, os: windows-2019, C: msvc-14.2-arm64, arch: amd64_arm64 } - - { name: arm64-win64-vs2022, vsversion: 2022, os: windows-2022, C: msvc-14.3-arm64, arch: amd64_arm64 } - - { name: arm64ec-win64-vs2022, vsversion: 2022, os: windows-2022, C: msvc-14.3-arm64ec, arch: amd64_arm64, cl_machine_flags: -arm64EC, link_machine_flags: '/machine:arm64ec' } - ####- { name: arm64x-win64-vs2022, vsversion: 2022, os: windows-2022, C: msvc-14.3-arm64x, arch: amd64_arm64, cl_machine_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 } + - { name: amd64-win64-vs2019, os: windows-2019, vsversion: 2019, arch: amd64 } + - { name: amd64-win64-vs2022, os: windows-2022, vsversion: 2022, arch: amd64 } + - { name: arm64-win64-vs2019, os: windows-2019, vsversion: 2019, arch: amd64_arm64 } + - { name: arm64-win64-vs2022, os: windows-2022, vsversion: 2022, arch: amd64_arm64 } + - { name: arm64ec-win64-vs2022, os: windows-2022, vsversion: 2022, arch: amd64_arm64, cl_machine_flags: -arm64EC, link_machine_flags: '/machine:arm64ec' } + # { name: arm64x-win64-vs2022, os: windows-2022, vsversion: 2022, arch: amd64_arm64, cl_machine_flags: -arm64EC, link_machine_flags: '/machine:arm64x' } + - { name: i386-win32-vs2019, os: windows-2019, vsversion: 2019, arch: amd64_x86 } + - { name: i386-win32-vs2022, os: windows-2022, vsversion: 2022, arch: amd64_x86 } steps: - name: 'Check out code' uses: actions/checkout@v3 @@ -290,8 +288,8 @@ jobs: - name: 'Set up Developer Command Prompt' uses: ilammy/msvc-dev-cmd@v1 with: - arch: ${{ matrix.arch }} vsversion: ${{ matrix.vsversion }} + arch: ${{ matrix.arch }} - name: 'Build' shell: cmd run: | @@ -361,7 +359,7 @@ jobs: shell: bash run: | export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)" - testsuite_1=$(readlink -en ./.github/travis_testsuite_1.sh) + testsuite_1=$(readlink -en ./misc/testsuite/upx_testsuite_1.sh) env -C build/$C/$B/upx upx_exe=./upx.exe bash "$testsuite_1" job-linux-zigcc: diff --git a/.github/workflows/test-cmake-default.yml b/.github/workflows/test-cmake-default.yml index 00425383..d25f2e1b 100644 --- a/.github/workflows/test-cmake-default.yml +++ b/.github/workflows/test-cmake-default.yml @@ -58,8 +58,8 @@ jobs: - name: 'Set up Developer Command Prompt' uses: ilammy/msvc-dev-cmd@v1 with: - arch: amd64 vsversion: 2022 + arch: amd64 - name: 'Config, build, test and install' run: | cmake -S . -B build/default -G "NMake Makefiles" @@ -77,8 +77,8 @@ jobs: - name: 'Set up Developer Command Prompt' uses: ilammy/msvc-dev-cmd@v1 with: - arch: amd64 vsversion: 2022 + arch: amd64 - name: 'Config, build and test' run: | cmake -S . -B build/default diff --git a/.github/workflows/weekly-ci-cmake-windows-nmake.yml b/.github/workflows/weekly-ci-cmake-windows-nmake.yml index a7bc45ba..5ef0b9d2 100644 --- a/.github/workflows/weekly-ci-cmake-windows-nmake.yml +++ b/.github/workflows/weekly-ci-cmake-windows-nmake.yml @@ -28,8 +28,8 @@ jobs: - name: 'Set up Developer Command Prompt' uses: ilammy/msvc-dev-cmd@v1 with: - arch: ${{ matrix.arch }} vsversion: ${{ matrix.vsversion }} + arch: ${{ matrix.arch }} - name: 'Build cmake NMake Debug' shell: cmd run: | diff --git a/misc/scripts/upx-clang-format b/misc/scripts/upx-clang-format.sh similarity index 100% rename from misc/scripts/upx-clang-format rename to misc/scripts/upx-clang-format.sh diff --git a/.github/travis_testsuite_1-expected_sha256sums.sh b/misc/testsuite/upx_testsuite_1-expected_sha256sums.sh similarity index 100% rename from .github/travis_testsuite_1-expected_sha256sums.sh rename to misc/testsuite/upx_testsuite_1-expected_sha256sums.sh diff --git a/.github/travis_testsuite_1.sh b/misc/testsuite/upx_testsuite_1.sh similarity index 98% rename from .github/travis_testsuite_1.sh rename to misc/testsuite/upx_testsuite_1.sh index 1a96d58a..b2c4900b 100644 --- a/.github/travis_testsuite_1.sh +++ b/misc/testsuite/upx_testsuite_1.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#! /usr/bin/env bash ## vim:set ts=4 sw=4 et: set -e; set -o pipefail argv0=$0; argv0abs=$(readlink -en -- "$0"); argv0dir=$(dirname "$argv0abs") @@ -8,6 +8,8 @@ argv0=$0; argv0abs=$(readlink -en -- "$0"); argv0dir=$(dirname "$argv0abs") # $upx_testsuite_SRCDIR # $upx_testsuite_BUILDDIR (optional) # $BM_T (optional) +# +# see https://github.com/upx/upx-testsuite.git # convenience [[ -z $upx_testsuite_BUILDDIR ]] && upx_testsuite_BUILDDIR=./tmp-upx-testsuite @@ -17,7 +19,7 @@ argv0=$0; argv0abs=$(readlink -en -- "$0"); argv0dir=$(dirname "$argv0abs") upx_testsuite_SRCDIR=$(readlink -en -- "$upx_testsuite_SRCDIR") if [[ ! -d "$upx_testsuite_SRCDIR/files/packed" ]]; then echo 'invalid or missing $upx_testsuite_SRCDIR:' - echo ' please git clone https://github.com/upx/upx-testsuite' + echo ' please git clone https://github.com/upx/upx-testsuite.git' echo ' and set (export) the envvar upx_testsuite_SRCDIR to the local file path' exit 1 fi @@ -121,7 +123,7 @@ recreate_expected_sha256sums() { echo "########## end .sha256sums.recreate" >> "$o" } -source "$argv0dir/travis_testsuite_1-expected_sha256sums.sh" || exit 1 +source "$argv0dir/upx_testsuite_1-expected_sha256sums.sh" || exit 1 # /*********************************************************************** # // init diff --git a/src/Makefile b/src/Makefile index 6ac88212..c8dc1cb4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -44,6 +44,7 @@ $(top_srcdir)/build/release/upx: PHONY # # "make run-testsuite" +# see https://github.com/upx/upx-testsuite.git # # search for the UPX testsuite -- git clone https://github.com/upx/upx-testsuite.git @@ -60,19 +61,19 @@ endif endif # run the UPX testsuite -# The expected (old) checksums are in $(top_srcdir)/.github/travis_testsuite_1-expected_sha256sums.sh +# The expected (old) checksums are in $(top_srcdir)/misc/testsuite/upx_testsuite_1-expected_sha256sums.sh # The actual (new) checksums are in ./tmp-testsuite/testsuite_1/.sha256sums.recreate ifneq ($(wildcard $(upx_testsuite_SRCDIR)/files/packed/.),) -ifneq ($(wildcard $(top_srcdir)/.github/travis_testsuite_1.sh),) +ifneq ($(wildcard $(top_srcdir)/misc/testsuite/upx_testsuite_1.sh),) run-testsuite: run-testsuite-release run-testsuite-%: export upx_testsuite_SRCDIR := $(upx_testsuite_SRCDIR) run-testsuite-%: export upx_testsuite_BUILDDIR := ./tmp-testsuite run-testsuite-debug: export upx_exe := $(top_srcdir)/build/debug/upx run-testsuite-debug: PHONY $(top_srcdir)/build/debug/upx - time -p bash $(top_srcdir)/.github/travis_testsuite_1.sh + time -p bash $(top_srcdir)/misc/testsuite/upx_testsuite_1.sh run-testsuite-release: export upx_exe := $(top_srcdir)/build/release/upx run-testsuite-release: PHONY $(top_srcdir)/build/release/upx - time -p bash $(top_srcdir)/.github/travis_testsuite_1.sh + time -p bash $(top_srcdir)/misc/testsuite/upx_testsuite_1.sh endif endif @@ -90,7 +91,7 @@ CLANG_FORMAT_FILES := $(sort $(wildcard *.[ch]* ../maint/src/*.[ch]* [cu]*/*.[ch CLANG_FORMAT_FILES := $(filter-out $(CLANG_FORMAT_EXCLUDE_FILES),$(CLANG_FORMAT_FILES)) clang-format: PHONY $(CLANG_FORMAT_FILES) @echo "running upx-clang-format" - @$(top_srcdir)/misc/scripts/upx-clang-format -i $(CLANG_FORMAT_FILES) + @$(top_srcdir)/misc/scripts/upx-clang-format.sh -i $(CLANG_FORMAT_FILES) endif #