CI updates
This commit is contained in:
+21
-21
@@ -137,10 +137,10 @@ jobs:
|
|||||||
dirs="$dirs cross-windows-mingw32/debug cross-windows-mingw32/release"
|
dirs="$dirs cross-windows-mingw32/debug cross-windows-mingw32/release"
|
||||||
dirs="$dirs cross-windows-mingw64/debug cross-windows-mingw64/release"
|
dirs="$dirs cross-windows-mingw64/debug cross-windows-mingw64/release"
|
||||||
fi
|
fi
|
||||||
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithDestdir/$d" cmake --install build/extra/$d; done
|
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdir/$d" cmake --install build/extra/$d; done
|
||||||
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithDestdirAndStrip/$d" cmake --install build/extra/$d --strip; done
|
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdirAndStrip/$d" cmake --install build/extra/$d --strip; done
|
||||||
for d in $dirs; do cmake --install build/extra/$d --prefix "$PWD/tmp/artifact/$N/InstallWithPrefix/$d"; done
|
for d in $dirs; do cmake --install build/extra/$d --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefix/$d"; done
|
||||||
for d in $dirs; do cmake --install build/extra/$d --prefix "$PWD/tmp/artifact/$N/InstallWithPrefixAndStrip/$d" --strip; done
|
for d in $dirs; do cmake --install build/extra/$d --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefixAndStrip/$d" --strip; done
|
||||||
(cd build && shopt -s nullglob && cp -ai --parents */upx{,.exe} */*/*/upx{,.exe} "../tmp/artifact/$N")
|
(cd build && shopt -s nullglob && cp -ai --parents */upx{,.exe} */*/*/upx{,.exe} "../tmp/artifact/$N")
|
||||||
if command -v hardlink >/dev/null; then (cd "tmp/artifact/$N" && hardlink .) fi
|
if command -v hardlink >/dev/null; then (cd "tmp/artifact/$N" && hardlink .) fi
|
||||||
(cd tmp/artifact && tar --sort=name --zstd -cf "$N.tar.zst" "$N" && rm -rf "./$N" && ls -la)
|
(cd tmp/artifact && tar --sort=name --zstd -cf "$N.tar.zst" "$N" && rm -rf "./$N" && ls -la)
|
||||||
@@ -275,13 +275,13 @@ jobs:
|
|||||||
mkdir -p "tmp/artifact/$N"
|
mkdir -p "tmp/artifact/$N"
|
||||||
dirs="clang/debug clang/release"
|
dirs="clang/debug clang/release"
|
||||||
test -n "${{ matrix.gcc }}" && dirs="$dirs gcc/debug gcc/release"
|
test -n "${{ matrix.gcc }}" && dirs="$dirs gcc/debug gcc/release"
|
||||||
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithDestdir/$d" cmake --install build/extra/$d; done
|
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdir/$d" cmake --install build/extra/$d; done
|
||||||
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithDestdirAndStrip/$d" cmake --install build/extra/$d --strip; done
|
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdirAndStrip/$d" cmake --install build/extra/$d --strip; done
|
||||||
for d in $dirs; do cmake --install build/extra/$d --prefix "$PWD/tmp/artifact/$N/InstallWithPrefix/$d"; done
|
for d in $dirs; do cmake --install build/extra/$d --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefix/$d"; done
|
||||||
for d in $dirs; do cmake --install build/extra/$d --prefix "$PWD/tmp/artifact/$N/InstallWithPrefixAndStrip/$d" --strip; done
|
for d in $dirs; do cmake --install build/extra/$d --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefixAndStrip/$d" --strip; done
|
||||||
(cd build && rsync -R -a */*/*/upx "../tmp/artifact/$N/")
|
(cd build && rsync -R -a */*/*/upx "../tmp/artifact/$N/")
|
||||||
hardlink="$HOMEBREW_PREFIX/opt/util-linux/bin/hardlink"
|
hardlink="$HOMEBREW_PREFIX/opt/util-linux/bin/hardlink"
|
||||||
if test -f "$hardlink"; then (cd "tmp/artifact/$N" && $hardlink .) fi
|
if test -f "$hardlink"; then (cd "tmp/artifact/$N" && "$hardlink" .) fi
|
||||||
(cd tmp/artifact && gtar --sort=name --zstd -cf "$N.tar.zst" "$N" && rm -rf "./$N" && ls -la)
|
(cd tmp/artifact && gtar --sort=name --zstd -cf "$N.tar.zst" "$N" && rm -rf "./$N" && ls -la)
|
||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
@@ -350,14 +350,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }}" | sed 's/[^0-9a-zA-Z_.-]/-/g')
|
N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }}" | sed 's/[^0-9a-zA-Z_.-]/-/g')
|
||||||
mkdir -p "tmp/artifact/$N"
|
mkdir -p "tmp/artifact/$N"
|
||||||
DESTDIR="$PWD/tmp/artifact/$N/InstallWithDestdir/debug" cmake --install build/debug --config Debug
|
DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdir/debug" cmake --install build/debug --config Debug
|
||||||
DESTDIR="$PWD/tmp/artifact/$N/InstallWithDestdir/release" cmake --install build/release --config Release
|
DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdir/release" cmake --install build/release --config Release
|
||||||
DESTDIR="$PWD/tmp/artifact/$N/InstallWithDestdirAndStrip/debug" cmake --install build/debug --config Debug --strip
|
DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdirAndStrip/debug" cmake --install build/debug --config Debug --strip
|
||||||
DESTDIR="$PWD/tmp/artifact/$N/InstallWithDestdirAndStrip/release" cmake --install build/release --config Release --strip
|
DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdirAndStrip/release" cmake --install build/release --config Release --strip
|
||||||
cmake --install build/debug --config Debug --prefix "$PWD/tmp/artifact/$N/InstallWithPrefix/debug"
|
cmake --install build/debug --config Debug --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefix/debug"
|
||||||
cmake --install build/release --config Release --prefix "$PWD/tmp/artifact/$N/InstallWithPrefix/release"
|
cmake --install build/release --config Release --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefix/release"
|
||||||
cmake --install build/debug --config Debug --prefix "$PWD/tmp/artifact/$N/InstallWithPrefixAndStrip/debug" --strip
|
cmake --install build/debug --config Debug --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefixAndStrip/debug" --strip
|
||||||
cmake --install build/release --config Release --prefix "$PWD/tmp/artifact/$N/InstallWithPrefixAndStrip/release" --strip
|
cmake --install build/release --config Release --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefixAndStrip/release" --strip
|
||||||
(cd build && cp -ai --parents */*/upx.exe "../tmp/artifact/$N")
|
(cd build && cp -ai --parents */*/upx.exe "../tmp/artifact/$N")
|
||||||
(cd tmp/artifact && tar --sort=name --zstd -cf "$N.tar.zst" "$N" && rm -rf "./$N" && ls -la)
|
(cd tmp/artifact && tar --sort=name --zstd -cf "$N.tar.zst" "$N" && rm -rf "./$N" && ls -la)
|
||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
@@ -602,10 +602,10 @@ jobs:
|
|||||||
mkdir -p "tmp/artifact/$N"
|
mkdir -p "tmp/artifact/$N"
|
||||||
if [[ "${{ matrix.zig_target }}" == *-linux* ]]; then
|
if [[ "${{ matrix.zig_target }}" == *-linux* ]]; then
|
||||||
dirs="${ZIG_TARGET}${ZIG_PIC}/debug ${ZIG_TARGET}${ZIG_PIC}/release"
|
dirs="${ZIG_TARGET}${ZIG_PIC}/debug ${ZIG_TARGET}${ZIG_PIC}/release"
|
||||||
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithDestdir/$d" cmake --install build/zig/$d; done
|
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdir/$d" cmake --install build/zig/$d; done
|
||||||
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithDestdirAndStrip/$d" cmake --install build/zig/$d --strip; done
|
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdirAndStrip/$d" cmake --install build/zig/$d --strip; done
|
||||||
for d in $dirs; do cmake --install build/zig/$d --prefix "$PWD/tmp/artifact/$N/InstallWithPrefix/$d"; done
|
for d in $dirs; do cmake --install build/zig/$d --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefix/$d"; done
|
||||||
for d in $dirs; do cmake --install build/zig/$d --prefix "$PWD/tmp/artifact/$N/InstallWithPrefixAndStrip/$d" --strip; done
|
for d in $dirs; do cmake --install build/zig/$d --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefixAndStrip/$d" --strip; done
|
||||||
fi
|
fi
|
||||||
(cd build && shopt -s nullglob && cp -ai --parents */upx{,.exe} */*/*/upx{,.exe} "../tmp/artifact/$N")
|
(cd build && shopt -s nullglob && cp -ai --parents */upx{,.exe} */*/*/upx{,.exe} "../tmp/artifact/$N")
|
||||||
if command -v hardlink >/dev/null; then (cd "tmp/artifact/$N" && hardlink .) fi
|
if command -v hardlink >/dev/null; then (cd "tmp/artifact/$N" && hardlink .) fi
|
||||||
|
|||||||
@@ -187,6 +187,26 @@ TEST_CASE("upx::noncopyable") {
|
|||||||
// <type_traits>
|
// <type_traits>
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
static_assert(!upx::is_bounded_array_v<std::nullptr_t>);
|
||||||
|
static_assert(!upx::is_bounded_array_v<decltype(nullptr)>);
|
||||||
|
static_assert(!upx::is_bounded_array_v<void *>);
|
||||||
|
static_assert(!upx::is_bounded_array_v<int *>);
|
||||||
|
static_assert(!upx::is_bounded_array_v<const int *>);
|
||||||
|
static_assert(!upx::is_bounded_array_v<volatile int *>);
|
||||||
|
static_assert(!upx::is_bounded_array_v<const volatile int *>);
|
||||||
|
static_assert(upx::is_bounded_array_v<int[1]>);
|
||||||
|
static_assert(upx::is_bounded_array_v<const int[1]>);
|
||||||
|
static_assert(upx::is_bounded_array_v<volatile int[1]>);
|
||||||
|
static_assert(upx::is_bounded_array_v<const volatile int[1]>);
|
||||||
|
static_assert(upx::is_bounded_array_v<int[1u]>);
|
||||||
|
static_assert(upx::is_bounded_array_v<const int[1u]>);
|
||||||
|
static_assert(upx::is_bounded_array_v<volatile int[1u]>);
|
||||||
|
static_assert(upx::is_bounded_array_v<const volatile int[1u]>);
|
||||||
|
static_assert(upx::is_bounded_array_v<int[1l]>);
|
||||||
|
static_assert(upx::is_bounded_array_v<const int[1l]>);
|
||||||
|
static_assert(upx::is_bounded_array_v<volatile int[1l]>);
|
||||||
|
static_assert(upx::is_bounded_array_v<const volatile int[1l]>);
|
||||||
|
|
||||||
static_assert(upx::is_same_all_v<int>);
|
static_assert(upx::is_same_all_v<int>);
|
||||||
static_assert(upx::is_same_all_v<int, int>);
|
static_assert(upx::is_same_all_v<int, int>);
|
||||||
static_assert(upx::is_same_all_v<int, int, int>);
|
static_assert(upx::is_same_all_v<int, int, int>);
|
||||||
@@ -211,6 +231,36 @@ static_assert(!upx::is_same_any_v<upx_uintptr_t, unsigned, unsigned long, unsign
|
|||||||
static_assert(upx::is_same_any_v<upx_uintptr_t, unsigned, unsigned long, unsigned long long>);
|
static_assert(upx::is_same_any_v<upx_uintptr_t, unsigned, unsigned long, unsigned long long>);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static_assert(std::is_same_v<int, upx::remove_cvref_t<int> >);
|
||||||
|
static_assert(std::is_same_v<int, upx::remove_cvref_t<const int> >);
|
||||||
|
static_assert(std::is_same_v<int, upx::remove_cvref_t<int &> >);
|
||||||
|
static_assert(std::is_same_v<int, upx::remove_cvref_t<const int &> >);
|
||||||
|
static_assert(std::is_same_v<int, upx::remove_cvref_t<int &&> >);
|
||||||
|
static_assert(std::is_same_v<int, upx::remove_cvref_t<const int &&> >);
|
||||||
|
static_assert(std::is_same_v<int *, upx::remove_cvref_t<int *> >);
|
||||||
|
static_assert(std::is_same_v<int *, upx::remove_cvref_t<int *const> >);
|
||||||
|
static_assert(std::is_same_v<const int *, upx::remove_cvref_t<const int *> >);
|
||||||
|
static_assert(std::is_same_v<int *, upx::remove_cvref_t<int *&> >);
|
||||||
|
static_assert(std::is_same_v<int *, upx::remove_cvref_t<int *const &> >);
|
||||||
|
static_assert(std::is_same_v<const int *, upx::remove_cvref_t<const int *&> >);
|
||||||
|
static_assert(std::is_same_v<int *, upx::remove_cvref_t<int *&&> >);
|
||||||
|
static_assert(std::is_same_v<int *, upx::remove_cvref_t<int *const &&> >);
|
||||||
|
static_assert(std::is_same_v<const int *, upx::remove_cvref_t<const int *&&> >);
|
||||||
|
static_assert(std::is_same_v<int[1], upx::remove_cvref_t<int[1]> >);
|
||||||
|
static_assert(std::is_same_v<int[1], upx::remove_cvref_t<const int[1]> >);
|
||||||
|
|
||||||
|
static_assert(std::is_same_v<int, upx::type_identity_t<int> >);
|
||||||
|
static_assert(std::is_same_v<const int, upx::type_identity_t<const int> >);
|
||||||
|
static_assert(std::is_same_v<int *, upx::type_identity_t<int *> >);
|
||||||
|
static_assert(std::is_same_v<int *const, upx::type_identity_t<int *const> >);
|
||||||
|
static_assert(std::is_same_v<const int *, upx::type_identity_t<const int *> >);
|
||||||
|
static_assert(std::is_same_v<int &, upx::type_identity_t<int &> >);
|
||||||
|
static_assert(std::is_same_v<const int &, upx::type_identity_t<const int &> >);
|
||||||
|
static_assert(std::is_same_v<int &&, upx::type_identity_t<int &&> >);
|
||||||
|
static_assert(std::is_same_v<const int &&, upx::type_identity_t<const int &&> >);
|
||||||
|
static_assert(std::is_same_v<int[1], upx::type_identity_t<int[1]> >);
|
||||||
|
static_assert(std::is_same_v<const int[1], upx::type_identity_t<const int[1]> >);
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
// <bit>
|
// <bit>
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|||||||
+4
-1
@@ -1211,6 +1211,7 @@ int upx_main(int argc, char *argv[]) may_throw {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Allow serial re-use of upx_main() as a subroutine
|
// Allow serial re-use of upx_main() as a subroutine
|
||||||
|
exit_code = EXIT_OK;
|
||||||
opt->reset();
|
opt->reset();
|
||||||
|
|
||||||
#if (ACC_OS_CYGWIN || ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_EMX || ACC_OS_TOS || ACC_OS_WIN16 || \
|
#if (ACC_OS_CYGWIN || ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_EMX || ACC_OS_TOS || ACC_OS_WIN16 || \
|
||||||
@@ -1313,8 +1314,10 @@ int upx_main(int argc, char *argv[]) may_throw {
|
|||||||
|
|
||||||
/* start work */
|
/* start work */
|
||||||
set_term(stdout);
|
set_term(stdout);
|
||||||
if (do_files(i, argc, argv) != 0)
|
if (do_files(i, argc, argv) != 0) {
|
||||||
|
assert(exit_code != 0);
|
||||||
return exit_code;
|
return exit_code;
|
||||||
|
}
|
||||||
|
|
||||||
if (gitrev[0]) {
|
if (gitrev[0]) {
|
||||||
// also see UPX_CONFIG_DISABLE_GITREV in CMakeLists.txt
|
// also see UPX_CONFIG_DISABLE_GITREV in CMakeLists.txt
|
||||||
|
|||||||
+17
-1
@@ -156,7 +156,7 @@ protected:
|
|||||||
// <type_traits>
|
// <type_traits>
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
// is_bounded_array: identical to C++20 std::is_bounded_array
|
// is_bounded_array from C++20
|
||||||
template <class T>
|
template <class T>
|
||||||
struct is_bounded_array : public std::false_type {};
|
struct is_bounded_array : public std::false_type {};
|
||||||
template <class T, std::size_t N>
|
template <class T, std::size_t N>
|
||||||
@@ -174,6 +174,22 @@ struct is_same_any : public std::disjunction<std::is_same<T, Ts>...> {};
|
|||||||
template <class T, class... Ts>
|
template <class T, class... Ts>
|
||||||
inline constexpr bool is_same_any_v = is_same_any<T, Ts...>::value;
|
inline constexpr bool is_same_any_v = is_same_any<T, Ts...>::value;
|
||||||
|
|
||||||
|
// remove_cvref from C++20
|
||||||
|
template <class T>
|
||||||
|
struct remove_cvref {
|
||||||
|
typedef typename std::remove_cv<typename std::remove_reference<T>::type>::type type;
|
||||||
|
};
|
||||||
|
template <class T>
|
||||||
|
using remove_cvref_t = typename remove_cvref<T>::type;
|
||||||
|
|
||||||
|
// type_identity from C++20
|
||||||
|
template <class T>
|
||||||
|
struct type_identity {
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
template <class T>
|
||||||
|
using type_identity_t = typename type_identity<T>::type;
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
// <bit> C++20
|
// <bit> C++20
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|||||||
Reference in New Issue
Block a user