diff --git a/.cirrus.yml b/.cirrus.yml index 4fddac539..3a7f635d9 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -5,18 +5,16 @@ task: install_script: | pkg install -y \ git \ - meson \ - ninja \ - npm \ - py39-pip - pip install meson==0.64.0 + npm compile_script: | - meson setup \ - --default-library static \ - -Doptimization=s \ - -Dgumpp=enabled \ - -Dgumjs=enabled \ - -Db_lundef=false \ - build - meson compile -C build - test_script: ./build/tests/gum-tests + ./configure \ + --enable-gumpp \ + --enable-gumjs \ + --with-devkits=gum,gumjs \ + --enable-tests + make + gum_devkit_artifacts: + path: "build/gum/devkit/*" + gumjs_devkit_artifacts: + path: "build/bindings/gumjs/devkit/*" + test_script: make test diff --git a/.github/env/bootstrap.sh b/.github/env/bootstrap.sh deleted file mode 100755 index fe3056cc8..000000000 --- a/.github/env/bootstrap.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -build_os_arch=$1 -host_os_arch=$2 - -build_arch=$(echo $build_os_arch | cut -d"-" -f2) -host_arch=$(echo $host_os_arch | cut -d"-" -f2) - -envdir=`dirname $0` -outdir=/tmp - -set -ex - -mkdir -p $outdir/toolchain $outdir/native-sdk $outdir/cross-sdk -deps_url=https://build.frida.re/deps/20240118 -curl $deps_url/toolchain-$build_os_arch.tar.bz2 | tar -C $outdir/toolchain -xjf - -curl $deps_url/sdk-$build_os_arch.tar.bz2 | tar -C $outdir/native-sdk -xjf - -curl $deps_url/sdk-$host_os_arch.tar.bz2 | tar -C $outdir/cross-sdk -xjf - - -for machine in native cross; do - ( - echo "#!/bin/sh" - echo "export PKG_CONFIG_PATH=$outdir/$machine-sdk/lib/pkgconfig" - echo "exec $outdir/toolchain/bin/pkg-config --define-variable=frida_sdk_prefix=$outdir/$machine-sdk --static \"\$@\"" - ) > $outdir/$machine-pkg-config - chmod +x $outdir/$machine-pkg-config -done - -case ${build_arch}__${host_arch} in - x86_64__x86) - needs_exe_wrapper=false - ;; - *) - needs_exe_wrapper=true - ;; -esac - -$envdir/emit-$build_os_arch.sh $outdir/native-pkg-config false > $outdir/native.txt -$envdir/emit-$host_os_arch.sh $outdir/cross-pkg-config $needs_exe_wrapper > $outdir/cross.txt diff --git a/.github/env/emit-android-arm.sh b/.github/env/emit-android-arm.sh deleted file mode 100755 index bd237b6ac..000000000 --- a/.github/env/emit-android-arm.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -bindir=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$(uname -s | tr '[A-Z]' '[a-z]')-$(uname -m)/bin - -cat << EOF -[constants] -c_like_flags = ['-DANDROID', '-march=armv7-a', '-mfloat-abi=softfp', '-mfpu=vfpv3-d16', '-mthumb', '-ffunction-sections', '-fdata-sections'] -linker_flags = ['-Wl,--gc-sections', '-Wl,-z,noexecstack', '-Wl,-z,relro', '-Wl,-z,now'] - -[binaries] -c = '$bindir/armv7a-linux-androideabi19-clang' -cpp = '$bindir/armv7a-linux-androideabi19-clang++' -ar = '$bindir/llvm-ar' -nm = '$bindir/llvm-nm' -readelf = '$bindir/llvm-readelf' -strip = '$bindir/llvm-strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = c_like_flags -cpp_args = c_like_flags -c_link_args = linker_flags -cpp_link_args = linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'linux' -cpu_family = 'arm' -cpu = 'armv7eabi' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-android-arm64.sh b/.github/env/emit-android-arm64.sh deleted file mode 100755 index 0bfd5f3f4..000000000 --- a/.github/env/emit-android-arm64.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -bindir=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$(uname -s | tr '[A-Z]' '[a-z]')-$(uname -m)/bin - -cat << EOF -[constants] -c_like_flags = ['-DANDROID', '-ffunction-sections', '-fdata-sections'] -linker_flags = ['-Wl,--gc-sections', '-Wl,-z,noexecstack', '-Wl,-z,relro', '-Wl,-z,now'] - -[binaries] -c = '$bindir/aarch64-linux-android21-clang' -cpp = '$bindir/aarch64-linux-android21-clang++' -ar = '$bindir/llvm-ar' -nm = '$bindir/llvm-nm' -readelf = '$bindir/llvm-readelf' -strip = '$bindir/llvm-strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = c_like_flags -cpp_args = c_like_flags -c_link_args = linker_flags -cpp_link_args = linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'linux' -cpu_family = 'aarch64' -cpu = 'aarch64' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-android-x86.sh b/.github/env/emit-android-x86.sh deleted file mode 100755 index 6f380e326..000000000 --- a/.github/env/emit-android-x86.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -bindir=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$(uname -s | tr '[A-Z]' '[a-z]')-$(uname -m)/bin - -cat << EOF -[constants] -c_like_flags = ['-DANDROID', '-march=pentium4', '-mfpmath=sse', '-mstackrealign', '-ffunction-sections', '-fdata-sections'] -linker_flags = ['-Wl,--gc-sections', '-Wl,-z,noexecstack', '-Wl,-z,relro', '-Wl,-z,now'] - -[binaries] -c = '$bindir/i686-linux-android19-clang' -cpp = '$bindir/i686-linux-android19-clang++' -ar = '$bindir/llvm-ar' -nm = '$bindir/llvm-nm' -readelf = '$bindir/llvm-readelf' -strip = '$bindir/llvm-strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = c_like_flags -cpp_args = c_like_flags -c_link_args = linker_flags -cpp_link_args = linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'android' -cpu_family = 'x86' -cpu = 'i686' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-android-x86_64.sh b/.github/env/emit-android-x86_64.sh deleted file mode 100755 index d7fb58c3a..000000000 --- a/.github/env/emit-android-x86_64.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -bindir=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$(uname -s | tr '[A-Z]' '[a-z]')-$(uname -m)/bin - -cat << EOF -[constants] -c_like_flags = ['-DANDROID', '-ffunction-sections', '-fdata-sections'] -linker_flags = ['-Wl,--gc-sections', '-Wl,-z,noexecstack', '-Wl,-z,relro', '-Wl,-z,now'] - -[binaries] -c = '$bindir/x86_64-linux-android21-clang' -cpp = '$bindir/x86_64-linux-android21-clang++' -ar = '$bindir/llvm-ar' -nm = '$bindir/llvm-nm' -readelf = '$bindir/llvm-readelf' -strip = '$bindir/llvm-strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = c_like_flags -cpp_args = c_like_flags -c_link_args = linker_flags -cpp_link_args = linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'android' -cpu_family = 'x86_64' -cpu = 'x86_64' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-ios-arm64.sh b/.github/env/emit-ios-arm64.sh deleted file mode 100755 index a391dd94c..000000000 --- a/.github/env/emit-ios-arm64.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -sdk=iphoneos - -cat << EOF -[constants] -common_flags = ['-target', 'arm64-apple-ios8.0', '-isysroot', '$(xcrun --sdk $sdk --show-sdk-path)'] -linker_flags = ['-Wl,-dead_strip'] - -[binaries] -c = ['$(xcrun --sdk $sdk -f clang)'] + common_flags -cpp = ['$(xcrun --sdk $sdk -f clang++)'] + common_flags -objc = ['$(xcrun --sdk $sdk -f clang)'] + common_flags -objcpp = ['$(xcrun --sdk $sdk -f clang++)'] + common_flags -ar = '$(xcrun --sdk $sdk -f ar)' -nm = '$(xcrun --sdk $sdk -f nm)' -strip = '$(xcrun --sdk $sdk -f strip)' -pkgconfig = '$pkgconfig' - -[built-in options] -c_link_args = linker_flags -cpp_link_args = linker_flags - -[host_machine] -system = 'darwin' -cpu_family = 'aarch64' -cpu = 'aarch64' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-linux-mips.sh b/.github/env/emit-linux-mips.sh deleted file mode 100755 index a1ad4b0b7..000000000 --- a/.github/env/emit-linux-mips.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -toolpfx=mips-linux-gnu- - -cat << EOF -[constants] -base_flags = ['-march=mips1', '-mfp32'] -c_like_flags = ['-ffunction-sections', '-fdata-sections'] -linker_flags = ['-static-libgcc', '-Wl,--gc-sections', '-Wl,-z,noexecstack'] - -[binaries] -c = '${toolpfx}gcc' -cpp = '${toolpfx}g++' -ar = '${toolpfx}ar' -nm = '${toolpfx}nm' -readelf = '${toolpfx}readelf' -strip = '${toolpfx}strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = base_flags + c_like_flags -cpp_args = base_flags + c_like_flags -c_link_args = base_flags + linker_flags -cpp_link_args = base_flags + linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'linux' -cpu_family = 'mips' -cpu = 'mips1' -endian = 'big' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-linux-mips64.sh b/.github/env/emit-linux-mips64.sh deleted file mode 100755 index c85ad289e..000000000 --- a/.github/env/emit-linux-mips64.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -toolpfx=mips64-linux-gnuabi64- - -cat << EOF -[constants] -base_flags = ['-march=mips64r2', '-mabi=64'] -c_like_flags = ['-ffunction-sections', '-fdata-sections'] -linker_flags = ['-static-libgcc', '-Wl,--gc-sections', '-Wl,-z,noexecstack'] - -[binaries] -c = '${toolpfx}gcc' -cpp = '${toolpfx}g++' -ar = '${toolpfx}ar' -nm = '${toolpfx}nm' -readelf = '${toolpfx}readelf' -strip = '${toolpfx}strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = base_flags + c_like_flags -cpp_args = base_flags + c_like_flags -c_link_args = base_flags + linker_flags -cpp_link_args = base_flags + linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'linux' -cpu_family = 'mips64' -cpu = 'mips64r2' -endian = 'big' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-linux-mips64el.sh b/.github/env/emit-linux-mips64el.sh deleted file mode 100755 index 2bfde8850..000000000 --- a/.github/env/emit-linux-mips64el.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -toolpfx=mips64el-linux-gnuabi64- - -cat << EOF -[constants] -base_flags = ['-march=mips64r2', '-mabi=64'] -c_like_flags = ['-ffunction-sections', '-fdata-sections'] -linker_flags = ['-static-libgcc', '-Wl,--gc-sections', '-Wl,-z,noexecstack'] - -[binaries] -c = '${toolpfx}gcc' -cpp = '${toolpfx}g++' -ar = '${toolpfx}ar' -nm = '${toolpfx}nm' -readelf = '${toolpfx}readelf' -strip = '${toolpfx}strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = base_flags + c_like_flags -cpp_args = base_flags + c_like_flags -c_link_args = base_flags + linker_flags -cpp_link_args = base_flags + linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'linux' -cpu_family = 'mips64' -cpu = 'mips64r2' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-linux-mipsel.sh b/.github/env/emit-linux-mipsel.sh deleted file mode 100755 index d4950ef3e..000000000 --- a/.github/env/emit-linux-mipsel.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -toolpfx=mipsel-linux-gnu- - -cat << EOF -[constants] -base_flags = ['-march=mips1', '-mfp32'] -c_like_flags = ['-ffunction-sections', '-fdata-sections'] -linker_flags = ['-static-libgcc', '-Wl,--gc-sections', '-Wl,-z,noexecstack'] - -[binaries] -c = '${toolpfx}gcc' -cpp = '${toolpfx}g++' -ar = '${toolpfx}ar' -nm = '${toolpfx}nm' -readelf = '${toolpfx}readelf' -strip = '${toolpfx}strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = base_flags + c_like_flags -cpp_args = base_flags + c_like_flags -c_link_args = base_flags + linker_flags -cpp_link_args = base_flags + linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'linux' -cpu_family = 'mips' -cpu = 'mips1' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-linux-x86.sh b/.github/env/emit-linux-x86.sh deleted file mode 100755 index 0e2f3bf1b..000000000 --- a/.github/env/emit-linux-x86.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -cat << EOF -[constants] -c_like_flags = ['-ffunction-sections', '-fdata-sections'] -linker_flags = ['-Wl,--gc-sections', '-Wl,-z,noexecstack', '-Wl,-z,relro', '-Wl,-z,now'] - -[binaries] -c = ['gcc', '-m32'] -cpp = ['g++', '-m32'] -ar = 'ar' -nm = 'nm' -readelf = 'readelf' -strip = 'strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = c_like_flags -cpp_args = c_like_flags -c_link_args = linker_flags -cpp_link_args = linker_flags - -[host_machine] -system = 'linux' -cpu_family = 'x86' -cpu = 'i686' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-linux-x86_64.sh b/.github/env/emit-linux-x86_64.sh deleted file mode 100755 index b28c9bb0f..000000000 --- a/.github/env/emit-linux-x86_64.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -cat << EOF -[constants] -c_like_flags = ['-ffunction-sections', '-fdata-sections'] -linker_flags = ['-Wl,--gc-sections', '-Wl,-z,noexecstack', '-Wl,-z,relro', '-Wl,-z,now'] - -[binaries] -c = 'gcc' -cpp = 'g++' -ar = 'ar' -nm = 'nm' -readelf = 'readelf' -strip = 'strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = c_like_flags -cpp_args = c_like_flags -c_link_args = linker_flags -cpp_link_args = linker_flags - -[host_machine] -system = 'linux' -cpu_family = 'x86_64' -cpu = 'x86_64' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-macos-x86_64.sh b/.github/env/emit-macos-x86_64.sh deleted file mode 100755 index 4fff84c86..000000000 --- a/.github/env/emit-macos-x86_64.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -sdk=macosx - -cat << EOF -[constants] -common_flags = ['-target', 'x86_64-apple-macos10.9', '-isysroot', '$(xcrun --sdk $sdk --show-sdk-path)'] -linker_flags = ['-Wl,-dead_strip'] - -[binaries] -c = ['$(xcrun --sdk $sdk -f clang)'] + common_flags -cpp = ['$(xcrun --sdk $sdk -f clang++)'] + common_flags -objc = ['$(xcrun --sdk $sdk -f clang)'] + common_flags -objcpp = ['$(xcrun --sdk $sdk -f clang++)'] + common_flags -ar = '$(xcrun --sdk $sdk -f ar)' -nm = '$(xcrun --sdk $sdk -f nm)' -strip = '$(xcrun --sdk $sdk -f strip)' -pkgconfig = '$pkgconfig' - -[built-in options] -c_link_args = linker_flags -cpp_link_args = linker_flags - -[host_machine] -system = 'darwin' -cpu_family = 'x86_64' -cpu = 'x86_64' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-qnx-armeabi.sh b/.github/env/emit-qnx-armeabi.sh deleted file mode 100755 index 203e5144a..000000000 --- a/.github/env/emit-qnx-armeabi.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -toolpfx=$QNX_HOST/usr/bin/arm-unknown-nto-qnx6.5.0eabi- -sysroot=$QNX_TARGET/armle-v7 - -cat << EOF -[constants] -base_flags = ['--sysroot=$sysroot', '-march=armv7-a'] -c_like_flags = ['-mno-unaligned-access', '-ffunction-sections', '-fdata-sections'] -linker_flags = ['-static-libgcc', '-Wl,--gc-sections'] - -[binaries] -c = '${toolpfx}gcc' -cpp = '${toolpfx}g++' -ar = '${toolpfx}ar' -nm = '${toolpfx}nm' -readelf = '${toolpfx}readelf' -strip = '${toolpfx}strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = base_flags + c_like_flags -cpp_args = base_flags + c_like_flags -c_link_args = base_flags + linker_flags -cpp_link_args = base_flags + linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'qnx' -cpu_family = 'arm' -cpu = 'armv7' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76f7ebd65..f8f666c5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,238 +9,161 @@ on: - main env: - PYTHON_VERSION: 3.11 - MESON_VERSION: 0.64.0 + GUM_OPTIONS: '--enable-gumpp --enable-gumjs --with-devkits=gum,gumjs --enable-tests' jobs: gir: - if: false - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Check out repo - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/checkout@v4 with: - python-version: '${{ env.PYTHON_VERSION }}' + submodules: recursive - name: Install dependencies run: | - sudo apt-get update sudo apt-get install \ - gobject-introspection \ - libdwarf-dev \ - libelf-dev \ - libgirepository1.0-dev \ - libglib2.0-dev \ - libjson-glib-dev \ - libsoup-3.0-dev \ - libsqlite3-dev \ - libunwind-dev \ - ninja-build - pip install meson==${{ env.MESON_VERSION }} + gobject-introspection \ + libdwarf-dev \ + libelf-dev \ + libgirepository1.0-dev \ + libglib2.0-dev \ + libjson-glib-dev \ + libsoup-3.0-dev \ + libsqlite3-dev \ + libunwind-dev \ + ninja-build - name: Build run: | - meson setup \ - -Doptimization=s \ - -Dgumpp=enabled \ - -Dgumjs=enabled \ - build - meson compile -C build + ./configure \ + --enable-shared \ + --without-prebuilds=toolchain,sdk \ + ${{ env.GUM_OPTIONS }} + make + - name: Upload GObject introspection data + uses: actions/upload-artifact@v4 + with: + name: gum-gir + path: | + build/gum/Gum-1.0.gir + build/gum/Gum-1.0.typelib - desktop: + native: strategy: matrix: - name: - - windows-x86_64 - - windows-x86 - - macos-x86_64 - - linux-x86_64 include: - - name: windows-x86_64 - os: windows - arch: x86_64 - runner: windows-latest - - name: windows-x86 - os: windows - arch: x86 - runner: windows-latest - - name: macos-x86_64 - os: macos - arch: x86_64 - runner: macos-latest - - name: macos-arm64 - os: macos - arch: arm64 - runner: macos-12-arm64 - - name: linux-x86_64 - os: linux - arch: x86_64 - runner: ubuntu-latest + - { id: windows-x86_64, runner: '"windows-latest"' } + - { id: windows-x86, runner: '"windows-latest"' } + - { id: macos-x86_64, runner: '"macos-latest"' } + - { id: macos-arm64, runner: '"macos-14"' } + - { id: linux-x86_64, runner: '"ubuntu-latest"' } + - { id: linux-x86, runner: '"ubuntu-latest"' } + - { id: freebsd-arm64, runner: '["self-hosted", "freebsd", "arm64"]' } fail-fast: false - runs-on: ${{ matrix.runner }} - env: - FRIDA_MESON_OPTIONS: "-Dgumpp=enabled -Dgumjs=enabled -Ddevkits=gum,gumjs" + runs-on: ${{ fromJSON(matrix.runner) }} steps: - name: Check out repo uses: actions/checkout@v4 with: submodules: recursive - - name: Set up MSVS environment - if: ${{ matrix.os == 'windows' }} - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: ${{ matrix.arch }} + - name: Install gcc-multilib + if: matrix.id == 'linux-x86' + run: sudo apt-get install gcc-multilib lib32stdc++-11-dev - name: Build - if: ${{ matrix.os == 'windows' }} + if: ${{ startsWith(matrix.id, 'windows-') }} run: | - .\configure -- ${Env:FRIDA_MESON_OPTIONS}.Split(' ') + .\configure ${{ env.GUM_OPTIONS }} .\make - name: Build - if: ${{ matrix.os != 'windows' }} + if: ${{ !startsWith(matrix.id, 'windows-') && matrix.id != 'linux-x86' }} + run: | + ./configure ${{ env.GUM_OPTIONS }} + make + - name: Build + if: matrix.id == 'linux-x86' run: | - ./configure -- $FRIDA_MESON_OPTIONS + CC="gcc -m32" CXX="g++ -m32" STRIP="strip" \ + ./configure --build=linux-x86 --host=linux-x86 ${{ env.GUM_OPTIONS }} make - name: Upload Gum devkit uses: actions/upload-artifact@v4 with: - name: frida-gum-devkit-${{ matrix.os }}-${{ matrix.arch }} + name: gum-devkit-${{ matrix.id }} path: build/gum/devkit/ - name: Upload GumJS devkit uses: actions/upload-artifact@v4 with: - name: frida-gumjs-devkit-${{ matrix.os }}-${{ matrix.arch }} + name: gumjs-devkit-${{ matrix.id }} path: build/bindings/gumjs/devkit/ - name: Test run: make test - linux-x86: - if: false + cross: + strategy: + matrix: + include: + - { id: linux-mips, opts: '--host=mips-linux-gnu', pkg: g++-mips-linux-gnu } + - { id: linux-mipsel, opts: '--host=mipsel-linux-gnu', pkg: g++-mipsel-linux-gnu } + - { id: linux-mips64, opts: '--host=mips64-linux-gnuabi64', pkg: g++-mips64-linux-gnuabi64 } + - { id: linux-mips64el, opts: '--host=mips64el-linux-gnuabi64', pkg: g++-mips64el-linux-gnuabi64 } + fail-fast: false runs-on: ubuntu-latest steps: - name: Check out repo - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/checkout@v4 with: - python-version: '${{ env.PYTHON_VERSION }}' - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install gcc-multilib lib32stdc++-11-dev - pip install meson==${{ env.MESON_VERSION }} - .github/env/bootstrap.sh linux-x86_64 linux-x86 + submodules: recursive + - name: Install toolchain + run: sudo apt-get install ${{ matrix.pkg }} - name: Build run: | - export PATH="/tmp/toolchain/bin:$PATH" - meson setup \ - --native-file /tmp/native.txt \ - --cross-file /tmp/cross.txt \ - --default-library static \ - --force-fallback-for=glib \ - -Doptimization=s \ - -Dwerror=true \ - -Dgumpp=enabled \ - -Dgumjs=enabled \ - build - meson compile -C build - - name: Test - run: ./build/tests/gum-tests + ./configure ${{ matrix.opts }} ${{ env.GUM_OPTIONS }} + make + - name: Upload Gum devkit + uses: actions/upload-artifact@v4 + with: + name: gum-devkit-${{ matrix.id }} + path: build/gum/devkit/ + - name: Upload GumJS devkit + uses: actions/upload-artifact@v4 + with: + name: gumjs-devkit-${{ matrix.id }} + path: build/bindings/gumjs/devkit/ - linux-mips: - runs-on: ubuntu-latest - if: false + mobile: strategy: matrix: - arch: - - id: mips - pkg: g++-mips-linux-gnu - - id: mipsel - pkg: g++-mipsel-linux-gnu - - id: mips64 - pkg: g++-mips64-linux-gnuabi64 - - id: mips64el - pkg: g++-mips64el-linux-gnuabi64 - steps: - - name: Check out repo - uses: actions/checkout@v3 - - name: Install Python - uses: actions/setup-python@v3 - with: - python-version: '${{ env.PYTHON_VERSION }}' - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install ${{ matrix.arch.pkg }} - pip install meson==${{ env.MESON_VERSION }} - .github/env/bootstrap.sh linux-x86_64 linux-${{ matrix.arch.id }} - - name: Build - run: | - export PATH="/tmp/toolchain/bin:$PATH" - meson setup \ - --native-file /tmp/native.txt \ - --cross-file /tmp/cross.txt \ - --default-library static \ - -Doptimization=s \ - -Dwerror=true \ - -Dgumpp=enabled \ - -Dgumjs=enabled \ - -Dtests=enabled \ - build - meson compile -C build - - freebsd-arm64: - if: false - runs-on: [self-hosted, freebsd, arm64] - steps: - - name: Checkout monorepo - uses: actions/checkout@v3 - - name: Install dependencies - run: pip install meson==${{ env.MESON_VERSION }} - - name: Build - run: | - meson setup \ - --default-library static \ - -Doptimization=s \ - -Dgumpp=enabled \ - -Dgumjs=enabled \ - -Db_lundef=false \ - build - meson compile -C build - - name: Test - run: ./build/tests/gum-tests - - ios-arm64: - if: false + id: + - ios-arm64 + - android-x86 + - android-x86_64 + - android-arm + - android-arm64 + fail-fast: false runs-on: macos-latest steps: - name: Check out repo - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/checkout@v4 with: - python-version: '${{ env.PYTHON_VERSION }}' - - name: Install dependencies - run: | - pip install meson==${{ env.MESON_VERSION }} - .github/env/bootstrap.sh macos-x86_64 ios-arm64 + submodules: recursive - name: Build run: | - export PATH="/tmp/toolchain/bin:$PATH" - meson setup \ - --native-file /tmp/native.txt \ - --cross-file /tmp/cross.txt \ - --default-library static \ - -Doptimization=s \ - -Dwerror=true \ - -Dgumpp=enabled \ - -Dgumjs=enabled \ - -Dtests=enabled \ - build - meson compile -C build - - name: Package + ./configure --host=${{ matrix.id }} ${{ env.GUM_OPTIONS }} + make + - name: Upload Gum devkit + uses: actions/upload-artifact@v4 + with: + name: gum-devkit-${{ matrix.id }} + path: build/gum/devkit/ + - name: Upload GumJS devkit + uses: actions/upload-artifact@v4 + with: + name: gumjs-devkit-${{ matrix.id }} + path: build/bindings/gumjs/devkit/ + - name: Package tests run: tar -C build/tests -czf /tmp/runner.tar.gz gum-tests data/ - - name: Test - uses: frida/corellium-action@v3 + - name: Test on Corellium iOS device + if: matrix.id == 'ios-arm64' + uses: frida/corellium-action@v4 with: token: ${{ secrets.GITHUB_TOKEN }} gateway: corellium.frida.re @@ -253,111 +176,9 @@ jobs: cd opt/frida tar xf $ASSET_PATH ./gum-tests - - android-intel: - runs-on: ubuntu-latest - if: false - strategy: - matrix: - arch: [x86, x86_64] - fail-fast: false - steps: - - name: Enable KVM group perms - run: | - echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules - sudo udevadm control --reload-rules - sudo udevadm trigger --name-match=kvm - - name: Check out repo - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '${{ env.PYTHON_VERSION }}' - - name: Install dependencies - run: | - pip install meson==${{ env.MESON_VERSION }} - .github/env/bootstrap.sh linux-x86_64 android-${{ matrix.arch }} - - name: Build - run: | - export PATH="/tmp/toolchain/bin:$PATH" - meson setup \ - --native-file /tmp/native.txt \ - --cross-file /tmp/cross.txt \ - --default-library static \ - -Doptimization=s \ - -Dwerror=true \ - -Dgumpp=enabled \ - -Dgumjs=enabled \ - -Dtests=enabled \ - build - meson compile -C build - - name: AVD cache - uses: actions/cache@v2 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-${{ matrix.arch }} - - name: Create AVD and generate snapshot for caching - if: steps.avd-cache.outputs.cache-hit != 'true' - uses: reactivecircus/android-emulator-runner@v2 - with: - arch: ${{ matrix.arch }} - api-level: 27 - force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: false - script: echo "Generated AVD snapshot for caching." - - name: Test - uses: reactivecircus/android-emulator-runner@v2 - with: - arch: ${{ matrix.arch }} - api-level: 27 - force-avd-creation: false - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: true - script: | - tar -C build/tests -czf /tmp/runner.tar.gz gum-tests data/ - adb push /tmp/runner.tar.gz /data/local/tmp/ - adb shell "su root sh -c 'set -ex; cd /data/local/tmp; tar xf runner.tar.gz; TMPDIR=/data/local/tmp ./gum-tests'" - - android-arm: - if: false - runs-on: ubuntu-latest - strategy: - matrix: - arch: [arm, arm64] - fail-fast: false - steps: - - name: Check out repo - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '${{ env.PYTHON_VERSION }}' - - name: Install dependencies - run: | - pip install meson==${{ env.MESON_VERSION }} - .github/env/bootstrap.sh linux-x86_64 android-${{ matrix.arch }} - - name: Build - run: | - export PATH="/tmp/toolchain/bin:$PATH" - meson setup \ - --native-file /tmp/native.txt \ - --cross-file /tmp/cross.txt \ - --default-library static \ - -Doptimization=s \ - -Dwerror=true \ - -Dgumpp=enabled \ - -Dgumjs=enabled \ - -Dtests=enabled \ - build - meson compile -C build - - name: Package - run: tar -C build/tests -czf /tmp/runner.tar.gz gum-tests data/ - - name: Test - uses: frida/corellium-action@v3 + - name: Test on Corellium Android device + if: startsWith(matrix.id, 'android-arm') + uses: frida/corellium-action@v4 with: token: ${{ secrets.GITHUB_TOKEN }} gateway: corellium.frida.re @@ -369,30 +190,28 @@ jobs: ./gum-tests qnx-armeabi: - if: false runs-on: ubuntu-latest - container: fridadotre/qnx:latest + container: ghcr.io/frida/qnx-tools:latest steps: - name: Check out repo - uses: actions/checkout@v3 - - name: Install dependencies - run: | - pip install meson==${{ env.MESON_VERSION }} - .github/env/bootstrap.sh linux-x86_64 qnx-armeabi + uses: actions/checkout@v4 + with: + submodules: recursive - name: Build run: | - export PATH="/tmp/toolchain/bin:$PATH" - meson setup \ - --native-file /tmp/native.txt \ - --cross-file /tmp/cross.txt \ - --default-library static \ - -Doptimization=s \ - -Dwerror=true \ - -Dgumpp=enabled \ - -Dgumjs=enabled \ - -Dtests=enabled \ - build - meson compile -C build + CFLAGS="--sysroot=$QNX_TARGET/armle-v7" \ + ./configure --host=arm-unknown-nto-qnx6.5.0eabi ${{ env.GUM_OPTIONS }} + make + - name: Upload Gum devkit + uses: actions/upload-artifact@v4 + with: + name: gum-devkit-qnx-armeabi + path: build/gum/devkit/ + - name: Upload GumJS devkit + uses: actions/upload-artifact@v4 + with: + name: gumjs-devkit-qnx-armeabi + path: build/bindings/gumjs/devkit/ - name: Test run: | tar -C build/tests -cf /tmp/runner.tar gum-tests data/