diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 36dfbdd0..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: 2 -updates: - - package-ecosystem: 'github-actions' - directory: '/' - schedule: - # Check for updates to GitHub Actions every Wednesday - interval: 'weekly' - day: 'wednesday' diff --git a/.github/typos_config.toml b/.github/typos_config.toml deleted file mode 100644 index b61ab10e..00000000 --- a/.github/typos_config.toml +++ /dev/null @@ -1,43 +0,0 @@ -# see https://github.com/crate-ci/typos - -# a generic spell-checker that works on source code is quite -# tricky, so some false positives are fine - -[files] -extend-exclude = ["LICENSE", "misc/*podman*/*/packages.txt"] - -# misc variable names & symbols -[default.extend-identifiers] -acc_spawnve = "acc_spawnve" -ba = "ba" -fo = "fo" -fof = "fof" -O_WRONLY = "O_WRONLY" -# optin: clang-analyzer-optin.cplusplus -optin = "optin" -sidelen = "sidelen" -# macOS 11 "Big Sur" -Sur = "Sur" -tpos = "tpos" -# assembly sources -hda = "hda" -Larg = "Larg" -pard = "pard" -suble = "suble" - -# identifiers are intelligently split into words and then checked again -[default.extend-words] -delt = "delt" -FO = "FO" -fo = "fo" -# parm is used like param -PARM = "PARM" -parm = "parm" -# rela: ELF relocations -RELA = "RELA" -rela = "rela" -# siz is used for size -siz = "siz" -# SEH: Structured Exception Handling -SEH = "SEH" -seh = "seh" diff --git a/.github/workflows/github-close-inactive-issues.yml b/.github/workflows/github-close-inactive-issues.yml deleted file mode 100644 index fc8312b7..00000000 --- a/.github/workflows/github-close-inactive-issues.yml +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer - -# see https://docs.github.com/en/actions/managing-issues-and-pull-requests/closing-inactive-issues -# see https://github.com/actions/stale - -# Automatically closing issues is far from perfect, but then we only -# have limited resources and this approach favors issues that people -# actually care about. -# -# also see: -# "Should I Stale or Should I Close? An Analysis of a Bot that Closes -# Abandoned Issues and Pull Request". -# https://igorwiese.com/images/papers/Paper_BotSE_19.pdf - -name: 'GitHub - Close inactive issues' -on: - schedule: [cron: '50 0 * * 3'] # run weekly Wednesday 00:50 UTC - workflow_dispatch: -jobs: - job-close-inactive-issues: - if: github.repository_owner == 'upx' && github.repository == 'upx/upx' - name: 'Close inactive issues' - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - steps: - - uses: actions/stale@v9 - with: - operations-per-run: 300 - exempt-all-milestones: true - exempt-issue-labels: 'blocker,bug,enhancement,help wanted,regression' - days-before-stale: 60 - days-before-close: 30 - stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Please remove the stale label or add a comment or this issue will be closed in 30 days.' - stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Please remove the stale label or add a comment or this PR will be closed in 30 days.' - close-issue-message: 'This issue was closed because it has been stalled for 30 days with no activity. Please feel free to reopen.' - close-pr-message: 'This PR was closed because it has been stalled for 30 days with no activity. Please feel free to reopen.' - repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/github-close-pull-requests.yml b/.github/workflows/github-close-pull-requests.yml deleted file mode 100644 index bc0a979a..00000000 --- a/.github/workflows/github-close-pull-requests.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer -name: 'GitHub - Close pull requests' -on: - #pull_request: - workflow_dispatch: -jobs: - job-close-pull-requests: - if: github.repository_owner == 'upx' && github.repository == 'upx/upx' - name: 'Close pull requests' - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - name: 'Close pull requests' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh pr list --repo='${{ github.repository }}' --state=open --json=number | jq '.[].number' | xargs -r -n1 -- gh pr close --repo='${{ github.repository }}' diff --git a/.github/workflows/misc-spell-check.yml b/.github/workflows/misc-spell-check.yml deleted file mode 100644 index ec8040f2..00000000 --- a/.github/workflows/misc-spell-check.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer -# see https://github.com/crate-ci/typos - -name: 'Misc - Spell check' -on: - schedule: [cron: '55 0 * * 3'] # run weekly Wednesday 00:55 UTC - workflow_dispatch: -env: - DEBIAN_FRONTEND: noninteractive -jobs: - job-spell-check: - if: github.repository_owner == 'upx' - name: 'Spell check' - runs-on: ubuntu-latest - steps: - - name: 'Check out code' - uses: actions/checkout@v4 - with: { submodules: false } - - name: 'Spell check with crate-ci/typos' - uses: crate-ci/typos@master - with: { config: ./.github/typos_config.toml } diff --git a/.github/workflows/static-analyzer-clang-analyzer.yml b/.github/workflows/static-analyzer-clang-analyzer.yml deleted file mode 100644 index f1406b22..00000000 --- a/.github/workflows/static-analyzer-clang-analyzer.yml +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer - -name: 'Static Analyzer - clang-analyzer' -on: - schedule: [cron: '10 4 * * 3'] # run weekly Wednesday 04:10 UTC - workflow_dispatch: -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - -jobs: - job-analyze-clang-analyzer: # uses cmake + make - if: github.repository_owner == 'upx' - strategy: - fail-fast: false - matrix: - include: - - container: 'alpine:3.16' - - container: 'alpine:3.17' - - container: 'alpine:3.18' - - container: 'alpine:3.19' - - container: 'alpine:edge' - - container: 'i386/alpine:3.18' - - container: 'i386/alpine:3.19' - - container: 'i386/alpine:edge' - name: ${{ format('Analyze clang-analyzer {0}', matrix.container) }} - runs-on: ubuntu-latest - container: ${{ matrix.container }} - steps: - - name: ${{ format('Install packages {0}', matrix.container) }} - run: 'apk update && apk upgrade && apk add clang clang-analyzer cmake g++ git make' - - name: ${{ format('Check out UPX {0} source code', github.ref_name) }} - run: | - # this seems to be needed when running in a container (beause of UID mismatch??) - git config --global --add safe.directory '*' - git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" . - git submodule update --init - - name: 'Perform clang-analyzer scan-build Analysis Debug' - run: 'make build/analyze/clang-analyzer/debug' - - name: 'Perform clang-analyzer scan-build Analysis Release' - if: success() || failure() # run this step even if the previous step failed - run: 'make build/analyze/clang-analyzer/release' diff --git a/.github/workflows/static-analyzer-clang-tidy.yml b/.github/workflows/static-analyzer-clang-tidy.yml deleted file mode 100644 index 7c9c437a..00000000 --- a/.github/workflows/static-analyzer-clang-tidy.yml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer - -name: 'Static Analyzer - clang-tidy' -on: - schedule: [cron: '30 4 * * 3'] # run weekly Wednesday 04:30 UTC - workflow_dispatch: -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - -jobs: - job-analyze-clang-tidy: # uses cmake + make - if: github.repository_owner == 'upx' - strategy: - fail-fast: false - matrix: - include: - - container: 'alpine:3.18' - - container: 'alpine:3.19' - - container: 'alpine:edge' - - container: 'i386/alpine:3.18' - - container: 'i386/alpine:3.19' - - container: 'i386/alpine:edge' - name: ${{ format('Analyze clang-tidy {0}', matrix.container) }} - runs-on: ubuntu-latest - container: ${{ matrix.container }} - steps: - - name: ${{ format('Install packages {0}', matrix.container) }} - run: 'apk update && apk upgrade && apk add clang clang-extra-tools cmake g++ git make python3' - - name: ${{ format('Check out UPX {0} source code', github.ref_name) }} - run: | - # this seems to be needed when running in a container (beause of UID mismatch??) - git config --global --add safe.directory '*' - git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" . - git submodule update --init - - name: 'Perform clang-tidy Analysis Debug' - run: 'make -k build/analyze/clang-tidy/debug' - - name: 'Perform clang-tidy Analysis Release' - if: success() || failure() # run this step even if the previous step failed - run: 'make -k build/analyze/clang-tidy/release' diff --git a/.github/workflows/static-analyzer-codeql.yml b/.github/workflows/static-analyzer-codeql.yml deleted file mode 100644 index cb888e72..00000000 --- a/.github/workflows/static-analyzer-codeql.yml +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer - -name: 'Static Analyzer - CodeQL' -on: - schedule: [cron: '50 4 * * 3'] # run weekly Wednesday 04:50 UTC - workflow_dispatch: -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - -jobs: - job-analyze-codeql: - if: github.repository_owner == 'upx' - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - strategy: - fail-fast: false - matrix: - language: [ 'cpp' ] - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: { submodules: true } - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - - name: Autobuild - uses: github/codeql-action/autobuild@v3 - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/test-cmake-default.yml b/.github/workflows/test-cmake-default.yml deleted file mode 100644 index c62d5762..00000000 --- a/.github/workflows/test-cmake-default.yml +++ /dev/null @@ -1,136 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer - -name: 'Test - CMake default build type' -on: [workflow_dispatch] -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - -jobs: - -# -# single-config generators - these use and respect CMAKE_BUILD_TYPE -# - - cmake-make: - runs-on: ubuntu-latest - steps: - - name: 'Check out code' - uses: actions/checkout@v4 - with: { submodules: true } - - name: 'Config, build, test and install' - run: | - cmake -S . -B build/default -G "Unix Makefiles" - cmake --build build/default --parallel --verbose - ctest --test-dir build/default - (cd build/default && DESTDIR=$PWD/Install-default cmake --install .) - # "make test" also works - env -C build/default make test - # "make install" also works - env -C build/default DESTDIR=./Install-with-make make install - - cmake-ninja: - runs-on: ubuntu-latest - steps: - - name: 'Check out code' - uses: actions/checkout@v4 - with: { submodules: true } - - name: 'Config, build, test and install' - run: | - test -f /usr/bin/ninja || sudo apt-get install -y ninja-build - cmake -S . -B build/default -G Ninja - cmake --build build/default --parallel --verbose - ctest --test-dir build/default - (cd build/default && DESTDIR=$PWD/Install-default cmake --install .) - # "ninja test" also works - env -C build/default ninja test - # "ninja install" also works - env -C build/default DESTDIR=./Install-with-ninja ninja install - - cmake-nmake: - runs-on: windows-2022 - steps: - - run: git config --global core.autocrlf false - - name: 'Check out code' - uses: actions/checkout@v4 - with: { submodules: true } - - name: 'Set up Developer Command Prompt' - uses: ilammy/msvc-dev-cmd@v1 - with: - vsversion: 2022 - arch: amd64 - - name: 'Config, build, test and install' - run: | - cmake -S . -B build/default -G "NMake Makefiles" - cmake --build build/default --parallel --verbose - ctest --test-dir build/default - # "cmake --install" works on Windows as well, nice - env -C build/default DESTDIR=./Install-default cmake --install . - # "nmake test" also works - env -C build/default nmake test - # "nmake install" also works - env -C build/default DESTDIR=./Install-with-nmake nmake install - -# -# multi-config generators - these use CMAKE_CONFIGURATION_TYPES, but the defaults seem inconsistent -# => when using multi-config generators always explicitly pass the requested build-config -# - - # ninja-multi-config seems to use the *first* element of CMAKE_CONFIGURATION_TYPES; nice - cmake-ninja-multi-config: - runs-on: ubuntu-latest - steps: - - name: 'Check out code' - uses: actions/checkout@v4 - with: { submodules: true } - - name: 'Config, build, test and install' - run: | - test -f /usr/bin/ninja || sudo apt-get install -y ninja-build - cmake -S . -B build/default -G "Ninja Multi-Config" - cmake --build build/default --parallel --verbose - # multi-config: ctest NEEDS a config - ctest --test-dir build/default -C Release - (cd build/default && DESTDIR=$PWD/Install-default cmake --install .) - # "ninja test" also works with multi-config - env -C build/default ninja test - # "ninja install" also works with multi-config - env -C build/default DESTDIR=./Install-with-ninja ninja install - - # vsstudio-multi-config (msbuild) seems to use "Debug" by default - cmake-vsstudio-multi-config: - runs-on: windows-2022 - steps: - - run: git config --global core.autocrlf false - - name: 'Check out code' - uses: actions/checkout@v4 - with: { submodules: true } - - name: 'Set up Developer Command Prompt' - uses: ilammy/msvc-dev-cmd@v1 - with: - vsversion: 2022 - arch: amd64 - - name: 'Config, build and test' - run: | - cmake -S . -B build/default - cmake --build build/default --parallel --verbose - # multi-config: ctest NEEDS a config - ctest --test-dir build/default -C Debug - # TODO: does cmake --install work? - - # xcode-multi-config (xcodebuild) seems to use "Debug" by default, except for "cmake --install" (BUG?) - cmake-xcode-multi-config: - runs-on: macos-12 - steps: - - name: 'Check out code' - uses: actions/checkout@v4 - with: { submodules: true } - - name: 'Config, build, test and install' - run: | - cmake -S . -B build/default -G Xcode - cmake --build build/default --parallel --verbose - # multi-config: ctest NEEDS a config - ctest --test-dir build/default -C Debug - # BUG(?) multi-config: cmake --install defaults to "Release" !! - (cd build/default && DESTDIR=$PWD/Install-default cmake --install . --config Debug) diff --git a/.github/workflows/test-minimal-alpinelinux.yml b/.github/workflows/test-minimal-alpinelinux.yml deleted file mode 100644 index 40a233dc..00000000 --- a/.github/workflows/test-minimal-alpinelinux.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer -# test minimal number of packages required for building UPX under Alpine Linux -# clang: apk add clang cmake make -# gcc: apk add cmake g++ make - -name: 'Test - Minimal Alpine build' -on: [workflow_dispatch] -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - -jobs: - job-alpinelinux-clang-static: # uses cmake + make - if: true - strategy: { matrix: { container: ['alpine:edge','i386/alpine:edge'] } } - name: ${{ format('clang-static {0}', matrix.container) }} - runs-on: ubuntu-latest - container: ${{ matrix.container }} - steps: - - name: ${{ format('Build clang {0}', matrix.container) }} - run: | - apk update && apk upgrade && apk add clang cmake make - wget https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-src.tar.xz - tar -xoaf upx-*-src.tar.xz - cd upx-*-src - make build/debug CC="clang -static" CXX="clang++ -static" - make build/release CC="clang -static" CXX="clang++ -static" - make -C build/debug test - make -C build/release test - make -C build/release install DESTDIR="$PWD/Install" - N=$(echo "upx-test-minimal-alpinelinux-clang-static-${{ matrix.container }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') - echo "artifact_name=$N" >> $GITHUB_ENV - - name: ${{ format('Upload artifact {0}', env.artifact_name) }} - if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: missing nodejs on host - uses: actions/upload-artifact@v4 - with: - name: ${{ env.artifact_name }} - path: 'upx*/build/*/upx' - - job-alpinelinux-gcc-static: # uses cmake + make - if: true - strategy: { matrix: { container: ['alpine:edge','i386/alpine:edge'] } } - name: ${{ format('gcc-static {0}', matrix.container) }} - runs-on: ubuntu-latest - container: ${{ matrix.container }} - steps: - - name: ${{ format('Build gcc {0}', matrix.container) }} - run: | - apk update && apk upgrade && apk add cmake g++ make - wget https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-src.tar.xz - tar -xoaf upx-*-src.tar.xz - cd upx-*-src - make build/debug CC="gcc -static" CXX="g++ -static" - make build/release CC="gcc -static" CXX="g++ -static" - make -C build/debug test - make -C build/release test - make -C build/release install DESTDIR="$PWD/Install" - N=$(echo "upx-test-minimal-alpinelinux-gcc-static-${{ matrix.container }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') - echo "artifact_name=$N" >> $GITHUB_ENV - - name: ${{ format('Upload artifact {0}', env.artifact_name) }} - if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: missing nodejs on host - uses: actions/upload-artifact@v4 - with: - name: ${{ env.artifact_name }} - path: 'upx*/build/*/upx' diff --git a/.github/workflows/test-minimal-chimeralinux.yml b/.github/workflows/test-minimal-chimeralinux.yml deleted file mode 100644 index bb76cd1f..00000000 --- a/.github/workflows/test-minimal-chimeralinux.yml +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer -# test minimal number of packages required for building UPX under Chimera Linux -# clang: apk add bsdtar clang cmake curl gmake -# - -name: 'Test - Minimal Chimera build' -on: [workflow_dispatch] -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - -jobs: - job-chimeralinux-clang: # uses cmake + make - if: true - strategy: { matrix: { container: ['chimeralinux/chimera:latest'] } } - name: ${{ format('clang {0}', matrix.container) }} - runs-on: ubuntu-latest - container: ${{ matrix.container }} - steps: - - name: ${{ format('Build clang {0}', matrix.container) }} - run: | - apk update && apk upgrade && apk add bsdtar clang cmake curl gmake - for p in make; do ln -s -v ../../bin/g$p /usr/local/bin/$p; done - curl -OL https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-src.tar.xz - tar -xoaf upx-*-src.tar.xz - cd upx-*-src - make build/debug CC="clang" CXX="clang++" - make build/release CC="clang" CXX="clang++" - make -C build/debug test - make -C build/release test - make -C build/release install DESTDIR="$PWD/Install" - N=$(echo "upx-test-minimal-chimeralinux-clang-${{ matrix.container }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') - echo "artifact_name=$N" >> $GITHUB_ENV - - name: ${{ format('Upload artifact {0}', env.artifact_name) }} - if: false # missing nodejs on host - uses: actions/upload-artifact@v4 - with: - name: ${{ env.artifact_name }} - path: 'upx*/build/*/upx' - - job-chimeralinux-clang-static: # uses cmake + make - if: true - strategy: { matrix: { container: ['chimeralinux/chimera:latest'] } } - name: ${{ format('clang-static {0}', matrix.container) }} - runs-on: ubuntu-latest - container: ${{ matrix.container }} - steps: - - name: ${{ format('Build clang {0}', matrix.container) }} - run: | - apk update && apk upgrade && apk add bsdtar clang cmake curl gmake - for p in make; do ln -s -v ../../bin/g$p /usr/local/bin/$p; done - # install devel-static packages - apk add libatomic-chimera-devel-static libcxx-devel-static musl-devel-static - curl -OL https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-src.tar.xz - tar -xoaf upx-*-src.tar.xz - cd upx-*-src - make build/debug CC="clang -static" CXX="clang++ -static" - make build/release CC="clang -static" CXX="clang++ -static" - make -C build/debug test - make -C build/release test - make -C build/release install DESTDIR="$PWD/Install" - N=$(echo "upx-test-minimal-chimeralinux-clang-static-${{ matrix.container }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') - echo "artifact_name=$N" >> $GITHUB_ENV - - name: ${{ format('Upload artifact {0}', env.artifact_name) }} - if: false # missing nodejs on host - uses: actions/upload-artifact@v4 - with: - name: ${{ env.artifact_name }} - path: 'upx*/build/*/upx' diff --git a/.github/workflows/test-unused.yml b/.github/workflows/test-unused.yml deleted file mode 100644 index 2a618239..00000000 --- a/.github/workflows/test-unused.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer - -name: 'Test - Unused' -on: [workflow_dispatch] -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - -jobs: - job-unused: # uses cmake + make - if: true - runs-on: ubuntu-latest - steps: - - run: | - true diff --git a/.github/workflows/test-yaml-check.yml b/.github/workflows/test-yaml-check.yml deleted file mode 100644 index a0914304..00000000 --- a/.github/workflows/test-yaml-check.yml +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer - -name: 'Test - YAML check' -on: [workflow_dispatch] -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - -jobs: - job-yaml-check: - if: true - strategy: - fail-fast: false - matrix: - include: - - container: 'alpine:3.16' - - container: 'alpine:3.17' - - container: 'alpine:3.18' - - container: 'alpine:3.19' - - container: 'alpine:edge' - name: ${{ format('{0}', matrix.container) }} - runs-on: ubuntu-latest - container: ${{ matrix.container }} - steps: - - name: ${{ format('Install packages {0}', matrix.container) }} - run: | - apk update && apk upgrade && apk add bash git yq - case ${{ matrix.container }} in - *:edge) apk add -X http://dl-cdn.alpinelinux.org/alpine/edge/testing ytt ;; - esac - # this seems to be needed when running in a container (beause of UID mismatch??) - git config --global --add safe.directory '*' - - name: 'Check out code' - uses: actions/checkout@v4 - with: { submodules: false } - - name: ${{ format('YAML check {0}', matrix.container) }} - shell: bash - run: | - for f in $(find . -type f -iname '*.yml' | LC_ALL=C sort); do - echo "===== checking file" - echo " yq $f" - yq < "$f" > /dev/null - if command -v ytt > /dev/null; then - echo " ytt $f" - ytt -f- < "$f" > /dev/null - fi - done - echo "All done." diff --git a/.github/workflows/weekly-ci-bs-by-hand.yml b/.github/workflows/weekly-ci-bs-by-hand.yml deleted file mode 100644 index e6816bb7..00000000 --- a/.github/workflows/weekly-ci-bs-by-hand.yml +++ /dev/null @@ -1,242 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer -# BS BuildSystem: build "by hand" using a POSIX-compliant shell - -name: 'Weekly CI BS - By Hand' -on: - schedule: [cron: '00 1 * * 3'] # run weekly Wednesday 01:00 UTC - workflow_dispatch: -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - VERBOSE: 1 - -jobs: - job-by-hand-alpinelinux-gcc: # 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' - # Alpine 3.9 + latest Alpine release + edge - strategy: { matrix: { container: ['alpine:3.9','alpine:3.19','alpine:edge','i386/alpine:edge'] } } - name: ${{ format('by-hand gcc {0}', matrix.container) }} - runs-on: ubuntu-latest - container: ${{ matrix.container }} - steps: - - name: ${{ format('Install packages {0}', matrix.container) }} - run: | - # install ccache, g++, git and various POSIX shells - shells="bash dash loksh mksh zsh" - case ${{ matrix.container }} in - *:3.19 | *:edge) shells="$shells oksh yash" ;; - esac - echo "installing shells: $shells" - apk update && apk upgrade && apk add ccache g++ git $shells - # enable ccache and some warnings - xflags="-static -Wall -Wextra -Werror" - echo -e "CC=ccache gcc $xflags\nCXX=ccache g++ -std=gnu++17 $xflags" >> $GITHUB_ENV - # this seems to be needed when running in a container (beause of UID mismatch??) - git config --global --add safe.directory '*' - # create user upx:upx 2000:2000 for file system tests below ("sudo") - adduser upx -u 2000 -D && cd /home/upx && chmod 00700 . && chown -R upx:upx . - - name: ${{ format('Check out UPX {0} source code', github.ref_name) }} - run: | - git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" "upx with space" - git -C "upx with space" submodule update --init - - name: 'Build by-hand with /bin/sh' - run: '/bin/sh "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with bash' - run: 'bash "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with bash --posix' - run: 'bash --posix "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with busybox ash' - run: 'busybox ash "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with busybox sh' - run: 'busybox sh "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with dash' - run: 'dash "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with loksh' - run: 'ksh "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with loksh -o posix' - run: 'ksh -o posix "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with loksh -o sh' - run: 'ksh -o sh "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with mksh' - run: 'mksh "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with mksh -o posix' - run: 'mksh -o posix "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with mksh -o sh' - run: 'mksh -o sh "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with oksh' - if: endsWith(matrix.container, ':3.19') || endsWith(matrix.container, ':edge') - run: 'oksh "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with oksh -o posix' - if: endsWith(matrix.container, ':3.19') || endsWith(matrix.container, ':edge') - run: 'oksh -o posix "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with oksh -o sh' - if: endsWith(matrix.container, ':3.19') || endsWith(matrix.container, ':edge') - run: 'oksh -o sh "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with yash' - if: endsWith(matrix.container, ':3.19') || endsWith(matrix.container, ':edge') - run: 'yash "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with zsh' - run: 'zsh "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with zsh --emulate ksh' - run: 'zsh --emulate ksh "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with zsh --emulate sh' - run: 'zsh --emulate sh "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Show ccache stats' - run: | - ccache -s - ccache -p - - name: 'Run file system test suite (busybox)' - run: | - apk add bash sudo - testsuite="$(readlink -fn "upx with space"/misc/testsuite/test_symlinks.sh)" - cd "upx with space"/build/by-hand - # IMPORTANT: do NOT run as user root! - chmod a+w . && sudo -u upx bash "$testsuite" - - name: 'Run file system test suite (coreutils)' - run: | - apk add bash coreutils sudo - testsuite="$(readlink -fn "upx with space"/misc/testsuite/test_symlinks.sh)" - cd "upx with space"/build/by-hand - # IMPORTANT: do NOT run as user root! - chmod a+w . && sudo -u upx bash "$testsuite" - - 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 - matrix: - include: - - { os: macos-11, run_fs_test: false } # macos-11 does not have "readlink -f" - - { os: macos-12, run_fs_test: true } - - { os: macos-13, run_fs_test: true } - name: ${{ format('by-hand clang {0}', matrix.os) }} - runs-on: ${{ matrix.os }} - steps: - - name: 'Install brew packages' - run: | - # install ccache - if ! command -v ccache > /dev/null; then - # only run "brew update" if needed - if ! brew install ccache; then brew update && brew install ccache; fi - fi - xflags="-Wall -Wextra -Werror" - echo -e "CC=ccache clang $xflags\nCXX=ccache clang++ -std=gnu++17 $xflags" >> $GITHUB_ENV - - name: ${{ format('Check out UPX {0} source code', github.ref_name) }} - run: | - git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" "upx with space" - git -C "upx with space" submodule update --init - - name: 'Build by-hand with /bin/sh' - run: 'top_srcdir="$PWD/upx with space" /bin/sh "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with bash' - run: 'top_srcdir="$PWD/upx with space" bash "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Build by-hand with zsh' - run: 'top_srcdir="$PWD/upx with space" zsh "./upx with space/misc/scripts/build_upx_by_hand.sh"' - - name: 'Run file system test suite' - if: ${{ matrix.run_fs_test }} - run: | - testsuite="$(readlink -fn "upx with space"/misc/testsuite/test_symlinks.sh)" - cd "upx with space"/build/by-hand - bash "$testsuite" - - job-by-hand-windows-clang: # uses a POSIX-compliant shell - # ...and also uses a subdirectory "upx with space" in order to detect possible quoting issues - if: github.repository_owner == 'upx' - strategy: - fail-fast: false - matrix: - include: - - { os: windows-2019 } - - { os: windows-2022 } - name: ${{ format('by-hand clang {0}', matrix.os) }} - runs-on: ${{ matrix.os }} - steps: - - run: git config --global core.autocrlf false - - name: ${{ format('Check out UPX {0} source code', github.ref_name) }} - shell: bash - run: | - git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" "upx with space" - git -C "upx with space" submodule update --init - - name: 'Build by-hand with bash' - shell: bash - run: | - xflags="-static -Wall -Wextra -Werror" - # clang uses the MSVC headers and libraries, so adjust settings - xflags="$xflags -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS" - export zlib_extra_flags="-DHAVE_VSNPRINTF" - export AR_LIBFILE=upx_submodules.lib - CC="clang $xflags" CXX="clang++ -std=gnu++17 $xflags" bash "./upx with space/misc/scripts/build_upx_by_hand.sh" - - job-by-hand-windows-gcc: # uses a POSIX-compliant shell - # ...and also uses a subdirectory "upx with space" in order to detect possible quoting issues - if: github.repository_owner == 'upx' - strategy: - fail-fast: false - matrix: - include: - - { os: windows-2019 } - - { os: windows-2022 } - name: ${{ format('by-hand gcc {0}', matrix.os) }} - runs-on: ${{ matrix.os }} - steps: - - run: git config --global core.autocrlf false - - name: ${{ format('Check out UPX {0} source code', github.ref_name) }} - shell: bash - run: | - git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" "upx with space" - git -C "upx with space" submodule update --init - - name: 'Build by-hand with bash' - shell: bash - run: | - xflags="-static -Wall -Wextra -Werror" - CC="gcc $xflags" CXX="g++ -std=gnu++17 $xflags" bash "./upx with space/misc/scripts/build_upx_by_hand.sh" - - job-by-hand-windows-msvc: # uses a POSIX-compliant shell - # ...and also uses a subdirectory "upx with space" in order to detect possible quoting issues - if: github.repository_owner == 'upx' - strategy: - fail-fast: false - matrix: - include: - # clang-cl - - { os: windows-2019, vsversion: 2019, arch: amd64, clang_cl: true } - - { os: windows-2022, vsversion: 2022, arch: amd64, clang_cl: true } - # msvc - - { os: windows-2019, vsversion: 2019, arch: amd64 } - - { os: windows-2019, vsversion: 2019, arch: amd64_arm64 } - - { os: windows-2019, vsversion: 2019, arch: amd64_x86 } - - { os: windows-2022, vsversion: 2022, arch: amd64 } - - { os: windows-2022, vsversion: 2022, arch: amd64_arm64 } - - { os: windows-2022, vsversion: 2022, arch: amd64_x86 } - name: ${{ format('by-hand vs{0} {1} {2}', matrix.vsversion, matrix.arch, matrix.clang_cl && 'clang-cl' || '') }} - runs-on: ${{ matrix.os }} - steps: - - run: git config --global core.autocrlf false - - name: ${{ format('Check out UPX {0} source code', github.ref_name) }} - shell: bash - run: | - git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" "upx with space" - git -C "upx with space" submodule update --init - - name: 'Set up Developer Command Prompt' - uses: ilammy/msvc-dev-cmd@v1 - with: - vsversion: ${{ matrix.vsversion }} - arch: ${{ matrix.arch }} - - name: 'Build by-hand with bash' - shell: bash - run: | - X="${{ matrix.clang_cl && 'clang-cl' || 'cl' }}" - command -v cl clang-cl lib link - # using MSVC headers and libraries, so adjust settings - xflags="-MT -J -W3 -DWIN32_LEAN_AND_MEAN -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS" - export mandatory_flags= - export sensible_flags= - export zlib_extra_flags="-DHAVE_VSNPRINTF" - export AR=false - export obj_suffix=.obj - CC="$X $xflags" CXX="$X -std:c++17 -Zc:__cplusplus -EHsc $xflags" bash "./upx with space/misc/scripts/build_upx_by_hand.sh" diff --git a/.github/workflows/weekly-ci-bs-cmake-macos-xcode.yml b/.github/workflows/weekly-ci-bs-cmake-macos-xcode.yml deleted file mode 100644 index ee23383b..00000000 --- a/.github/workflows/weekly-ci-bs-cmake-macos-xcode.yml +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer -# BS BuildSystem: build on macOS with 'cmake -G Xcode' - -name: 'Weekly CI BS - cmake macOS Xcode' -on: - schedule: [cron: '10 1 * * 3'] # run weekly Wednesday 01:10 UTC - workflow_dispatch: -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - UPX_CONFIG_EXPECT_THREADS: 'ON' - -jobs: - job-cmake-macos-xcode: # uses cmake + xcodebuild - if: github.repository_owner == 'upx' - strategy: - fail-fast: false - matrix: - include: - - { os: macos-11, run_test: true } - - { os: macos-12, run_test: true } - - { os: macos-13, run_test: false } # TODO: enable once UPX fully works on macos-13 - name: ${{ format('{0} cmake Xcode', matrix.os) }} - runs-on: ${{ matrix.os }} - steps: - - name: 'Check out code' - uses: actions/checkout@v4 - with: { submodules: true } - - { name: 'Config cmake Xcode', run: 'cmake -S . -B build/xcode -G Xcode' } - - { name: 'Build cmake Xcode default', run: 'cmake --build build/xcode --parallel --verbose' } - - { name: 'Build cmake Xcode Debug', run: 'cmake --build build/xcode --parallel --verbose --config Debug' } - - { name: 'Build cmake Xcode Release', run: 'cmake --build build/xcode --parallel --verbose --config Release' } - - name: 'Make artifact' - run: | - N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-weekly-ci-xcode-${{ matrix.os }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') - mkdir -p "tmp/artifact/$N" - (cd build && rsync -R -a */*/upx "../tmp/artifact/$N/") - (cd tmp/artifact && gtar --sort=name -czf "$N.tar.gz" "$N" && rm -rf "./$N") - # GitHub Actions magic: set "artifact_name" environment value for use in next step - echo "artifact_name=$N" >> $GITHUB_ENV - - name: ${{ format('Upload artifact {0}', env.artifact_name) }} - uses: actions/upload-artifact@v4 - with: - name: ${{ env.artifact_name }} - path: tmp/artifact - - name: 'Run ctest tests' - if: ${{ matrix.run_test }} - run: | - ctest --test-dir build/xcode -C Debug - #ctest --test-dir build/xcode -C Release - ./build/xcode/Debug/upx --sysinfo -v - ./build/xcode/Release/upx --sysinfo -v - - name: 'Run install tests' - run: | - (cd build/xcode && DESTDIR=$PWD/Install-default cmake --install .) - (cd build/xcode && DESTDIR=$PWD/Install-debug cmake --install . --config Debug) - (cd build/xcode && DESTDIR=$PWD/Install-release cmake --install . --config Release) - ls -l build/xcode/Install-*/usr/local/bin/upx diff --git a/.github/workflows/weekly-ci-bs-cmake-windows-make.yml b/.github/workflows/weekly-ci-bs-cmake-windows-make.yml deleted file mode 100644 index 136cce9a..00000000 --- a/.github/workflows/weekly-ci-bs-cmake-windows-make.yml +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer -# BS BuildSystem: build on Windows with 'cmake -G "Unix Makefiles"' - -name: 'Weekly CI BS - cmake Windows make' -on: - schedule: [cron: '20 1 * * 3'] # run weekly Wednesday 01:20 UTC - workflow_dispatch: -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - UPX_CONFIG_EXPECT_THREADS: 'ON' - UPX_CMAKE_BUILD_FLAGS: --verbose - UPX_CMAKE_CONFIG_FLAGS: -G "Unix Makefiles" -Wdev --warn-uninitialized - -jobs: - job-cmake-windows-make: # uses cmake + make - if: github.repository_owner == 'upx' - strategy: - fail-fast: false - matrix: - include: -# INFO: the following don't work with GNU make (probably some quoting problems with spaces or backslashes) -# => use Ninja generator instead; see weekly-ci-bs-cmake-windows-ninja.yml -# # cl (MSVC) -# - { os: windows-2019, cc: cl, cxx: cl, vsversion: 2019, arch: amd64 } -# - { os: windows-2019, cc: cl, cxx: cl, vsversion: 2019, arch: amd64_arm64 } -# - { os: windows-2019, cc: cl, cxx: cl, vsversion: 2019, arch: amd64_x86 } -# - { os: windows-2022, cc: cl, cxx: cl, vsversion: 2022, arch: amd64 } -# - { os: windows-2022, cc: cl, cxx: cl, vsversion: 2022, arch: amd64_arm64 } -# - { os: windows-2022, cc: cl, cxx: cl, vsversion: 2022, arch: amd64_x86 } -# # clang-cl -# - { os: windows-2019, cc: clang-cl, cxx: clang-cl, vsversion: 2019, arch: amd64 } -# - { os: windows-2022, cc: clang-cl, cxx: clang-cl, vsversion: 2022, arch: amd64 } - # clang - - { os: windows-2019, cc: clang, cxx: 'clang++', arch: amd64, xflags: '-static' } - - { os: windows-2022, cc: clang, cxx: 'clang++', arch: amd64, xflags: '-static' } - # gcc (mingw-gcc) - - { os: windows-2019, cc: gcc, cxx: 'g++', arch: amd64, xflags: '-static' } - - { os: windows-2022, cc: gcc, cxx: 'g++', arch: amd64, xflags: '-static' } - env: - CC: ${{ matrix.cc }} ${{ matrix.xflags }} - CXX: ${{ matrix.cxx }} ${{ matrix.xflags }} - name: ${{ format('{0} {1} {2} {3}', matrix.cc, matrix.vsversion, matrix.arch, matrix.os) }} - runs-on: ${{ matrix.os }} - steps: - - run: git config --global core.autocrlf false - - name: 'Check out code' - uses: actions/checkout@v4 - with: { submodules: true } - - name: 'Set up Developer Command Prompt' - if: matrix.vsversion - uses: ilammy/msvc-dev-cmd@v1 - with: - vsversion: ${{ matrix.vsversion }} - arch: ${{ matrix.arch }} - - name: 'Init environment' - shell: bash - run: | - xtarget="${{ matrix.os }}-make-${{ matrix.cc }}-${{ matrix.vsversion }}-${{ matrix.arch}}" - echo "xtarget=$xtarget" >> $GITHUB_ENV - - name: 'Build cmake Make Debug' - shell: bash - run: | - make UPX_XTARGET=$xtarget xtarget/debug - ls -l build/xtarget/$xtarget/debug/upx.exe - file build/xtarget/$xtarget/debug/upx.exe || true - - name: 'Build cmake Make Release' - if: success() || failure() # run this step even if the previous step failed - shell: bash - run: | - make UPX_XTARGET=$xtarget xtarget/release - ls -l build/xtarget/$xtarget/release/upx.exe - file build/xtarget/$xtarget/release/upx.exe || true - - name: 'Make artifact' - shell: bash - run: | - N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-weekly-ci-make-${xtarget}" | sed 's/[^0-9a-zA-Z_.-]/-/g') - mkdir -p "tmp/artifact/$N" - (cd build && cp -ai --parents xtarget/*/*/upx.exe "../tmp/artifact/$N") - # GitHub Actions magic: set "artifact_name" environment value for use in next step - echo "artifact_name=$N" >> $GITHUB_ENV - - name: ${{ format('Upload artifact {0}', env.artifact_name) }} - uses: actions/upload-artifact@v4 - with: - name: ${{ env.artifact_name }} - path: tmp/artifact - - name: 'Run ctest tests' - if: ${{ matrix.arch != 'amd64_arm64' }} - shell: bash - run: | - ctest --test-dir build/xtarget/$xtarget/debug - ctest --test-dir build/xtarget/$xtarget/release - ./build/xtarget/$xtarget/debug/upx.exe --sysinfo -v - ./build/xtarget/$xtarget/release/upx.exe --sysinfo -v - - name: 'Run install tests' - shell: bash - run: | - env DESTDIR=./Install-debug cmake --install build/xtarget/$xtarget/debug - env DESTDIR=./Install-release cmake --install build/xtarget/$xtarget/release diff --git a/.github/workflows/weekly-ci-bs-cmake-windows-ninja.yml b/.github/workflows/weekly-ci-bs-cmake-windows-ninja.yml deleted file mode 100644 index bc662ae6..00000000 --- a/.github/workflows/weekly-ci-bs-cmake-windows-ninja.yml +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer -# BS BuildSystem: build on Windows with 'cmake -G Ninja' - -name: 'Weekly CI BS - cmake Windows Ninja' -on: - schedule: [cron: '30 1 * * 3'] # run weekly Wednesday 01:30 UTC - workflow_dispatch: -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - UPX_CONFIG_EXPECT_THREADS: 'ON' - UPX_CMAKE_BUILD_FLAGS: --verbose - UPX_CMAKE_CONFIG_FLAGS: -G Ninja -Wdev --warn-uninitialized - -jobs: - job-cmake-windows-ninja: # uses cmake + ninja - if: github.repository_owner == 'upx' - strategy: - fail-fast: false - matrix: - include: - # cl (MSVC) - - { os: windows-2019, cc: cl, cxx: cl, vsversion: 2019, arch: amd64 } - - { os: windows-2019, cc: cl, cxx: cl, vsversion: 2019, arch: amd64_arm64 } - - { os: windows-2019, cc: cl, cxx: cl, vsversion: 2019, arch: amd64_x86 } - - { os: windows-2022, cc: cl, cxx: cl, vsversion: 2022, arch: amd64 } - - { os: windows-2022, cc: cl, cxx: cl, vsversion: 2022, arch: amd64_arm64 } - - { os: windows-2022, cc: cl, cxx: cl, vsversion: 2022, arch: amd64_x86 } - # clang-cl - - { os: windows-2019, cc: clang-cl, cxx: clang-cl, vsversion: 2019, arch: amd64 } - - { os: windows-2022, cc: clang-cl, cxx: clang-cl, vsversion: 2022, arch: amd64 } - # clang - - { os: windows-2019, cc: clang, cxx: 'clang++', arch: amd64, xflags: '-static' } - - { os: windows-2022, cc: clang, cxx: 'clang++', arch: amd64, xflags: '-static' } - # gcc (mingw-gcc) - - { os: windows-2019, cc: gcc, cxx: 'g++', arch: amd64, xflags: '-static' } - - { os: windows-2022, cc: gcc, cxx: 'g++', arch: amd64, xflags: '-static' } - env: - CC: ${{ matrix.cc }} ${{ matrix.xflags }} - CXX: ${{ matrix.cxx }} ${{ matrix.xflags }} - name: ${{ format('{0} {1} {2} {3}', matrix.cc, matrix.vsversion, matrix.arch, matrix.os) }} - runs-on: ${{ matrix.os }} - steps: - - run: git config --global core.autocrlf false - - name: 'Check out code' - uses: actions/checkout@v4 - with: { submodules: true } - - name: 'Set up Developer Command Prompt' - if: matrix.vsversion - uses: ilammy/msvc-dev-cmd@v1 - with: - vsversion: ${{ matrix.vsversion }} - arch: ${{ matrix.arch }} - - name: 'Init environment' - shell: bash - run: | - command -v ninja >/dev/null || choco install -y --no-progress ninja - xtarget="${{ matrix.os }}-ninja-${{ matrix.cc }}-${{ matrix.vsversion }}-${{ matrix.arch}}" - echo "xtarget=$xtarget" >> $GITHUB_ENV - - name: 'Build cmake Ninja Debug' - shell: bash - run: | - make UPX_XTARGET=$xtarget xtarget/debug - ls -l build/xtarget/$xtarget/debug/upx.exe - file build/xtarget/$xtarget/debug/upx.exe || true - - name: 'Build cmake Ninja Release' - if: success() || failure() # run this step even if the previous step failed - shell: bash - run: | - make UPX_XTARGET=$xtarget xtarget/release - ls -l build/xtarget/$xtarget/release/upx.exe - file build/xtarget/$xtarget/release/upx.exe || true - - name: 'Make artifact' - shell: bash - run: | - N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-weekly-ci-ninja-${xtarget}" | sed 's/[^0-9a-zA-Z_.-]/-/g') - mkdir -p "tmp/artifact/$N" - (cd build && cp -ai --parents xtarget/*/*/upx.exe "../tmp/artifact/$N") - # GitHub Actions magic: set "artifact_name" environment value for use in next step - echo "artifact_name=$N" >> $GITHUB_ENV - - name: ${{ format('Upload artifact {0}', env.artifact_name) }} - uses: actions/upload-artifact@v4 - with: - name: ${{ env.artifact_name }} - path: tmp/artifact - - name: 'Run ctest tests' - if: ${{ matrix.arch != 'amd64_arm64' }} - shell: bash - run: | - ctest --test-dir build/xtarget/$xtarget/debug - ctest --test-dir build/xtarget/$xtarget/release - ./build/xtarget/$xtarget/debug/upx.exe --sysinfo -v - ./build/xtarget/$xtarget/release/upx.exe --sysinfo -v - - name: 'Run install tests' - shell: bash - run: | - env DESTDIR=./Install-debug cmake --install build/xtarget/$xtarget/debug - env DESTDIR=./Install-release cmake --install build/xtarget/$xtarget/release diff --git a/.github/workflows/weekly-ci-bs-cmake-windows-nmake.yml b/.github/workflows/weekly-ci-bs-cmake-windows-nmake.yml deleted file mode 100644 index 607618f5..00000000 --- a/.github/workflows/weekly-ci-bs-cmake-windows-nmake.yml +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer -# BS BuildSystem: build on Windows with 'cmake -G "NMake Makefiles"' - -name: 'Weekly CI BS - cmake Windows NMake' -on: - schedule: [cron: '40 1 * * 3'] # run weekly Wednesday 01:40 UTC - workflow_dispatch: -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - UPX_CONFIG_EXPECT_THREADS: 'ON' - -jobs: - job-cmake-windows-nmake: # uses cmake + nmake - if: github.repository_owner == 'upx' - strategy: - fail-fast: false - matrix: - include: - # clang-cl - - { os: windows-2019, vsversion: 2019, arch: amd64, clang_cl: true } - - { os: windows-2022, vsversion: 2022, arch: amd64, clang_cl: true } - # msvc - - { os: windows-2019, vsversion: 2019, arch: amd64 } - - { os: windows-2019, vsversion: 2019, arch: amd64_arm64 } - - { os: windows-2019, vsversion: 2019, arch: amd64_x86 } - - { os: windows-2022, vsversion: 2022, arch: amd64 } - - { os: windows-2022, vsversion: 2022, arch: amd64_arm64 } - - { os: windows-2022, vsversion: 2022, arch: amd64_x86 } - name: ${{ format('vs{0} {1} {2}', matrix.vsversion, matrix.arch, matrix.clang_cl && 'clang-cl' || '') }} - runs-on: ${{ matrix.os }} - steps: - - run: git config --global core.autocrlf false - - name: 'Check out code' - uses: actions/checkout@v4 - with: { submodules: true } - - name: 'Set up Developer Command Prompt' - uses: ilammy/msvc-dev-cmd@v1 - with: - vsversion: ${{ matrix.vsversion }} - arch: ${{ matrix.arch }} - - name: 'Build cmake NMake Debug' - shell: cmd - run: | - set X=${{ matrix.clang_cl && '-DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl' || '' }} - cmake -S . -B build/debug -G "NMake Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Debug %X% - cd build/debug - nmake - dir *.exe - - name: 'Build cmake NMake Release' - if: success() || failure() # run this step even if the previous step failed - shell: cmd - run: | - set X=${{ matrix.clang_cl && '-DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl' || '' }} - cmake -S . -B build/release -G "NMake Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON %X% - cd build/release - nmake - dir *.exe - - name: 'Make artifact' - shell: bash - run: | - X="${{ matrix.clang_cl && '-clang-cl' || '' }}" - N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-weekly-ci-nmake-vs${{ matrix.vsversion }}-${{ matrix.arch }}$X" | sed 's/[^0-9a-zA-Z_.-]/-/g') - mkdir -p "tmp/artifact/$N" - (cd build && cp -ai --parents */upx.exe "../tmp/artifact/$N") - # GitHub Actions magic: set "artifact_name" environment value for use in next step - echo "artifact_name=$N" >> $GITHUB_ENV - - name: ${{ format('Upload artifact {0}', env.artifact_name) }} - uses: actions/upload-artifact@v4 - with: - name: ${{ env.artifact_name }} - path: tmp/artifact - - name: 'Run ctest tests' - if: ${{ matrix.arch != 'amd64_arm64' }} - run: | - ctest --test-dir build/debug - ctest --test-dir build/release - .\build\debug\upx.exe --sysinfo -v - .\build\release\upx.exe --sysinfo -v - - name: 'Run install tests' - run: | - env DESTDIR=./Install-debug cmake --install build/debug - env DESTDIR=./Install-release cmake --install build/release diff --git a/.github/workflows/weekly-ci-bs-misc.yml b/.github/workflows/weekly-ci-bs-misc.yml deleted file mode 100644 index 727edb2c..00000000 --- a/.github/workflows/weekly-ci-bs-misc.yml +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer -# BS BuildSystem: build with misc flags - -name: 'Weekly CI BS - Misc' -on: - schedule: [cron: '50 1 * * 3'] # run weekly Wednesday 01:50 UTC - workflow_dispatch: -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - UPX_CONFIG_EXPECT_THREADS: 'ON' - UPX_CMAKE_BUILD_FLAGS: --verbose - -jobs: - BS0: - if: github.repository_owner == 'upx' - runs-on: ubuntu-latest - container: 'alpine:edge' - steps: - - name: 'Install packages' - run: | - apk update && apk upgrade && apk add bash git perl yq - git config --global --add safe.directory '*' - git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" . - - name: 'Misc checks' - run: | - cat ./.github/*.yml | yq > /dev/null - cat ./.github/*/*.yml | yq > /dev/null - bash ./misc/scripts/check_whitespace_git.sh - echo "All done." - - BS1: # uses cmake + make - if: github.repository_owner == 'upx' - strategy: - fail-fast: false - matrix: - container: - - 'alpine:edge' - - 'i386/alpine:edge' - cc: - - 'clang' - - 'gcc' - cppflags: - - '-DWITH_XSPAN=0' - - '-DWITH_XSPAN=1' - - '-DWITH_XSPAN=2' - - '-DDOCTEST_CONFIG_DISABLE' - runs-on: ubuntu-latest - container: ${{ matrix.container }} - steps: - - name: ${{ format('Install packages {0}', matrix.container) }} - run: 'apk update && apk upgrade && apk add clang cmake g++ git make' - - name: ${{ format('Check out {0} source code', github.ref_name) }} - run: | - # this seems to be needed when running in a container (beause of UID mismatch??) - git config --global --add safe.directory '*' - git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" . - git submodule update --init - # prepare environment - xflags="-static ${{ matrix.cppflags }}" - case ${{ matrix.cc }} in - clang) CC="clang $xflags"; CXX="clang++ $xflags" ;; - gcc) CC="gcc $xflags"; CXX="g++ $xflags" ;; - *) exit 99 ;; - esac - echo -e "CC=$CC\nCXX=$CXX" >> $GITHUB_ENV - - name: 'Build and test Debug' - run: 'echo -e "CC=$CC;\nCXX=$CXX;" && make build/debug && ctest --test-dir build/debug' - - name: 'Build and test Release' - if: success() || failure() # run this step even if the previous step failed - run: 'echo -e "CC=$CC;\nCXX=$CXX;" && make build/release && ctest --test-dir build/release' - - BS2: # uses cmake + make - if: github.repository_owner == 'upx' - strategy: - fail-fast: false - matrix: - container: - - 'alpine:edge' - cc: - - 'clang' - - 'gcc' - cxxflags: - - '-std=gnu++20' - - '-std=gnu++23' - runs-on: ubuntu-latest - container: ${{ matrix.container }} - steps: - - name: ${{ format('Install packages {0}', matrix.container) }} - run: 'apk update && apk upgrade && apk add clang cmake g++ git make' - - name: ${{ format('Check out {0} source code', github.ref_name) }} - run: | - # this seems to be needed when running in a container (beause of UID mismatch??) - git config --global --add safe.directory '*' - git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" . - git submodule update --init - # prepare environment - xflags="-static" - case ${{ matrix.cc }} in - clang) CC="clang $xflags"; CXX="clang++ $xflags ${{ matrix.cxxflags }}" ;; - gcc) CC="gcc $xflags"; CXX="g++ $xflags ${{ matrix.cxxflags }}" ;; - *) exit 99 ;; - esac - echo -e "CC=$CC\nCXX=$CXX" >> $GITHUB_ENV - echo "UPX_CONFIG_DISABLE_C_STANDARD=ON" >> $GITHUB_ENV - echo "UPX_CONFIG_DISABLE_CXX_STANDARD=ON" >> $GITHUB_ENV - - name: 'Build and test Debug' - run: 'echo -e "CC=$CC;\nCXX=$CXX;" && make build/debug && ctest --test-dir build/debug' - - name: 'Build and test Release' - if: success() || failure() # run this step even if the previous step failed - run: 'echo -e "CC=$CC;\nCXX=$CXX;" && make build/release && ctest --test-dir build/release' diff --git a/.github/workflows/weekly-ci-cc-alpine-linux.yml b/.github/workflows/weekly-ci-cc-alpine-linux.yml deleted file mode 100644 index 19eafe0e..00000000 --- a/.github/workflows/weekly-ci-cc-alpine-linux.yml +++ /dev/null @@ -1,219 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer -# CC CompilationCheck: test various clang and gcc versions - -# Build under various Alpine Linux versions with clang and gcc, and -# also test building with C++20, C++23 and LTO. - -# And also uses a subdirectory "upx with space" that contains whitespace in order -# to detect possible quoting issues. - -# info: Alpine Linux 3.9 (released Jan 2019) has clang-5, cmake-3.13.0 -# and gcc-8, which nicely matches our minimal build requirements - -name: 'Weekly CI CC - Alpine Linux C++23' -on: - schedule: [cron: '00 2 * * 3'] # run weekly Wednesday 02:00 UTC - workflow_dispatch: -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - UPX_CMAKE_CONFIG_FLAGS: -Wdev --warn-uninitialized - UPX_TESTSUITE_LEVEL: 4 - -jobs: - job-alpine-cmake: # uses cmake + make - if: github.repository_owner == 'upx' - strategy: - fail-fast: false - matrix: - include: - - { container: 'alpine:3.9' , use_cxx20: 0, use_cxx2b: 0, use_lto: 0 } # Jan 2019: C++17; clang-5 & gcc-8 - - { container: 'alpine:3.10', use_cxx20: 0, use_cxx2b: 0, use_lto: 0 } - - { container: 'alpine:3.11', use_cxx20: 0, use_cxx2b: 0, use_lto: 0 } - - { container: 'alpine:3.12', use_cxx20: 0, use_cxx2b: 0, use_lto: 0 } - - { container: 'alpine:3.13', use_cxx20: 0, use_cxx2b: 0, use_lto: 0 } # Jan 2021: C++20; clang-10 & gcc-10; INFO: clang-10 is NOT fully C++20 compatible - - { container: 'alpine:3.14', use_cxx20: 1, use_cxx2b: 0, use_lto: 0 } # Jun 2011: C++20; clang-11 & gcc-10 - - { container: 'alpine:3.15', use_cxx20: 1, use_cxx2b: 0, use_lto: 1 } # Nov 2021: LTO; clang-12 & gcc-10 & binutils-2.37 - - { 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:3.19', 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 } - # 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 - - { container: 'i386/alpine:3.11' } # clang-9, gcc-9 - - { container: 'i386/alpine:3.12' } # clang-10, gcc-9 - - { container: 'i386/alpine:3.13' } # clang-10, gcc-10 - - { container: 'i386/alpine:3.14' } # clang-11, gcc-10 - - { container: 'i386/alpine:3.15' } # clang-12, gcc-10 - - { container: 'i386/alpine:3.16' } # clang-13, gcc-11 - - { container: 'i386/alpine:3.17' } # clang-15, gcc-12 - - { container: 'i386/alpine:3.18' } # clang-16, gcc-12 - - { container: 'i386/alpine:3.19' } # clang-17, gcc-13 - name: ${{ format('container {0}', matrix.container) }} - runs-on: ubuntu-latest - container: ${{ matrix.container }} - steps: - - name: ${{ format('Install packages {0}', matrix.container) }} - run: | - apk update && apk upgrade && apk add clang cmake g++ git make - case ${{ matrix.container }} in - # clang-dev is needed on Alpine versions <= 3.11 for clang headers like - *:3.[0-9] | *:3.1[0-1]) apk add clang-dev ;; - esac - case ${{ matrix.container }}-${{ matrix.use_lto }} in - # llvm-dev is needed on Alpine versions <= 3.18 for -flto - *:3.[0-9]-1 | *:3.1[0-8]-1) apk add llvm-dev ;; - esac - # set environment vars - x="$(apk list -I "$(apk info -Wq "$(which clang)")")"; echo "clang_package=${x%% *}" >> $GITHUB_ENV - x="$(apk list -I "$(apk info -Wq "$(which gcc)")")"; echo "gcc_package=${x%% *}" >> $GITHUB_ENV - N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-weekly-ci-alpine-${{ matrix.container }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') - echo "artifact_name=$N" >> $GITHUB_ENV - # create user upx:upx 2000:2000 for file system tests below ("sudo") - adduser upx -u 2000 -D && cd /home/upx && chmod 00700 . && chown -R upx:upx . - - name: ${{ format('Check out UPX {0} source code', github.ref_name) }} - run: | - git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" "upx with space" - git -C "upx with space" submodule update --init - - # build with default C11 and C++17 - - name: ${{ format('Build clang Release with {0}', env.clang_package) }} - run: 'make -C "upx with space" UPX_XTARGET=clang-static CC="clang -static" CXX="clang++ -static"' - - name: ${{ format('Build clang Debug with {0}', env.clang_package) }} - run: 'make -C "upx with space" UPX_XTARGET=clang-static CC="clang -static" CXX="clang++ -static" xtarget/debug' - - name: ${{ format('Build gcc Release with {0}', env.gcc_package) }} - run: 'make -C "upx with space" UPX_XTARGET=gcc-static CC="gcc -static" CXX="g++ -static"' - - name: ${{ format('Build gcc Debug with {0}', env.gcc_package) }} - run: 'make -C "upx with space" UPX_XTARGET=gcc-static CC="gcc -static" CXX="g++ -static" xtarget/debug' - - # build with C17 and C++20 - - name: ${{ format('Build clang C++20 Release with {0}', env.clang_package) }} - if: matrix.use_cxx20 - run: | - export UPX_CONFIG_DISABLE_C_STANDARD=ON UPX_CONFIG_DISABLE_CXX_STANDARD=ON - make -C "upx with space" UPX_XTARGET=clang-static-cxx20 CC="clang -static -std=gnu17" CXX="clang++ -static -std=gnu++20" - - name: ${{ format('Build clang C++20 Debug with {0}', env.clang_package) }} - if: matrix.use_cxx20 - run: | - export UPX_CONFIG_DISABLE_C_STANDARD=ON UPX_CONFIG_DISABLE_CXX_STANDARD=ON - make -C "upx with space" UPX_XTARGET=clang-static-cxx20 CC="clang -static -std=gnu17" CXX="clang++ -static -std=gnu++20" xtarget/debug - - name: ${{ format('Build gcc C++20 Release with {0}', env.gcc_package) }} - if: matrix.use_cxx20 - run: | - export UPX_CONFIG_DISABLE_C_STANDARD=ON UPX_CONFIG_DISABLE_CXX_STANDARD=ON - make -C "upx with space" UPX_XTARGET=gcc-static-cxx20 CC="gcc -static -std=gnu17" CXX="g++ -static -std=gnu++20" - - name: ${{ format('Build gcc C++20 Debug with {0}', env.gcc_package) }} - if: matrix.use_cxx20 - run: | - export UPX_CONFIG_DISABLE_C_STANDARD=ON UPX_CONFIG_DISABLE_CXX_STANDARD=ON - make -C "upx with space" UPX_XTARGET=gcc-static-cxx20 CC="gcc -static -std=gnu17" CXX="g++ -static -std=gnu++20" xtarget/debug - - # build with C23 and C++23 - - name: ${{ format('Build clang C++23 Release with {0}', env.clang_package) }} - if: matrix.use_cxx23 || matrix.use_cxx2b - run: | - export UPX_CONFIG_DISABLE_C_STANDARD=ON UPX_CONFIG_DISABLE_CXX_STANDARD=ON - a=gnu23; b=gnu++23; if test "X${{ matrix.use_cxx2b }}" = X1; then a=gnu2x; b=gnu++2b; fi - make -C "upx with space" UPX_XTARGET=clang-static-cxx23 CC="clang -static -std=$a" CXX="clang++ -static -std=$b" - - name: ${{ format('Build clang C++23 Debug with {0}', env.clang_package) }} - if: matrix.use_cxx23 || matrix.use_cxx2b - run: | - export UPX_CONFIG_DISABLE_C_STANDARD=ON UPX_CONFIG_DISABLE_CXX_STANDARD=ON - a=gnu23; b=gnu++23; if test "X${{ matrix.use_cxx2b }}" = X1; then a=gnu2x; b=gnu++2b; fi - make -C "upx with space" UPX_XTARGET=clang-static-cxx23 CC="clang -static -std=$a" CXX="clang++ -static -std=$b" xtarget/debug - - name: ${{ format('Build gcc C++23 Release with {0}', env.gcc_package) }} - if: matrix.use_cxx23 || matrix.use_cxx2b - run: | - export UPX_CONFIG_DISABLE_C_STANDARD=ON UPX_CONFIG_DISABLE_CXX_STANDARD=ON - a=gnu23; b=gnu++23; if test "X${{ matrix.use_cxx2b }}" = X1; then a=gnu2x; b=gnu++2b; fi - make -C "upx with space" UPX_XTARGET=gcc-static-cxx23 CC="gcc -static -std=$a" CXX="g++ -static -std=$b" - - name: ${{ format('Build gcc C++23 Debug with {0}', env.gcc_package) }} - if: matrix.use_cxx23 || matrix.use_cxx2b - run: | - export UPX_CONFIG_DISABLE_C_STANDARD=ON UPX_CONFIG_DISABLE_CXX_STANDARD=ON - a=gnu23; b=gnu++23; if test "X${{ matrix.use_cxx2b }}" = X1; then a=gnu2x; b=gnu++2b; fi - make -C "upx with space" UPX_XTARGET=gcc-static-cxx23 CC="gcc -static -std=$a" CXX="g++ -static -std=$b" xtarget/debug - - # build with -flto - - name: ${{ format('Build clang LTO Release with {0}', env.clang_package) }} - if: matrix.use_lto - run: | - make -C "upx with space" UPX_XTARGET=clang-static-cxxlto CC="clang -static -flto" CXX="clang++ -static -flto" - - name: ${{ format('Build clang LTO Debug with {0}', env.clang_package) }} - if: matrix.use_lto - run: | - make -C "upx with space" UPX_XTARGET=clang-static-cxxlto CC="clang -static -flto" CXX="clang++ -static -flto" xtarget/debug - - name: ${{ format('Build gcc LTO Release with {0}', env.gcc_package) }} - if: matrix.use_lto - run: | - make -C "upx with space" UPX_XTARGET=gcc-static-cxxlto CC="gcc -static -flto" CXX="g++ -static -flto" - - name: ${{ format('Build gcc LTO Debug with {0}', env.gcc_package) }} - if: matrix.use_lto - run: | - make -C "upx with space" UPX_XTARGET=gcc-static-cxxlto CC="gcc -static -flto" CXX="g++ -static -flto" xtarget/debug - - - { name: 'Strip release binaries', run: 'strip -p --strip-unneeded "upx with space"/build/*/*/release/upx' } - - - name: ${{ format('Upload artifact {0}', env.artifact_name) }} - if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: missing nodejs on host - uses: actions/upload-artifact@v4 - with: - name: ${{ env.artifact_name }} - path: 'upx with space*/build/*/*/*/upx' - - - name: 'Run install tests' - run: | - (cd "upx with space"/build/xtarget/clang-static/debug && DESTDIR="$PWD/Install with cmake" cmake --install .) - (cd "upx with space"/build/xtarget/clang-static/debug && DESTDIR="$PWD/Install with make" make install) - (cd "upx with space"/build/xtarget/clang-static/release && DESTDIR="$PWD/Install with cmake" cmake --install .) - (cd "upx with space"/build/xtarget/clang-static/release && DESTDIR="$PWD/Install with make" make install) - (cd "upx with space"/build/xtarget/gcc-static/debug && DESTDIR="$PWD/Install with cmake" cmake --install .) - (cd "upx with space"/build/xtarget/gcc-static/debug && DESTDIR="$PWD/Install with make" make install) - (cd "upx with space"/build/xtarget/gcc-static/release && DESTDIR="$PWD/Install with cmake" cmake --install .) - (cd "upx with space"/build/xtarget/gcc-static/release && DESTDIR="$PWD/Install with make" make install) - - - { name: 'Run ctest tests clang Debug', run: 'make -C "upx with space"/build/xtarget/clang-static/debug test' } - - { name: 'Run ctest tests clang Release', run: 'make -C "upx with space"/build/xtarget/clang-static/release test' } - - { name: 'Run ctest tests gcc Debug', run: 'make -C "upx with space"/build/xtarget/gcc-static/debug test' } - - { name: 'Run ctest tests gcc Release', run: 'make -C "upx with space"/build/xtarget/gcc-static/release test' } - - - name: 'Run ctest tests C++20, C++23 and LTO' - if: matrix.use_cxx20 || matrix.use_cxx23 || matrix.use_cxx2b || matrix.use_lto - run: | - 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)' - run: | - apk add bash sudo - testsuite="$(readlink -fn "upx with space"/misc/testsuite/test_symlinks.sh)" - cd "upx with space"/build/xtarget/gcc-static/release - # IMPORTANT: do NOT run as user root! - chmod a+w . && sudo -u upx bash "$testsuite" - - # test suite - - name: ${{ format('Run test suite level {0}', env.UPX_TESTSUITE_LEVEL) }} - run: | - # testsuite needs bash and working "readlink -en" and "sha256sum -b" - apk add bash coreutils - # use a directory that contains whitespace to detect possible quoting issues - git clone --depth=1 https://github.com/upx/upx-testsuite "upx-testsuite with space" - export upx_testsuite_SRCDIR="$(readlink -fn "upx-testsuite with space")" - testsuite_1="$(readlink -fn "upx with space"/misc/testsuite/upx_testsuite_1.sh)" - (cd "upx with space"/build/xtarget/gcc-static/release && upx_exe=./upx bash "$testsuite_1") - - - name: 'Run file system test suite (coreutils)' - run: | - apk add bash coreutils sudo - testsuite="$(readlink -fn "upx with space"/misc/testsuite/test_symlinks.sh)" - cd "upx with space"/build/xtarget/gcc-static/release - # IMPORTANT: do NOT run as user root! - chmod a+w . && sudo -u upx bash "$testsuite" diff --git a/.github/workflows/weekly-ci-cc-alpine-mingw.yml b/.github/workflows/weekly-ci-cc-alpine-mingw.yml deleted file mode 100644 index f8a3c512..00000000 --- a/.github/workflows/weekly-ci-cc-alpine-mingw.yml +++ /dev/null @@ -1,218 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer -# CC CompilationCheck: compile with various mingw-gcc versions and run tests under Wine - -name: 'Weekly CI CC - Alpine Linux MinGW' -on: - schedule: [cron: '20 2 * * 3'] # run weekly Wednesday 02:20 UTC - workflow_dispatch: -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - UPX_CMAKE_CONFIG_FLAGS: -Wdev --warn-uninitialized - UPX_CONFIG_EXPECT_THREADS: 'ON' - -jobs: - job-alpine-mingw: # uses cmake + make - if: github.repository_owner == 'upx' - strategy: - fail-fast: false - matrix: - include: - - { container: 'alpine:3.11', wine: true, i686_mingw: false } # wine-4.0.3 - - { container: 'alpine:3.12', wine: true, i686_mingw: false } # wine-4.0.3 - - { container: 'alpine:3.13', wine: true, i686_mingw: false } # wine-4.0.3 - - { container: 'alpine:3.14', wine: true, i686_mingw: false } # wine-6.18 - - { container: 'alpine:3.15', wine: true, i686_mingw: false } # wine-6.23 - - { container: 'alpine:3.16', wine: true, i686_mingw: false } # wine-7.8 - - { container: 'alpine:3.17', wine: true, i686_mingw: false } # wine-7.21 - # Wine >= 8.0 can run i686 32-bit programs in WOW64 mode on pure 64-bit systems - - { container: 'alpine:3.18', wine: true, i686_mingw: true } # wine-8.13 - - { container: 'alpine:3.19', wine: true, i686_mingw: true } # wine-8.21 - - { container: 'alpine:edge', wine: true, i686_mingw: true } # wine-8.21 - name: ${{ format('container {0}', matrix.container) }} - runs-on: ubuntu-latest - container: ${{ matrix.container }} - steps: - - name: ${{ format('Install packages {0}', matrix.container) }} - run: | - apk update && apk upgrade && apk add bash cmake coreutils file git make tar xz - apk add mingw-w64-gcc - test "${{ matrix.i686_mingw }}" = "true" && apk add i686-mingw-w64-gcc - true - - name: 'Install Wine' - if: ${{ matrix.wine }} - run: | - apk add wine - test -f /usr/bin/wine || ln -s -v wine64 /usr/bin/wine - # this seems to be needed for Wine when running in a container (beause of UID mismatch??) - mkdir -p -v ~/.wine - wineboot --init - - name: ${{ format('Check out UPX {0} source code', github.ref_name) }} - run: | - # this seems to be needed when running in a container (beause of UID mismatch??) - git config --global --add safe.directory '*' - git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" . - git submodule update --init - - name: 'Build cmake extra/cross-windows-mingw32/debug' - if: ${{ matrix.i686_mingw }} - run: 'make build/extra/cross-windows-mingw32/debug' - - name: 'Build cmake extra/cross-windows-mingw32/release' - if: ${{ matrix.i686_mingw }} - run: 'make build/extra/cross-windows-mingw32/release' - - name: 'Build cmake extra/cross-windows-mingw64/debug' - run: | - # on Alpine 3.11 and 3.12 CMake does not find AR; Alpine >= 3.13 (with CMake 3.18.4) works - X= - case ${{ matrix.container }} in - *:3.1[12]) X="CMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar" ;; - esac - make build/extra/cross-windows-mingw64/debug $X - - name: 'Build cmake extra/cross-windows-mingw64/release' - run: | - # on Alpine 3.11 and 3.12 CMake does not find AR; Alpine >= 3.13 (with CMake 3.18.4) works - X= - case ${{ matrix.container }} in - *:3.1[12]) X="CMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar" ;; - esac - make build/extra/cross-windows-mingw64/release $X - - name: 'Make artifact' - shell: bash - run: | - N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-weekly-ci-alpine-mingw-${{ matrix.container }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') - mkdir -p "tmp/artifact/$N" - (cd build && shopt -s nullglob && cp -ai --parents */upx{,.exe} */*/*/upx{,.exe} "../tmp/artifact/$N") - (cd tmp/artifact && tar --sort=name -czf "$N.tar.gz" "$N" && rm -rf "./$N") - # GitHub Actions magic: set "artifact_name" environment value for use in next step - echo "artifact_name=$N" >> $GITHUB_ENV - - name: ${{ format('Upload artifact {0}', env.artifact_name) }} - uses: actions/upload-artifact@v4 - with: - name: ${{ env.artifact_name }} - path: tmp/artifact - - - name: ${{ format('Run test suite under Wine') }} - if: ${{ matrix.wine }} - run: | - git clone --depth=1 https://github.com/upx/upx-testsuite ../upx-testsuite - testsuite_1="$(readlink -fn ./misc/testsuite/upx_testsuite_1.sh)" - export upx_exe_runner="wine" - if test "${{ matrix.i686_mingw }}" = "true"; then - UPX_TESTSUITE_LEVEL=2 \ - env -C build/extra/cross-windows-mingw32/debug upx_exe=./upx.exe bash "$testsuite_1" - UPX_TESTSUITE_LEVEL=4 \ - env -C build/extra/cross-windows-mingw32/release upx_exe=./upx.exe bash "$testsuite_1" - fi - UPX_TESTSUITE_LEVEL=2 \ - env -C build/extra/cross-windows-mingw64/debug upx_exe=./upx.exe bash "$testsuite_1" - UPX_TESTSUITE_LEVEL=4 \ - env -C build/extra/cross-windows-mingw64/release upx_exe=./upx.exe bash "$testsuite_1" - - - name: 'Run basic tests under Wine - mingw32/debug' - if: ${{ matrix.wine && matrix.i686_mingw }} - shell: bash - run: | - set -ex -o pipefail - cd build/extra/cross-windows-mingw32/debug - [[ -f upx && ! -f upx.exe ]] && mv -i -v upx upx.exe - pwd; file ./upx.exe - wine=wine - tt='./upx.exe' - $wine ./upx.exe --version-short - $wine ./upx.exe --sysinfo -v - $wine ./upx.exe -3 $tt -o tt.packed.exe - $wine ./upx.exe -l tt.packed.exe - $wine ./upx.exe -t tt.packed.exe - $wine ./upx.exe -d tt.packed.exe -o tt.unpacked.exe - $wine ./tt.packed.exe --version-short - $wine ./tt.unpacked.exe --version-short - - - name: 'Run basic tests under Wine - mingw32/release' - if: ${{ matrix.wine && matrix.i686_mingw }} - shell: bash - run: | - set -ex -o pipefail - cd build/extra/cross-windows-mingw32/release - [[ -f upx && ! -f upx.exe ]] && mv -i -v upx upx.exe - pwd; file ./upx.exe - wine=wine - tt='./upx.exe' - $wine ./upx.exe --version-short - $wine ./upx.exe --sysinfo -v - $wine ./upx.exe -3 $tt -o tt.packed.exe - $wine ./upx.exe -l tt.packed.exe - $wine ./upx.exe -t tt.packed.exe - $wine ./upx.exe -d tt.packed.exe -o tt.unpacked.exe - $wine ./tt.packed.exe --version-short - $wine ./tt.unpacked.exe --version-short - - - name: 'Run basic tests under Wine - mingw64/debug' - if: ${{ matrix.wine }} - shell: bash - run: | - set -ex -o pipefail - cd build/extra/cross-windows-mingw64/debug - [[ -f upx && ! -f upx.exe ]] && mv -i -v upx upx.exe - pwd; file ./upx.exe - wine=wine - tt='./upx.exe' - $wine ./upx.exe --version-short - $wine ./upx.exe --sysinfo -v - $wine ./upx.exe -3 $tt -o tt.packed.exe - $wine ./upx.exe -l tt.packed.exe - $wine ./upx.exe -t tt.packed.exe - $wine ./upx.exe -d tt.packed.exe -o tt.unpacked.exe - $wine ./tt.packed.exe --version-short - $wine ./tt.unpacked.exe --version-short - - - name: 'Run basic tests under Wine - mingw64/release' - if: ${{ matrix.wine }} - shell: bash - run: | - set -ex -o pipefail - cd build/extra/cross-windows-mingw64/release - [[ -f upx && ! -f upx.exe ]] && mv -i -v upx upx.exe - pwd; file ./upx.exe - wine=wine - tt='./upx.exe' - $wine ./upx.exe --version-short - $wine ./upx.exe --sysinfo -v - $wine ./upx.exe -3 $tt -o tt.packed.exe - $wine ./upx.exe -l tt.packed.exe - $wine ./upx.exe -t tt.packed.exe - $wine ./upx.exe -d tt.packed.exe -o tt.unpacked.exe - $wine ./tt.packed.exe --version-short - $wine ./tt.unpacked.exe --version-short - - - name: 'Run ctest tests under Wine - mingw32/debug' - if: ${{ matrix.wine && matrix.i686_mingw }} - run: 'make -C build/extra/cross-windows-mingw32/debug test' - - - name: 'Run ctest tests under Wine - mingw32/release' - if: ${{ matrix.wine && matrix.i686_mingw }} - run: 'make -C build/extra/cross-windows-mingw32/release test' - - - name: 'Run ctest tests under Wine - mingw64/debug' - if: ${{ matrix.wine }} - run: 'make -C build/extra/cross-windows-mingw64/debug test' - - - name: 'Run ctest tests under Wine - mingw64/release' - if: ${{ matrix.wine }} - run: 'make -C build/extra/cross-windows-mingw64/release test' - - - name: 'Mimic ctest tests under Wine - mingw32/debug' - if: ${{ matrix.wine && matrix.i686_mingw }} - run: 'env -C build/extra/cross-windows-mingw32/debug upx_exe=./upx.exe upx_exe_runner=wine bash "$PWD"/misc/testsuite/mimic_ctest.sh' - - - name: 'Mimic ctest tests under Wine - mingw32/release' - if: ${{ matrix.wine && matrix.i686_mingw }} - run: 'env -C build/extra/cross-windows-mingw32/release upx_exe=./upx.exe upx_exe_runner=wine bash "$PWD"/misc/testsuite/mimic_ctest.sh' - - - name: 'Mimic ctest tests under Wine - mingw64/debug' - if: ${{ matrix.wine }} - run: 'env -C build/extra/cross-windows-mingw64/debug upx_exe=./upx.exe upx_exe_runner=wine bash "$PWD"/misc/testsuite/mimic_ctest.sh' - - - name: 'Mimic ctest tests under Wine - mingw64/release' - if: ${{ matrix.wine }} - run: 'env -C build/extra/cross-windows-mingw64/release upx_exe=./upx.exe upx_exe_runner=wine bash "$PWD"/misc/testsuite/mimic_ctest.sh' diff --git a/.github/workflows/weekly-ci-cc-llvm-mingw.yml b/.github/workflows/weekly-ci-cc-llvm-mingw.yml deleted file mode 100644 index b3fd3a65..00000000 --- a/.github/workflows/weekly-ci-cc-llvm-mingw.yml +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer -# CC CompilationCheck: test llvm-mingw - -# see https://github.com/mstorsjo/llvm-mingw - -name: 'Weekly CI CC - llvm-mingw' -on: - schedule: [cron: '30 2 * * 3'] # run weekly Wednesday 02:30 UTC - workflow_dispatch: -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - UPX_CMAKE_CONFIG_FLAGS: -Wdev --warn-uninitialized - UPX_CONFIG_EXPECT_THREADS: 'ON' - -jobs: - job-llvm-mingw: # uses cmake + make - if: github.repository_owner == 'upx' - strategy: - fail-fast: false - matrix: - include: - - name: llvm-mingw-20230614-msvcrt - llvm_version: 16.0.6 - url: 'https://github.com/mstorsjo/llvm-mingw/releases/download/20230614/llvm-mingw-20230614-msvcrt-ubuntu-20.04-x86_64.tar.xz' - - name: llvm-mingw-20230614-ucrt - llvm_version: 16.0.6 - url: 'https://github.com/mstorsjo/llvm-mingw/releases/download/20230614/llvm-mingw-20230614-ucrt-ubuntu-20.04-x86_64.tar.xz' - - name: llvm-mingw-20231128-msvcrt - llvm_version: 17.0.6 - url: 'https://github.com/mstorsjo/llvm-mingw/releases/download/20231128/llvm-mingw-20231128-msvcrt-ubuntu-20.04-x86_64.tar.xz' - - name: llvm-mingw-20231128-ucrt - llvm_version: 17.0.6 - url: 'https://github.com/mstorsjo/llvm-mingw/releases/download/20231128/llvm-mingw-20231128-ucrt-ubuntu-20.04-x86_64.tar.xz' - name: ${{ format('{0} {1}', matrix.name, matrix.llvm_version) }} - runs-on: ubuntu-latest - steps: - - name: 'Check out code' - uses: actions/checkout@v4 - with: { submodules: true } - - name: ${{ format('Install {0} {1}', matrix.name, matrix.llvm_version) }} - run: | - mkdir -p -v ~/.local/bin - cd ~/.local/bin - wget -q '${{ matrix.url }}' - ls -l ./llvm-mingw*.tar.* - tar -xoaf ./llvm-mingw*.tar.* - rm ./llvm-mingw*.tar.* - # update PATH - cd ./llvm-mingw*/bin - echo "PATH=$PWD:$PATH" >> $GITHUB_ENV - - name: 'Build clang aarch64' - run: | - export CC="aarch64-w64-mingw32-clang -static" CXX="aarch64-w64-mingw32-clang++ -static" - CC="$CC -D_WIN32_WINNT=0x0400"; CXX="$CXX -D_WIN32_WINNT=0x0400" - export CMAKE_SYSTEM_NAME=Windows - 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" - export CMAKE_SYSTEM_NAME=Windows - 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" - export CMAKE_SYSTEM_NAME=Windows CMAKE_CROSSCOMPILING_EMULATOR=wine - 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" - export CMAKE_SYSTEM_NAME=Windows CMAKE_CROSSCOMPILING_EMULATOR=wine64 - make UPX_XTARGET=x86_64-w64-mingw32-clang xtarget/debug xtarget/release - - name: 'Make artifact' - run: | - N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-weekly-ci-${{ matrix.name }}-${{ matrix.llvm_version }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') - mkdir -p "tmp/artifact/$N" - (cd build && cp -ai --parents */*/*/upx.exe "../tmp/artifact/$N") - # GitHub Actions magic: set "artifact_name" environment value for use in next step - echo "artifact_name=$N" >> $GITHUB_ENV - - name: ${{ format('Upload artifact {0}', env.artifact_name) }} - uses: actions/upload-artifact@v4 - with: - name: ${{ env.artifact_name }} - path: tmp/artifact diff --git a/.github/workflows/weekly-ci-cc-zigcc.yml b/.github/workflows/weekly-ci-cc-zigcc.yml deleted file mode 100644 index 087f2923..00000000 --- a/.github/workflows/weekly-ci-cc-zigcc.yml +++ /dev/null @@ -1,131 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer -# CC CompilationCheck: test zigcc - -# build with "zig cc"; see https://ziglang.org/download/ - -name: 'Weekly CI CC - zigcc' -on: - schedule: [cron: '40 2 * * 3'] # run weekly Wednesday 02:40 UTC - workflow_dispatch: -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - # 2023-11-08 - ZIG_DIST_VERSION: 0.12.0-dev.1502+b3462b7ce - -jobs: - job-linux-zigcc: # uses cmake + make - if: github.repository_owner == 'upx' - strategy: - fail-fast: false - matrix: - include: - # zig BUG: -fPIE is currently broken - - { zig_target: aarch64-linux-musl } - # { zig_target: aarch64-linux-musl, zig_pic: -fPIE } - - { zig_target: aarch64-macos-none } - - { zig_target: aarch64-macos.11.0-none } - - { zig_target: aarch64-macos.12.0-none } - - { zig_target: aarch64-macos.13.0-none } - - { zig_target: aarch64-windows-gnu } - - { zig_target: arm-linux-musleabihf } - # { zig_target: arm-linux-musleabihf, zig_pic: -fPIE } - - { zig_target: i386-linux-musl } - # { zig_target: i386-linux-musl, zig_pic: -fPIE } - - { zig_target: i386-windows-gnu } - - { zig_target: mips-linux-musl } - - { zig_target: mipsel-linux-musl } - - { zig_target: powerpc-linux-musl } - - { zig_target: powerpc64-linux-musl } - - { zig_target: powerpc64le-linux-musl } - - { zig_target: x86_64-linux-musl } - # { zig_target: x86_64-linux-musl, zig_pic: -fPIE } - - { zig_target: x86_64-macos-none } - - { zig_target: x86_64-macos.11.0-none } - - { zig_target: x86_64-macos.12.0-none } - - { zig_target: x86_64-macos.13.0-none } - - { zig_target: x86_64-windows-gnu } - name: ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} - runs-on: ubuntu-latest - container: 'alpine:3.19' # older versions such as alpine:3.12 also work; no-container also works - env: - # for zig-cc wrapper scripts (see below): - ZIG_CPPFLAGS: -DUPX_DOCTEST_CONFIG_MULTITHREADING - ZIG_FLAGS: ${{ matrix.zig_flags }} - ZIG_PIC: ${{ matrix.zig_pic }} - ZIG_TARGET: ${{ matrix.zig_target }} - steps: - - name: 'Install Alpine Linux container packages' - if: ${{ job.container }} - shell: sh - run: | - apk update && apk upgrade && apk add bash cmake file git make tar xz - # set PATH like in Ubuntu - echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV - # this seems to be needed when running in a container (beause of UID mismatch??) - git config --global --add safe.directory '*' - - name: 'Check out code' - uses: actions/checkout@v4 - with: { submodules: true } - - name: ${{ format('Install Zig {0}', env.ZIG_DIST_VERSION) }} - shell: bash - run: | - # GitHub Actions magic: set "UPX_GITREV_SHORT" environment value for use in steps below - rev=$(git rev-parse --short=7 HEAD) - echo "UPX_GITREV_SHORT=$rev" >> $GITHUB_ENV - # update ZIG_TARGET (i386 => x86) - ZIG_TARGET=${ZIG_TARGET/i386-/x86-} - echo "ZIG_TARGET=$ZIG_TARGET" >> $GITHUB_ENV - # install zig; note that ~/.local/bin is included in the default $PATH on Ubuntu - mkdir -p -v ~/.local/bin - cd ~/.local/bin - ZIG_DIST_NAME=zig-linux-x86_64-${ZIG_DIST_VERSION} - wget -q https://ziglang.org/builds/${ZIG_DIST_NAME}.tar.xz - ls -l ${ZIG_DIST_NAME}.tar.xz - tar -xoJf ${ZIG_DIST_NAME}.tar.xz - rm ${ZIG_DIST_NAME}.tar.xz - ln -s -v ${ZIG_DIST_NAME}/zig zig - #echo "PATH=$PATH" && which zig - echo -n 'zig version: '; zig version - # create wrapper scripts (needed for CMake) - echo -e '#!/bin/sh\nexec zig ar "$@"' > zig-ar - echo -e '#!/bin/sh\nexec zig cc -target $ZIG_TARGET $ZIG_PIC $ZIG_FLAGS $ZIG_CPPFLAGS $ZIG_CFLAGS "$@"' > zig-cc - echo -e '#!/bin/sh\nexec zig c++ -target $ZIG_TARGET $ZIG_PIC $ZIG_FLAGS $ZIG_CPPFLAGS $ZIG_CXXFLAGS "$@"' > zig-cxx - echo -e '#!/bin/sh\nexec zig ranlib "$@"' > zig-ranlib - chmod +x zig-ar zig-cc zig-cxx zig-ranlib - ls -la; head zig-ar zig-cc zig-cxx zig-ranlib - - name: ${{ format('Build Release with zig-cc -target {0} {1}', env.ZIG_TARGET, env.ZIG_PIC) }} - run: | - mkdir -p build/zig/${ZIG_TARGET}${ZIG_PIC}/release - cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release - cmake ../../../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_AR=$HOME/.local/bin/zig-ar -DCMAKE_C_COMPILER=zig-cc -DCMAKE_CXX_COMPILER=zig-cxx -DCMAKE_RANLIB=$HOME/.local/bin/zig-ranlib $EXTRA_CMAKE_CONFIG_FLAGS_RELEASE - cmake --build . --config Release --parallel --verbose - file ./upx* - - name: ${{ format('Build Debug with zig-cc -target {0} {1}', env.ZIG_TARGET, env.ZIG_PIC) }} - run: | - mkdir -p build/zig/${ZIG_TARGET}${ZIG_PIC}/debug - cd build/zig/${ZIG_TARGET}${ZIG_PIC}/debug - cmake ../../../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_AR=$HOME/.local/bin/zig-ar -DCMAKE_C_COMPILER=zig-cc -DCMAKE_CXX_COMPILER=zig-cxx -DCMAKE_RANLIB=$HOME/.local/bin/zig-ranlib $EXTRA_CMAKE_CONFIG_FLAGS_DEBUG - cmake --build . --config Debug --parallel --verbose - file ./upx* - - name: ${{ format('Make artifact from upx-{0}-{1}', github.ref_name, env.UPX_GITREV_SHORT) }} - shell: bash - run: | - N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-weekly-ci-zigcc-${{ matrix.zig_target }}${ZIG_PIC}" | sed 's/[^0-9a-zA-Z_.-]/-/g') - mkdir -p "tmp/artifact/$N" - (cd build && shopt -s nullglob && cp -ai --parents */upx{,.exe} */*/*/upx{,.exe} "../tmp/artifact/$N") - (cd tmp/artifact && tar --sort=name -czf "$N.tar.gz" "$N" && rm -rf "./$N") - # GitHub Actions magic: set "artifact_name" environment value for use in next step - echo "artifact_name=$N" >> $GITHUB_ENV - - name: ${{ format('Upload artifact {0}', env.artifact_name) }} - uses: actions/upload-artifact@v4 - with: - name: ${{ env.artifact_name }} - path: tmp/artifact - - name: 'Run install tests' - if: ${{ contains(matrix.zig_target, '-linux') }} - run: | - (cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release && DESTDIR=$PWD/Install-with-cmake cmake --install .) - (cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release && DESTDIR=$PWD/Install-with-make make install) diff --git a/.github/workflows/weekly-ci-rt-checkers.yml b/.github/workflows/weekly-ci-rt-checkers.yml deleted file mode 100644 index 4e264b97..00000000 --- a/.github/workflows/weekly-ci-rt-checkers.yml +++ /dev/null @@ -1,112 +0,0 @@ -# Copyright (C) Markus Franz Xaver Johannes Oberhumer -# RT RunTime checks - -# runs ASAN, MSAN, qemu and valgrind checkers; slow! - -name: 'Weekly CI RT - ASAN MSAN Valgrind' -on: - schedule: [cron: '00 3 * * 3'] # run weekly Wednesday 03:00 UTC - workflow_dispatch: -env: - CMAKE_REQUIRED_QUIET: 'OFF' - CMAKE_VERBOSE_MAKEFILE: 'ON' - CTEST_OUTPUT_ON_FAILURE: 'ON' - DEBIAN_FRONTEND: noninteractive - -jobs: - job-runtime-checkers: # uses cmake + make - if: github.repository_owner == 'upx' - strategy: - fail-fast: false - matrix: - include: - # latest Alpine release + edge - - { container: 'alpine:3.19', release: debug, qemu: 'qemu-x86_64 -cpu Nehalem' } - - { container: 'alpine:3.19', release: release, qemu: 'qemu-x86_64 -cpu Nehalem' } - - { container: 'alpine:edge', release: release, qemu: 'qemu-x86_64 -cpu Nehalem' } - - { container: 'i386/alpine:3.19', release: release, qemu: 'qemu-i386' } - - { container: 'i386/alpine:edge', release: release, qemu: 'qemu-i386' } - name: ${{ format('{0} {1}', matrix.container, matrix.release) }} - runs-on: ubuntu-latest - container: ${{ matrix.container }} - env: - release: ${{ matrix.release }} - steps: - - name: ${{ format('Install packages {0} {1}', matrix.container, matrix.release) }} - run: | - apk update && apk upgrade - apk add bash clang cmake compiler-rt coreutils g++ git make qemu-i386 qemu-x86_64 tar valgrind - # this seems to be needed when running in a container (beause of UID mismatch??) - git config --global --add safe.directory '*' - - name: ${{ format('Check out UPX {0} source code', github.ref_name) }} - run: | - git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" . - git submodule update --init - git clone --depth=1 https://github.com/upx/upx-testsuite ../upx-testsuite - - - name: 'Build clang-static' - run: | - flags="-static -fno-omit-frame-pointer" - export CC="clang $flags" CXX="clang++ $flags" - make UPX_XTARGET=clang-static xtarget/$release - - name: 'Build clang-asan' - if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: ASAN not supported - run: | - # unfortunately ASAN does not support static linking - flags="-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined -fno-omit-frame-pointer" - export CC="clang $flags" CXX="clang++ $flags" - make UPX_XTARGET=clang-asan xtarget/$release - - name: 'Build clang-msan' - if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: MSAN not supported - run: | - # unfortunately MSAN does not support static linking - flags="-fsanitize=memory -fsanitize=undefined -fno-omit-frame-pointer -DDOCTEST_CONFIG_DISABLE=1" - export CC="clang $flags" CXX="clang++ $flags" - make UPX_XTARGET=clang-msan xtarget/$release - - - name: 'Make artifact' - run: | - N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-weekly-ci-runtime-checkers-${{ matrix.container }}-${{ matrix.release }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') - mkdir -p "tmp/artifact/$N" - (cd build && cp -ai --parents */*/*/upx "../tmp/artifact/$N") - (cd tmp/artifact && tar --sort=name -czf "$N.tar.gz" "$N" && rm -rf "./$N") - # GitHub Actions magic: set "artifact_name" environment value for use in next step - echo "artifact_name=$N" >> $GITHUB_ENV - - name: ${{ format('Upload artifact {0}', env.artifact_name) }} - if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: missing nodejs on host - uses: actions/upload-artifact@v4 - with: - name: ${{ env.artifact_name }} - path: tmp/artifact - - - name: 'Run ctest tests clang-static' - run: 'make -C build/xtarget/clang-static/$release test' - - name: 'Run ctest tests clang-asan' - if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: ASAN not supported - run: 'make -C build/xtarget/clang-asan/$release test' - - name: 'Run ctest tests clang-msan' - if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: MSAN not supported - run: 'make -C build/xtarget/clang-msan/$release test' - - - name: 'Run testsuite clang-asan' - if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: ASAN not supported - run: | - export ASAN_OPTIONS="detect_invalid_pointer_pairs=2" - env -C build/xtarget/clang-asan/$release "$PWD"/misc/testsuite/upx_testsuite_1.sh - - name: 'Run testsuite clang-msan' - if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: MSAN not supported - run: | - env -C build/xtarget/clang-msan/$release "$PWD"/misc/testsuite/upx_testsuite_1.sh - - name: 'Run testsuite clang-static - QEMU' - if: ${{ matrix.qemu }} - run: | - export upx_exe_runner="${{ matrix.qemu }}" - env -C build/xtarget/clang-static/$release "$PWD"/misc/testsuite/upx_testsuite_1.sh - - name: 'Run testsuite clang-static - Valgrind' - if: true # very slow - run: | - export upx_exe_runner="valgrind --error-exitcode=1 --quiet" - # on current GitHub CI, takes about 30 minutes for release and 80 minutes for debug builds - # reduce time for debug builds to about 30 minutes - test "$release" = "debug" && export UPX_TESTSUITE_LEVEL=4 - env -C build/xtarget/clang-static/$release "$PWD"/misc/testsuite/upx_testsuite_1.sh