From c7d4c16b1baae721a34041a7e4e98a713898f8ca Mon Sep 17 00:00:00 2001 From: PremadeS <128969155+PremadeS@users.noreply.github.com> Date: Sun, 26 Apr 2026 23:04:06 +0500 Subject: [PATCH 1/3] wip --- .github/workflows/workflows/ci.yml | 673 ++++++++++++++++++ .github/workflows/workflows/coverity-scan.yml | 65 ++ .github/workflows/workflows/docs.yml | 32 + .github/workflows/workflows/linter.yml | 59 ++ 4 files changed, 829 insertions(+) create mode 100644 .github/workflows/workflows/ci.yml create mode 100644 .github/workflows/workflows/coverity-scan.yml create mode 100644 .github/workflows/workflows/docs.yml create mode 100644 .github/workflows/workflows/linter.yml diff --git a/.github/workflows/workflows/ci.yml b/.github/workflows/workflows/ci.yml new file mode 100644 index 0000000000..0678fa4d83 --- /dev/null +++ b/.github/workflows/workflows/ci.yml @@ -0,0 +1,673 @@ +name: CI + +on: + push: + branches: + - dev + - stable + tags: + - v* + - upload-test* + + pull_request: + branches: + - dev + - stable + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-linux: + name: ${{ matrix.name }} + runs-on: ubuntu-latest + container: + image: ${{ matrix.image }} + options: --privileged + strategy: + matrix: + name: [ + linux-x86_64, + linux-x86_64-system-deps, + tarball + ] + include: + - qt-major: 6 + cc-override: default + cxx-override: default + - name: linux-x86_64-system-deps # ensure that Cutter can be built at least in basic config on Ubuntu 22.04 using sytem libraries + image: ubuntu:22.04 + python-version: 3.11.x + system-deps: true + package: false + tarball: false + cc-override: '/usr/bin/gcc-12' + cxx-override: '/usr/bin/g++-12' + - name: linux-x86_64 # main Appimage build + image: ubuntu:24.04 + python-version: 3.12.x + system-deps: false + package: true + tarball: false + - name: tarball + python-version: 3.12.x + image: ubuntu:24.04 + system-deps: false + package: false + tarball: true + # Prevent one job from pausing the rest + fail-fast: false + steps: + - name: set timezone + run: | + # Fix timezone on ubuntu to prevent user input request during the apt-get phase. + export TZ=UTC + ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + + - name: install latest git and cmake + shell: bash + run: | + set -e + apt-get -y update + echo "Using image: ${{ matrix.image }}" + + export GIT_VERSION="git-2.36.1" + export CMAKE_VERSION="3.25.3" + + apt-get -y install wget libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev build-essential + + wget "https://www.kernel.org/pub/software/scm/git/$GIT_VERSION.tar.gz" + tar -zxf "$GIT_VERSION.tar.gz" + + # build. + make -C "$GIT_VERSION" prefix=/usr install -j > "$GIT_VERSION/build.log" + + # ensure git is installed. + git version + + wget "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-linux-x86_64.sh" + bash ./cmake-$CMAKE_VERSION-linux-x86_64.sh --skip-license --prefix=/usr + + # ensure cmake is installed. + cmake --version + + # cleanup dev environment. + rm -rf "$GIT_VERSION.tar.gz" "$GIT_VERSION" cmake-$CMAKE_VERSION-linux-x86_64.sh + unset CMAKE_VERSION + unset GIT_VERSION + + - uses: actions/checkout@v4 + with: + submodules: recursive + persist-credentials: false + + - name: apt cutter dependencies + shell: bash + run: | + # install needed packages + apt-get -y install libgraphviz-dev \ + mesa-common-dev \ + libxkbcommon-x11-dev \ + ninja-build \ + python3-pip \ + curl \ + libpcre2-dev \ + libfuse2 \ + pkg-config + + if [ "${{ matrix.image }}" = "ubuntu:18.04" ]; then + # install additional packages needed for appimage + apt-get -y install gcc-7 \ + libglu1-mesa-dev \ + freeglut3-dev \ + mesa-common-dev \ + libclang-8-dev \ + llvm-8 + ln -s /usr/bin/llvm-config-8 /usr/bin/llvm-config + fi + if [ "${{ matrix.image }}" = "ubuntu:18.04" ] || [ "${{ matrix.image }}" = "ubuntu:24.04" ]; then + # install additional packages needed for appimage + apt-get -y install libxcb1-dev \ + libxkbcommon-dev \ + libxcb-*-dev \ + libegl1 + fi + if [ "${{ matrix.image }}" = "ubuntu:24.04" ] && [ "${{ matrix.system-deps }}" = "false" ]; then + # install additional packages needed for appimage + apt-get -y install libclang-12-dev \ + llvm-12 \ + libsm6 \ + libwayland-dev \ + libgl1-mesa-dev + lsb-release \ + wget \ + software-properties-common + curl -O https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + ./llvm.sh 20 + fi + if [ "${{ matrix.image }}" = "ubuntu:18.04" ] && [ "${{ matrix.system-deps }}" = "true" ]; then + apt-get -y install qt5-default \ + libqt5svg5-dev \ + qttools5-dev \ + qttools5-dev-tools + fi + if [ "${{ matrix.image }}" = "ubuntu:22.04" ]; then + apt-get -y install libclang-12-dev \ + llvm-12 \ + qt6-base-dev \ + qt6-tools-dev \ + qt6-tools-dev-tools \ + libqt6svg6-dev \ + libqt6core5compat6-dev \ + libqt6svgwidgets6 \ + qt6-l10n-tools \ + gcc-12 \ + g++-12 + fi + - uses: actions/setup-python@v6 + if: matrix.system-deps == false + with: + python-version: ${{ matrix.python-version }} + - name: py dependencies + run: | + python3 --version + which python3 + # https://github.com/rizinorg/cutter/runs/7170222817?check_suite_focus=true + python3 -m pip install meson # ==0.61.5 + - name: Prepare package id + shell: bash + run: | + if [ "${{ startsWith(github.event.ref, 'refs/tags')}}" = "true" ] + then + PACKAGE_ID="${{ github.event.ref }}" + else + PACKAGE_ID="git-`date "+%Y-%m-%d"`-${{ format('{0}', github.sha) }}" + fi + PACKAGE_ID=${PACKAGE_ID##refs/tags/} + echo PACKAGE_ID=$PACKAGE_ID >> $GITHUB_ENV + - name: cmake ubuntu + shell: bash + run: | + if [ "${{ matrix.system-deps }}" = "false" ] + then + CUTTER_QT="${{ matrix.qt-major }}" scripts/fetch_deps.sh + . cutter-deps/env.sh + ln -sf "$PWD/cutter-deps/pyside/share/PySide6/"* "$PWD/cutter-deps/pyside/" + export LD_LIBRARY_PATH="`llvm-config --libdir`:$LD_LIBRARY_PATH" + fi + set -e #TODO: move to top once cutter-deps doesn't fail + if [ "${{ matrix.cc-override }}" != "default" ] + then + export CC="${{matrix.cc-override}}" + export CXX="${{matrix.cxx-override}}" + fi + + mkdir build + cd build + if [ "${{ matrix.system-deps }}" = "false" ] + then + locale + locale -a + export LANG="C.UTF-8" + export LC_ALL="C.UTF-8" + cmake \ + -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCUTTER_ENABLE_PYTHON=ON \ + -DPython3_ROOT_DIR="$CUTTER_DEPS_PYTHON_PREFIX" \ + -DCUTTER_ENABLE_PYTHON_BINDINGS=ON \ + -DCUTTER_ENABLE_GRAPHVIZ=ON \ + -DCUTTER_USE_BUNDLED_RIZIN=ON \ + -DCUTTER_APPIMAGE_BUILD=ON \ + -DCUTTER_ENABLE_PACKAGING=ON \ + -DCUTTER_ENABLE_KSYNTAXHIGHLIGHTING=OFF \ + -DCUTTER_ENABLE_SIGDB=ON \ + -DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON \ + -DCUTTER_PACKAGE_RZ_GHIDRA=ON \ + -DCUTTER_PACKAGE_JSDEC=ON \ + -DCUTTER_PACKAGE_RZ_LIBSWIFT=ON \ + -DCUTTER_PACKAGE_RZ_LIBYARA=ON \ + -DCUTTER_PACKAGE_RZ_SILHOUETTE=ON \ + -DCMAKE_INSTALL_PREFIX=appdir/usr \ + -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \ + -DCUTTER_QT=${{ matrix.qt-major }} \ + .. + else + cmake \ + -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCUTTER_QT=${{ matrix.qt-major }} \ + -DCUTTER_USE_BUNDLED_RIZIN=ON \ + .. + fi + ninja + if [ "${{ matrix.package }}" = "true" ] + then + export CUTTER_VERSION=$(python ../scripts/get_version.py) + export VERSION=$CUTTER_VERSION + ninja install + "../scripts/appimage_embed_python.sh" appdir ${{ matrix.qt-major == '6' && '6' || '2' }} + APP_PREFIX=`pwd`/appdir/usr + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APP_PREFIX/lib/rizin/plugins" + export PATH=$PATH:${APP_PREFIX}/bin + wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" + chmod a+x linuxdeployqt*.AppImage + rm -fv "../cutter-deps/qt/plugins/imageformats/libqjp2.so" + if [ "${{ matrix.qt-major }}" == "5" ]; then + export APPIMAGE_FILE="Cutter-${PACKAGE_ID}-Linux-Qt5-x86_64.AppImage" + ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop \ + -executable=./appdir/usr/bin/python3 \ + -appimage \ + -no-strip -exclude-libs=libnss3.so,libnssutil3.so,libqjp2.so \ + -ignore-glob=usr/lib/python3.12/**/* \ + -verbose=2 + else + export APPIMAGE_FILE="Cutter-${PACKAGE_ID}-Linux-x86_64.AppImage" + ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop \ + -executable=./appdir/usr/bin/python3 \ + -appimage \ + -no-strip -exclude-libs=libnss3.so,libnssutil3.so,libqjp2.so \ + -exclude-libs="libwayland-client.so,libwayland-egl.so,libwayland-cursor.so" \ + -ignore-glob=usr/lib/python3.12/**/* \ + -extra-plugins="platforms/libqwayland-egl.so,platforms/libqwayland-generic.so,wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-integration,wayland-graphics-integration-server" \ + -verbose=2 + fi + find ./appdir -executable -type f -exec ldd {} \; | cut -d " " -f 2-3 | sort | uniq + # find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq + + mv Cutter-*-x86_64.AppImage "$APPIMAGE_FILE" + echo PACKAGE_NAME=$APPIMAGE_FILE >> $GITHUB_ENV + echo PACKAGE_PATH=build/$APPIMAGE_FILE >> $GITHUB_ENV + echo UPLOAD_ASSET_TYPE=application/x-executable >> $GITHUB_ENV + fi + - name: Create tarball + if: matrix.tarball + shell: bash + run: | + scripts/tarball.sh "Cutter-${PACKAGE_ID}" + echo PACKAGE_NAME=Cutter-${PACKAGE_ID}-src.tar.gz >> $GITHUB_ENV + echo PACKAGE_PATH=Cutter-${PACKAGE_ID}-src.tar.gz >> $GITHUB_ENV + echo UPLOAD_ASSET_TYPE=application/gzip >> $GITHUB_ENV + - uses: actions/upload-artifact@v7 + if: env.PACKAGE_NAME != null + with: + name: ${{ env.PACKAGE_NAME }} + path: ${{ env.PACKAGE_PATH }} + - name: Get release + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + id: get_release + uses: rizinorg/gha-get-release@c8074dd5d13ddd0a194d8c9205a1466973c7dc0d + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload release assets + if: steps.get_release.outputs.upload_url != null && env.PACKAGE_NAME != null + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ${{ env.PACKAGE_PATH }} + asset_name: ${{ env.PACKAGE_NAME }} + asset_content_type: ${{ env.UPLOAD_ASSET_TYPE }} + - name: Set output + id: output_setup + if: ${{ matrix.name == 'linux-x86_64' }} + run: | + echo "artifact_name=$PACKAGE_NAME" >> "$GITHUB_OUTPUT" + outputs: + artifact_linux: ${{ steps.output_setup.outputs.artifact_name }} + build-linux-old: + name: ${{ matrix.name }} + runs-on: ubuntu-latest # only a host environement, actual building happens in a docker image + strategy: + matrix: + name: [ + linux-x86_64-qt5, + linux-x86_64-qt5-system-deps, + ] + include: + - qt-major: 6 + cc-override: default + cxx-override: default + - name: linux-x86_64-qt5-system-deps # ensure that Cutter can be built at least in basic config on Ubuntu 18.04 using sytem libraries + image: ubuntu:18.04 + python-version: 3.6.x + system-deps: true + package: false + cc-override: '/usr/bin/gcc-7' + cxx-override: '/usr/bin/g++-7' + qt-major: 5 + - name: linux-x86_64-qt5 # qt5 Appimage build for increased compatibility with older distros + image: ubuntu:18.04 + python-version: 3.6.x + system-deps: false + package: true + qt-major: 5 + # Prevent one job from pausing the rest + fail-fast: false + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + persist-credentials: false + - name: Prepare package id + shell: bash + run: | + if [ "${{ startsWith(github.event.ref, 'refs/tags')}}" = "true" ] + then + PACKAGE_ID="${{ github.event.ref }}" + else + PACKAGE_ID="git-`date "+%Y-%m-%d"`-${{ format('{0}', github.sha) }}" + fi + PACKAGE_ID=${PACKAGE_ID##refs/tags/} + echo PACKAGE_ID=$PACKAGE_ID >> $GITHUB_ENV + ls -alh + who + + - name: build linux + id: build + uses: ./.github/actions/build-linux-old + with: + system-deps: ${{ matrix.system-deps }} + image: ${{ matrix.image }} + qt-major: ${{ matrix.qt-major }} + package: ${{ matrix.package }} + + - uses: actions/upload-artifact@v7 + if: env.PACKAGE_NAME != null + with: + name: ${{ steps.build.outputs.PACKAGE_NAME }} + path: ${{ steps.build.outputs.PACKAGE_PATH }} + - name: Get release + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + id: get_release + uses: rizinorg/gha-get-release@c8074dd5d13ddd0a194d8c9205a1466973c7dc0d + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload release assets + if: steps.get_release.outputs.upload_url != null && env.PACKAGE_NAME != null + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ${{ env.PACKAGE_PATH }} + asset_name: ${{ env.PACKAGE_NAME }} + asset_content_type: ${{ env.UPLOAD_ASSET_TYPE }} + + + build: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + name: [ + macos-x86_64, + macos-arm64, + windows-x86_64, + ] + include: + - python-version: 3.12.x + - system-deps: false + - output-id: "" + - name: windows-x86_64 + os: windows-2022 + package: true + python-version: 3.12.x + output-id: artifact_windows + - name: macos-x86_64 + os: macos-14 + arch: x86_64 + package: true + - name: macos-arm64 + os: macos-14 + arch: arm64 + package: true + output-id: artifact_macos + # Prevent one job from pausing the rest + fail-fast: false + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + persist-credentials: false + - uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + - name: homebrew dependencies + if: contains(matrix.os, 'macos') + run: | + cd scripts + rm /usr/local/bin/2to3* # symlink to some kind of existing python2.7 installation conflicts with brew python3 which gets installed as indirect dependency + brew bundle + brew install pkg-config || brew link --overwrite pkgconf + brew install kadwanev/brew/retry + brew install llvm@20 && brew link llvm@20 + - name: py dependencies + run: | + #python3 -m pip install -U pip==21.3.1 + pip install meson # ==0.61.5 # https://github.com/rizinorg/cutter/runs/7170222817?check_suite_focus=true + pip install setuptools + - name: Prepare package id + shell: bash + run: | + if [[ "${{ startsWith(github.event.ref, 'refs/tags')}}" = "true" ]] + then + PACKAGE_ID="${{ github.event.ref }}" + else + PACKAGE_ID="git-`date "+%Y-%m-%d"`-${{ format('{0}', github.sha) }}" + fi + PACKAGE_ID=${PACKAGE_ID##refs/tags/} + echo PACKAGE_ID=$PACKAGE_ID >> $GITHUB_ENV + - name: cmake macos + shell: bash + if: contains(matrix.os, 'macos') + run: | + export MACOSX_DEPLOYMENT_TARGET=10.15 + scripts/fetch_deps.sh + install_name_tool -delete_rpath /Users/runner/work/cutter-deps/cutter-deps/qt/lib ./cutter-deps/pyside/lib/libpyside6.cpython-312-darwin.6.11.dylib #TODO: do this in cutter-deps + source cutter-deps/env.sh + ln -sf "$PWD/cutter-deps/pyside/share/PySide6/"* "$PWD/cutter-deps/pyside/" + set -euo pipefail + export PATH=/usr/local/opt/llvm/bin:$PATH + mkdir build + cd build + PACKAGE_NAME=Cutter-${PACKAGE_ID}-macOS-${{ matrix.arch }} + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DPython3_ROOT_DIR="${CUTTER_DEPS_PYTHON_PREFIX}" \ + -DPython_ROOT_DIR="${CUTTER_DEPS_PYTHON_PREFIX}" \ + -DPython3_FIND_STRATEGY="LOCATION" \ + -DPython_FIND_STRATEGY="LOCATION" \ + -DCUTTER_ENABLE_PYTHON=ON \ + -DCUTTER_ENABLE_PYTHON_BINDINGS=ON \ + -DCUTTER_USE_BUNDLED_RIZIN=ON \ + -DCUTTER_ENABLE_PACKAGING=ON \ + -DCUTTER_ENABLE_SIGDB=ON \ + -DCUTTER_PACKAGE_DEPENDENCIES=ON \ + -DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON \ + -DCUTTER_PACKAGE_RZ_GHIDRA=ON \ + -DCUTTER_PACKAGE_JSDEC=ON \ + -DCUTTER_PACKAGE_RZ_LIBSWIFT=ON \ + -DCUTTER_PACKAGE_RZ_LIBYARA=ON \ + -DCUTTER_PACKAGE_RZ_SILHOUETTE=ON \ + -DCPACK_PACKAGE_FILE_NAME="$PACKAGE_NAME" \ + -DCPACK_BUNDLE_APPLE_CERT_APP="-" \ + .. && \ + make -j4; + # Reduce chance for random hdiutil "Resource busy" error when creating the dmg + # https://github.com/actions/runner-images/issues/7522#issuecomment-1556766641 + echo killing XProtectBehaviorService; sudo pkill -9 XProtect >/dev/null || true; + echo waiting for XProtectBehaviorService kill; while pgrep XProtect; do sleep 3; done; + retry make package + export CUTTER_VERSION=$(python3 ../scripts/get_version.py) + echo PACKAGE_NAME=${PACKAGE_NAME}.dmg >> $GITHUB_ENV + echo PACKAGE_PATH=build/${PACKAGE_NAME}.dmg >> $GITHUB_ENV + echo UPLOAD_ASSET_TYPE=application/x-apple-diskimage >> $GITHUB_ENV + - name: windows dependencies + if: contains(matrix.os, 'windows') + shell: bash + run: | + pip install ninja + scripts/fetch_deps.sh + ln -sf "$PWD/cutter-deps/pyside/share/PySide6/"* "$PWD/cutter-deps/pyside/" + choco install winflexbison3 + - name: windows cmake + if: contains(matrix.os, 'windows') + shell: cmd + run: | + set ARCH=x64 + set CUTTER_DEPS=%CD%\cutter-deps + set PATH=%CD%\cutter-deps\qt\bin;%PATH% + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + cd + mkdir build + cd build + set PACKAGE_NAME=Cutter-%PACKAGE_ID%-Windows-x86_64 + cmake ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCUTTER_USE_BUNDLED_RIZIN=ON ^ + -DCUTTER_ENABLE_PYTHON=ON ^ + -DCUTTER_ENABLE_PYTHON_BINDINGS=ON ^ + -DCUTTER_ENABLE_PACKAGING=ON ^ + -DPython3_FIND_REGISTRY=NEVER ^ + -DPython3_FIND_STRATEGY=LOCATION ^ + -DPython_FIND_REGISTRY=NEVER ^ + -DPython_FIND_STRATEGY=LOCATION ^ + -DCUTTER_ENABLE_SIGDB=ON ^ + -DCUTTER_PACKAGE_DEPENDENCIES=ON ^ + -DCUTTER_PACKAGE_RZ_GHIDRA=ON ^ + -DCUTTER_PACKAGE_RZ_LIBSWIFT=ON ^ + -DCUTTER_PACKAGE_RZ_LIBYARA=ON ^ + -DCUTTER_PACKAGE_RZ_SILHOUETTE=ON ^ + -DCUTTER_PACKAGE_JSDEC=ON ^ + -DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON ^ + -DCMAKE_PREFIX_PATH="%CUTTER_DEPS%\pyside" ^ + -DCPACK_PACKAGE_FILE_NAME=%PACKAGE_NAME% ^ + -G Ninja ^ + .. + cmake --build . --config Release + cmake --build . --config Release --target package + echo PACKAGE_NAME=%PACKAGE_NAME%.zip >> %GITHUB_ENV% + echo PACKAGE_PATH=build/%PACKAGE_NAME%.zip >> %GITHUB_ENV% + echo UPLOAD_ASSET_TYPE=application/zip >> %GITHUB_ENV% + - uses: actions/upload-artifact@v7 + if: env.PACKAGE_NAME != null + with: + name: ${{ env.PACKAGE_NAME }} + path: ${{ env.PACKAGE_PATH }} + - name: Get release + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + id: get_release + uses: rizinorg/gha-get-release@c8074dd5d13ddd0a194d8c9205a1466973c7dc0d + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload release assets + if: steps.get_release.outputs.upload_url != null && env.PACKAGE_NAME != null + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ${{ env.PACKAGE_PATH }} + asset_name: ${{ env.PACKAGE_NAME }} + asset_content_type: ${{ env.UPLOAD_ASSET_TYPE }} + + - name: Set output + if: matrix.output-id != '' + id: output_setup + shell: bash + run: | + echo "${{ matrix.output-id }}=${PACKAGE_NAME}" >> "$GITHUB_OUTPUT" + outputs: + artifact_macos: ${{ steps.output_setup.outputs.artifact_macos }} + artifact_windows: ${{ steps.output_setup.outputs.artifact_windows }} + + plugin-test: + name: plugin-test-${{ matrix.name }} + runs-on: ${{ matrix.os }} + needs: [build-linux, build] + strategy: + matrix: + name: [ + linux-x86_64, + macos-arm64, + windows, + ] + include: + - name: linux-x86_64 + os: ubuntu-22.04 + artifact-job: build-linux + artifact-output: artifact_linux + - name: macos-arm64 + os: macos-14 + artifact-job: build + artifact-output: artifact_macos + - name: windows + os: windows-2022 + artifact-job: build + artifact-output: artifact_windows + fail-fast: false + steps: + - uses: actions/checkout@v4 + with: + path: 'cutter-src-tmp' + persist-credentials: false + # Only needed for QT, in theory could use qt that's sourced in other way. + # But that introduces risk of problems caused by incompatibility between the two versions. + - name: Cutter deps + shell: bash + run: | + echo "PACKAGE_NAME=${{needs[matrix.artifact-job].outputs[matrix.artifact-output] || 'bad_id'}}" >> $GITHUB_ENV + ls -alh + pwd + ./cutter-src-tmp/scripts/fetch_deps.sh + cp -r ./cutter-src-tmp/src/plugins/sample-cpp . + rm -r ./cutter-src-tmp/cutter-deps/python/ || true # copying python folder on macOs doesn't work well, it's not needed for plugin compilation + cp -r ./cutter-src-tmp/cutter-deps . + rm -r cutter-src-tmp + ls -alh + pwd + + - name: Download cutter build + uses: actions/download-artifact@v4 + with: + name: ${{ needs[matrix.artifact-job].outputs[matrix.artifact-output] || 'bad_id2' }} + - name: build-linux + if: contains(matrix.name, 'linux') + run: | + sudo apt-get -y install libxcb1-dev \ + libxkbcommon-dev \ + libxcb-*-dev \ + libegl1 \ + mesa-common-dev + ls + chmod +x ./$PACKAGE_NAME + ./$PACKAGE_NAME --appimage-extract + + cd sample-cpp + mkdir build + cmake -B build -DCMAKE_PREFIX_PATH="$PWD/../squashfs-root/usr/;$PWD/../cutter-deps/qt" --debug-find-pkg=Qt6Widgets -DQT_DEBUG_FIND_PACKAGE=ON + cmake --build build + - name: build-macos + if: contains(matrix.name, 'macos') + run: | + hdiutil attach $PACKAGE_NAME + ls /Volumes/Cutter/ + cd sample-cpp + mkdir build + cmake -B build -DCMAKE_PREFIX_PATH="/Volumes/Cutter/Cutter.app/Contents/Resources;../cutter-deps/qt" + cmake --build build + - name: Build windows + if: contains(matrix.name, 'windows') + shell: cmd + run: | + 7z.exe x %PACKAGE_NAME% + ren %PACKAGE_NAME:~0,-4% cutter + dir + cd sample-cpp + mkdir build + cmake -B build -DCMAKE_PREFIX_PATH="%CD%/../cutter;%CD%/../cutter-deps/qt" + cmake --build build diff --git a/.github/workflows/workflows/coverity-scan.yml b/.github/workflows/workflows/coverity-scan.yml new file mode 100644 index 0000000000..58a4886f06 --- /dev/null +++ b/.github/workflows/workflows/coverity-scan.yml @@ -0,0 +1,65 @@ +name: coverity-scan +on: + schedule: + - cron: "0 9 * * 1,5" # Bi-weekly at 09:00 UTC on Monday and Thursday + +jobs: + latest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: actions/setup-python@v6 + with: + python-version: 3.9.x + + - name: Download Coverity Build Tool + run: | + wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=rizinorg%2Fcutter" -O cov-analysis-linux64.tar.gz + mkdir cov-analysis-linux64 + tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 + env: + TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} + + - name: Fixed world writable dirs + run: | + chmod go-w $HOME + sudo chmod -R go-w /usr/share + + - name: apt dependencies + run: sudo apt-get install ninja-build libgraphviz-dev mesa-common-dev + + - name: py dependencies + run: | + pip install meson + + - name: CMake + run: | + scripts/fetch_deps.sh + source cutter-deps/env.sh + export LD_LIBRARY_PATH="`llvm-config --libdir`:$LD_LIBRARY_PATH" + mkdir build + cd build + cmake .. + + - name: Build with cov-build + run: | + export PATH=`pwd`/cov-analysis-linux64/bin:$PATH + cd build + cov-build --dir cov-int make + + - name: Submit the result to Coverity Scan + run: | + cd build + tar czvf cutter.tgz cov-int + curl \ + --form project=radareorg-cutter \ + --form token=$TOKEN \ + --form email=noreply@radare.org \ + --form file=@cutter.tgz \ + --form version=trunk \ + --form description="Cutter" \ + https://scan.coverity.com/builds?project=radareorg%2Fcutter + env: + TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} diff --git a/.github/workflows/workflows/docs.yml b/.github/workflows/workflows/docs.yml new file mode 100644 index 0000000000..a4e77ac303 --- /dev/null +++ b/.github/workflows/workflows/docs.yml @@ -0,0 +1,32 @@ +name: Docs + +on: + push: + branches: + - dev + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: install dependencies + run: | + sudo apt-get install -y doxygen + pip install -U sphinx breathe sphinx-rtd-theme recommonmark + - name: build docs + run: | + export PATH="/home/runner/.local/bin:$PATH" + cd docs + make html + cd .. + - name: deploy docs + run: | + openssl aes-256-cbc -K ${{ secrets.CUTTER_DOCS_KEY }} -iv ${{ secrets.CUTTER_DOCS_IV }} -in scripts/deploy_docs_rsa.enc -out scripts/deploy_docs_rsa -d + chmod 600 scripts/deploy_docs_rsa + export GIT_SSH_COMMAND="/usr/bin/ssh -i $PWD/scripts/deploy_docs_rsa" + git config --global user.name "Github Actions" + git config --global user.email "actions@github.com" + bash scripts/deploy_docs.sh diff --git a/.github/workflows/workflows/linter.yml b/.github/workflows/workflows/linter.yml new file mode 100644 index 0000000000..39171b890f --- /dev/null +++ b/.github/workflows/workflows/linter.yml @@ -0,0 +1,59 @@ +name: "Linter" + +on: + push: + branches: + - dev + - stable + pull_request: + branches: + - dev + - stable + +jobs: + changes: + runs-on: ubuntu-latest + outputs: + clang-format: ${{ steps.filter.outputs.clang-format }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + clang-format: + - '**.cpp' + - '**.c' + - '**.h' + - '.github/workflows/linter.yml' + - 'scripts/clang-format.py' + - '_clang-format' + + clang-format: + needs: changes + runs-on: ubuntu-22.04 + if: ${{ needs.changes.outputs.clang-format == 'true' }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install wget, software-properties-common, lsb-release (dependencies of LLVM install script) + run: sudo apt --assume-yes install wget software-properties-common lsb-release + + - name: Uninstall old conflicting packages + run: sudo apt purge --assume-yes --auto-remove llvm python3-lldb-14 llvm-14 + + - name: Install automatic LLVM 16 + run: wget https://apt.llvm.org/llvm.sh -O /tmp/llvm-install.sh; chmod +x /tmp/llvm-install.sh; sudo /tmp/llvm-install.sh 16 + + - name: Install clang-format-16 + run: sudo apt --assume-yes install clang-format-16 + + - name: Install gitpython + run: sudo pip install gitpython + + - name: Run clang-format + run: | + sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-16 160 + clang-format --version + python scripts/clang-format.py --check --verbose From 66f0835a5d411510e8c0d2ef6350213ce53cfc43 Mon Sep 17 00:00:00 2001 From: PremadeS <128969155+PremadeS@users.noreply.github.com> Date: Sun, 26 Apr 2026 23:05:19 +0500 Subject: [PATCH 2/3] wip --- .github/workflows/ci.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e49c87ae77..0678fa4d83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,14 +45,14 @@ jobs: cc-override: '/usr/bin/gcc-12' cxx-override: '/usr/bin/g++-12' - name: linux-x86_64 # main Appimage build - image: ubuntu:20.04 - python-version: 3.6.x + image: ubuntu:24.04 + python-version: 3.12.x system-deps: false package: true tarball: false - name: tarball - python-version: 3.6.x - image: ubuntu:20.04 + python-version: 3.12.x + image: ubuntu:24.04 system-deps: false package: false tarball: true @@ -126,20 +126,26 @@ jobs: llvm-8 ln -s /usr/bin/llvm-config-8 /usr/bin/llvm-config fi - if [ "${{ matrix.image }}" = "ubuntu:18.04" ] || [ "${{ matrix.image }}" = "ubuntu:20.04" ]; then + if [ "${{ matrix.image }}" = "ubuntu:18.04" ] || [ "${{ matrix.image }}" = "ubuntu:24.04" ]; then # install additional packages needed for appimage apt-get -y install libxcb1-dev \ libxkbcommon-dev \ libxcb-*-dev \ libegl1 fi - if [ "${{ matrix.image }}" = "ubuntu:20.04" ] && [ "${{ matrix.system-deps }}" = "false" ]; then + if [ "${{ matrix.image }}" = "ubuntu:24.04" ] && [ "${{ matrix.system-deps }}" = "false" ]; then # install additional packages needed for appimage apt-get -y install libclang-12-dev \ llvm-12 \ libsm6 \ libwayland-dev \ libgl1-mesa-dev + lsb-release \ + wget \ + software-properties-common + curl -O https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + ./llvm.sh 20 fi if [ "${{ matrix.image }}" = "ubuntu:18.04" ] && [ "${{ matrix.system-deps }}" = "true" ]; then apt-get -y install qt5-default \ @@ -169,7 +175,7 @@ jobs: python3 --version which python3 # https://github.com/rizinorg/cutter/runs/7170222817?check_suite_focus=true - python3 -m pip install meson==0.61.5 + python3 -m pip install meson # ==0.61.5 - name: Prepare package id shell: bash run: | @@ -188,6 +194,7 @@ jobs: then CUTTER_QT="${{ matrix.qt-major }}" scripts/fetch_deps.sh . cutter-deps/env.sh + ln -sf "$PWD/cutter-deps/pyside/share/PySide6/"* "$PWD/cutter-deps/pyside/" export LD_LIBRARY_PATH="`llvm-config --libdir`:$LD_LIBRARY_PATH" fi set -e #TODO: move to top once cutter-deps doesn't fail @@ -437,6 +444,7 @@ jobs: brew bundle brew install pkg-config || brew link --overwrite pkgconf brew install kadwanev/brew/retry + brew install llvm@20 && brew link llvm@20 - name: py dependencies run: | #python3 -m pip install -U pip==21.3.1 @@ -459,8 +467,9 @@ jobs: run: | export MACOSX_DEPLOYMENT_TARGET=10.15 scripts/fetch_deps.sh - install_name_tool -delete_rpath /Users/runner/work/cutter-deps/cutter-deps/qt/lib ./cutter-deps/pyside/lib/libpyside6.cpython-312-darwin.6.7.2.dylib #TODO: do this in cutter-deps + install_name_tool -delete_rpath /Users/runner/work/cutter-deps/cutter-deps/qt/lib ./cutter-deps/pyside/lib/libpyside6.cpython-312-darwin.6.11.dylib #TODO: do this in cutter-deps source cutter-deps/env.sh + ln -sf "$PWD/cutter-deps/pyside/share/PySide6/"* "$PWD/cutter-deps/pyside/" set -euo pipefail export PATH=/usr/local/opt/llvm/bin:$PATH mkdir build @@ -503,6 +512,7 @@ jobs: run: | pip install ninja scripts/fetch_deps.sh + ln -sf "$PWD/cutter-deps/pyside/share/PySide6/"* "$PWD/cutter-deps/pyside/" choco install winflexbison3 - name: windows cmake if: contains(matrix.os, 'windows') From 149d333fccbe119633ded9f67af3109ca266aeac Mon Sep 17 00:00:00 2001 From: PremadeS <128969155+PremadeS@users.noreply.github.com> Date: Sun, 26 Apr 2026 23:06:01 +0500 Subject: [PATCH 3/3] wip --- .github/workflows/workflows/ci.yml | 673 ------------------ .github/workflows/workflows/coverity-scan.yml | 65 -- .github/workflows/workflows/docs.yml | 32 - .github/workflows/workflows/linter.yml | 59 -- 4 files changed, 829 deletions(-) delete mode 100644 .github/workflows/workflows/ci.yml delete mode 100644 .github/workflows/workflows/coverity-scan.yml delete mode 100644 .github/workflows/workflows/docs.yml delete mode 100644 .github/workflows/workflows/linter.yml diff --git a/.github/workflows/workflows/ci.yml b/.github/workflows/workflows/ci.yml deleted file mode 100644 index 0678fa4d83..0000000000 --- a/.github/workflows/workflows/ci.yml +++ /dev/null @@ -1,673 +0,0 @@ -name: CI - -on: - push: - branches: - - dev - - stable - tags: - - v* - - upload-test* - - pull_request: - branches: - - dev - - stable - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build-linux: - name: ${{ matrix.name }} - runs-on: ubuntu-latest - container: - image: ${{ matrix.image }} - options: --privileged - strategy: - matrix: - name: [ - linux-x86_64, - linux-x86_64-system-deps, - tarball - ] - include: - - qt-major: 6 - cc-override: default - cxx-override: default - - name: linux-x86_64-system-deps # ensure that Cutter can be built at least in basic config on Ubuntu 22.04 using sytem libraries - image: ubuntu:22.04 - python-version: 3.11.x - system-deps: true - package: false - tarball: false - cc-override: '/usr/bin/gcc-12' - cxx-override: '/usr/bin/g++-12' - - name: linux-x86_64 # main Appimage build - image: ubuntu:24.04 - python-version: 3.12.x - system-deps: false - package: true - tarball: false - - name: tarball - python-version: 3.12.x - image: ubuntu:24.04 - system-deps: false - package: false - tarball: true - # Prevent one job from pausing the rest - fail-fast: false - steps: - - name: set timezone - run: | - # Fix timezone on ubuntu to prevent user input request during the apt-get phase. - export TZ=UTC - ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - - - name: install latest git and cmake - shell: bash - run: | - set -e - apt-get -y update - echo "Using image: ${{ matrix.image }}" - - export GIT_VERSION="git-2.36.1" - export CMAKE_VERSION="3.25.3" - - apt-get -y install wget libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev build-essential - - wget "https://www.kernel.org/pub/software/scm/git/$GIT_VERSION.tar.gz" - tar -zxf "$GIT_VERSION.tar.gz" - - # build. - make -C "$GIT_VERSION" prefix=/usr install -j > "$GIT_VERSION/build.log" - - # ensure git is installed. - git version - - wget "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-linux-x86_64.sh" - bash ./cmake-$CMAKE_VERSION-linux-x86_64.sh --skip-license --prefix=/usr - - # ensure cmake is installed. - cmake --version - - # cleanup dev environment. - rm -rf "$GIT_VERSION.tar.gz" "$GIT_VERSION" cmake-$CMAKE_VERSION-linux-x86_64.sh - unset CMAKE_VERSION - unset GIT_VERSION - - - uses: actions/checkout@v4 - with: - submodules: recursive - persist-credentials: false - - - name: apt cutter dependencies - shell: bash - run: | - # install needed packages - apt-get -y install libgraphviz-dev \ - mesa-common-dev \ - libxkbcommon-x11-dev \ - ninja-build \ - python3-pip \ - curl \ - libpcre2-dev \ - libfuse2 \ - pkg-config - - if [ "${{ matrix.image }}" = "ubuntu:18.04" ]; then - # install additional packages needed for appimage - apt-get -y install gcc-7 \ - libglu1-mesa-dev \ - freeglut3-dev \ - mesa-common-dev \ - libclang-8-dev \ - llvm-8 - ln -s /usr/bin/llvm-config-8 /usr/bin/llvm-config - fi - if [ "${{ matrix.image }}" = "ubuntu:18.04" ] || [ "${{ matrix.image }}" = "ubuntu:24.04" ]; then - # install additional packages needed for appimage - apt-get -y install libxcb1-dev \ - libxkbcommon-dev \ - libxcb-*-dev \ - libegl1 - fi - if [ "${{ matrix.image }}" = "ubuntu:24.04" ] && [ "${{ matrix.system-deps }}" = "false" ]; then - # install additional packages needed for appimage - apt-get -y install libclang-12-dev \ - llvm-12 \ - libsm6 \ - libwayland-dev \ - libgl1-mesa-dev - lsb-release \ - wget \ - software-properties-common - curl -O https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - ./llvm.sh 20 - fi - if [ "${{ matrix.image }}" = "ubuntu:18.04" ] && [ "${{ matrix.system-deps }}" = "true" ]; then - apt-get -y install qt5-default \ - libqt5svg5-dev \ - qttools5-dev \ - qttools5-dev-tools - fi - if [ "${{ matrix.image }}" = "ubuntu:22.04" ]; then - apt-get -y install libclang-12-dev \ - llvm-12 \ - qt6-base-dev \ - qt6-tools-dev \ - qt6-tools-dev-tools \ - libqt6svg6-dev \ - libqt6core5compat6-dev \ - libqt6svgwidgets6 \ - qt6-l10n-tools \ - gcc-12 \ - g++-12 - fi - - uses: actions/setup-python@v6 - if: matrix.system-deps == false - with: - python-version: ${{ matrix.python-version }} - - name: py dependencies - run: | - python3 --version - which python3 - # https://github.com/rizinorg/cutter/runs/7170222817?check_suite_focus=true - python3 -m pip install meson # ==0.61.5 - - name: Prepare package id - shell: bash - run: | - if [ "${{ startsWith(github.event.ref, 'refs/tags')}}" = "true" ] - then - PACKAGE_ID="${{ github.event.ref }}" - else - PACKAGE_ID="git-`date "+%Y-%m-%d"`-${{ format('{0}', github.sha) }}" - fi - PACKAGE_ID=${PACKAGE_ID##refs/tags/} - echo PACKAGE_ID=$PACKAGE_ID >> $GITHUB_ENV - - name: cmake ubuntu - shell: bash - run: | - if [ "${{ matrix.system-deps }}" = "false" ] - then - CUTTER_QT="${{ matrix.qt-major }}" scripts/fetch_deps.sh - . cutter-deps/env.sh - ln -sf "$PWD/cutter-deps/pyside/share/PySide6/"* "$PWD/cutter-deps/pyside/" - export LD_LIBRARY_PATH="`llvm-config --libdir`:$LD_LIBRARY_PATH" - fi - set -e #TODO: move to top once cutter-deps doesn't fail - if [ "${{ matrix.cc-override }}" != "default" ] - then - export CC="${{matrix.cc-override}}" - export CXX="${{matrix.cxx-override}}" - fi - - mkdir build - cd build - if [ "${{ matrix.system-deps }}" = "false" ] - then - locale - locale -a - export LANG="C.UTF-8" - export LC_ALL="C.UTF-8" - cmake \ - -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ - -DCUTTER_ENABLE_PYTHON=ON \ - -DPython3_ROOT_DIR="$CUTTER_DEPS_PYTHON_PREFIX" \ - -DCUTTER_ENABLE_PYTHON_BINDINGS=ON \ - -DCUTTER_ENABLE_GRAPHVIZ=ON \ - -DCUTTER_USE_BUNDLED_RIZIN=ON \ - -DCUTTER_APPIMAGE_BUILD=ON \ - -DCUTTER_ENABLE_PACKAGING=ON \ - -DCUTTER_ENABLE_KSYNTAXHIGHLIGHTING=OFF \ - -DCUTTER_ENABLE_SIGDB=ON \ - -DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON \ - -DCUTTER_PACKAGE_RZ_GHIDRA=ON \ - -DCUTTER_PACKAGE_JSDEC=ON \ - -DCUTTER_PACKAGE_RZ_LIBSWIFT=ON \ - -DCUTTER_PACKAGE_RZ_LIBYARA=ON \ - -DCUTTER_PACKAGE_RZ_SILHOUETTE=ON \ - -DCMAKE_INSTALL_PREFIX=appdir/usr \ - -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \ - -DCUTTER_QT=${{ matrix.qt-major }} \ - .. - else - cmake \ - -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ - -DCUTTER_QT=${{ matrix.qt-major }} \ - -DCUTTER_USE_BUNDLED_RIZIN=ON \ - .. - fi - ninja - if [ "${{ matrix.package }}" = "true" ] - then - export CUTTER_VERSION=$(python ../scripts/get_version.py) - export VERSION=$CUTTER_VERSION - ninja install - "../scripts/appimage_embed_python.sh" appdir ${{ matrix.qt-major == '6' && '6' || '2' }} - APP_PREFIX=`pwd`/appdir/usr - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APP_PREFIX/lib/rizin/plugins" - export PATH=$PATH:${APP_PREFIX}/bin - wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" - chmod a+x linuxdeployqt*.AppImage - rm -fv "../cutter-deps/qt/plugins/imageformats/libqjp2.so" - if [ "${{ matrix.qt-major }}" == "5" ]; then - export APPIMAGE_FILE="Cutter-${PACKAGE_ID}-Linux-Qt5-x86_64.AppImage" - ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop \ - -executable=./appdir/usr/bin/python3 \ - -appimage \ - -no-strip -exclude-libs=libnss3.so,libnssutil3.so,libqjp2.so \ - -ignore-glob=usr/lib/python3.12/**/* \ - -verbose=2 - else - export APPIMAGE_FILE="Cutter-${PACKAGE_ID}-Linux-x86_64.AppImage" - ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop \ - -executable=./appdir/usr/bin/python3 \ - -appimage \ - -no-strip -exclude-libs=libnss3.so,libnssutil3.so,libqjp2.so \ - -exclude-libs="libwayland-client.so,libwayland-egl.so,libwayland-cursor.so" \ - -ignore-glob=usr/lib/python3.12/**/* \ - -extra-plugins="platforms/libqwayland-egl.so,platforms/libqwayland-generic.so,wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-integration,wayland-graphics-integration-server" \ - -verbose=2 - fi - find ./appdir -executable -type f -exec ldd {} \; | cut -d " " -f 2-3 | sort | uniq - # find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq - - mv Cutter-*-x86_64.AppImage "$APPIMAGE_FILE" - echo PACKAGE_NAME=$APPIMAGE_FILE >> $GITHUB_ENV - echo PACKAGE_PATH=build/$APPIMAGE_FILE >> $GITHUB_ENV - echo UPLOAD_ASSET_TYPE=application/x-executable >> $GITHUB_ENV - fi - - name: Create tarball - if: matrix.tarball - shell: bash - run: | - scripts/tarball.sh "Cutter-${PACKAGE_ID}" - echo PACKAGE_NAME=Cutter-${PACKAGE_ID}-src.tar.gz >> $GITHUB_ENV - echo PACKAGE_PATH=Cutter-${PACKAGE_ID}-src.tar.gz >> $GITHUB_ENV - echo UPLOAD_ASSET_TYPE=application/gzip >> $GITHUB_ENV - - uses: actions/upload-artifact@v7 - if: env.PACKAGE_NAME != null - with: - name: ${{ env.PACKAGE_NAME }} - path: ${{ env.PACKAGE_PATH }} - - name: Get release - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - id: get_release - uses: rizinorg/gha-get-release@c8074dd5d13ddd0a194d8c9205a1466973c7dc0d - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload release assets - if: steps.get_release.outputs.upload_url != null && env.PACKAGE_NAME != null - uses: actions/upload-release-asset@v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: ${{ env.PACKAGE_PATH }} - asset_name: ${{ env.PACKAGE_NAME }} - asset_content_type: ${{ env.UPLOAD_ASSET_TYPE }} - - name: Set output - id: output_setup - if: ${{ matrix.name == 'linux-x86_64' }} - run: | - echo "artifact_name=$PACKAGE_NAME" >> "$GITHUB_OUTPUT" - outputs: - artifact_linux: ${{ steps.output_setup.outputs.artifact_name }} - build-linux-old: - name: ${{ matrix.name }} - runs-on: ubuntu-latest # only a host environement, actual building happens in a docker image - strategy: - matrix: - name: [ - linux-x86_64-qt5, - linux-x86_64-qt5-system-deps, - ] - include: - - qt-major: 6 - cc-override: default - cxx-override: default - - name: linux-x86_64-qt5-system-deps # ensure that Cutter can be built at least in basic config on Ubuntu 18.04 using sytem libraries - image: ubuntu:18.04 - python-version: 3.6.x - system-deps: true - package: false - cc-override: '/usr/bin/gcc-7' - cxx-override: '/usr/bin/g++-7' - qt-major: 5 - - name: linux-x86_64-qt5 # qt5 Appimage build for increased compatibility with older distros - image: ubuntu:18.04 - python-version: 3.6.x - system-deps: false - package: true - qt-major: 5 - # Prevent one job from pausing the rest - fail-fast: false - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - persist-credentials: false - - name: Prepare package id - shell: bash - run: | - if [ "${{ startsWith(github.event.ref, 'refs/tags')}}" = "true" ] - then - PACKAGE_ID="${{ github.event.ref }}" - else - PACKAGE_ID="git-`date "+%Y-%m-%d"`-${{ format('{0}', github.sha) }}" - fi - PACKAGE_ID=${PACKAGE_ID##refs/tags/} - echo PACKAGE_ID=$PACKAGE_ID >> $GITHUB_ENV - ls -alh - who - - - name: build linux - id: build - uses: ./.github/actions/build-linux-old - with: - system-deps: ${{ matrix.system-deps }} - image: ${{ matrix.image }} - qt-major: ${{ matrix.qt-major }} - package: ${{ matrix.package }} - - - uses: actions/upload-artifact@v7 - if: env.PACKAGE_NAME != null - with: - name: ${{ steps.build.outputs.PACKAGE_NAME }} - path: ${{ steps.build.outputs.PACKAGE_PATH }} - - name: Get release - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - id: get_release - uses: rizinorg/gha-get-release@c8074dd5d13ddd0a194d8c9205a1466973c7dc0d - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload release assets - if: steps.get_release.outputs.upload_url != null && env.PACKAGE_NAME != null - uses: actions/upload-release-asset@v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: ${{ env.PACKAGE_PATH }} - asset_name: ${{ env.PACKAGE_NAME }} - asset_content_type: ${{ env.UPLOAD_ASSET_TYPE }} - - - build: - name: ${{ matrix.name }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - name: [ - macos-x86_64, - macos-arm64, - windows-x86_64, - ] - include: - - python-version: 3.12.x - - system-deps: false - - output-id: "" - - name: windows-x86_64 - os: windows-2022 - package: true - python-version: 3.12.x - output-id: artifact_windows - - name: macos-x86_64 - os: macos-14 - arch: x86_64 - package: true - - name: macos-arm64 - os: macos-14 - arch: arm64 - package: true - output-id: artifact_macos - # Prevent one job from pausing the rest - fail-fast: false - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - persist-credentials: false - - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - - name: homebrew dependencies - if: contains(matrix.os, 'macos') - run: | - cd scripts - rm /usr/local/bin/2to3* # symlink to some kind of existing python2.7 installation conflicts with brew python3 which gets installed as indirect dependency - brew bundle - brew install pkg-config || brew link --overwrite pkgconf - brew install kadwanev/brew/retry - brew install llvm@20 && brew link llvm@20 - - name: py dependencies - run: | - #python3 -m pip install -U pip==21.3.1 - pip install meson # ==0.61.5 # https://github.com/rizinorg/cutter/runs/7170222817?check_suite_focus=true - pip install setuptools - - name: Prepare package id - shell: bash - run: | - if [[ "${{ startsWith(github.event.ref, 'refs/tags')}}" = "true" ]] - then - PACKAGE_ID="${{ github.event.ref }}" - else - PACKAGE_ID="git-`date "+%Y-%m-%d"`-${{ format('{0}', github.sha) }}" - fi - PACKAGE_ID=${PACKAGE_ID##refs/tags/} - echo PACKAGE_ID=$PACKAGE_ID >> $GITHUB_ENV - - name: cmake macos - shell: bash - if: contains(matrix.os, 'macos') - run: | - export MACOSX_DEPLOYMENT_TARGET=10.15 - scripts/fetch_deps.sh - install_name_tool -delete_rpath /Users/runner/work/cutter-deps/cutter-deps/qt/lib ./cutter-deps/pyside/lib/libpyside6.cpython-312-darwin.6.11.dylib #TODO: do this in cutter-deps - source cutter-deps/env.sh - ln -sf "$PWD/cutter-deps/pyside/share/PySide6/"* "$PWD/cutter-deps/pyside/" - set -euo pipefail - export PATH=/usr/local/opt/llvm/bin:$PATH - mkdir build - cd build - PACKAGE_NAME=Cutter-${PACKAGE_ID}-macOS-${{ matrix.arch }} - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DPython3_ROOT_DIR="${CUTTER_DEPS_PYTHON_PREFIX}" \ - -DPython_ROOT_DIR="${CUTTER_DEPS_PYTHON_PREFIX}" \ - -DPython3_FIND_STRATEGY="LOCATION" \ - -DPython_FIND_STRATEGY="LOCATION" \ - -DCUTTER_ENABLE_PYTHON=ON \ - -DCUTTER_ENABLE_PYTHON_BINDINGS=ON \ - -DCUTTER_USE_BUNDLED_RIZIN=ON \ - -DCUTTER_ENABLE_PACKAGING=ON \ - -DCUTTER_ENABLE_SIGDB=ON \ - -DCUTTER_PACKAGE_DEPENDENCIES=ON \ - -DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON \ - -DCUTTER_PACKAGE_RZ_GHIDRA=ON \ - -DCUTTER_PACKAGE_JSDEC=ON \ - -DCUTTER_PACKAGE_RZ_LIBSWIFT=ON \ - -DCUTTER_PACKAGE_RZ_LIBYARA=ON \ - -DCUTTER_PACKAGE_RZ_SILHOUETTE=ON \ - -DCPACK_PACKAGE_FILE_NAME="$PACKAGE_NAME" \ - -DCPACK_BUNDLE_APPLE_CERT_APP="-" \ - .. && \ - make -j4; - # Reduce chance for random hdiutil "Resource busy" error when creating the dmg - # https://github.com/actions/runner-images/issues/7522#issuecomment-1556766641 - echo killing XProtectBehaviorService; sudo pkill -9 XProtect >/dev/null || true; - echo waiting for XProtectBehaviorService kill; while pgrep XProtect; do sleep 3; done; - retry make package - export CUTTER_VERSION=$(python3 ../scripts/get_version.py) - echo PACKAGE_NAME=${PACKAGE_NAME}.dmg >> $GITHUB_ENV - echo PACKAGE_PATH=build/${PACKAGE_NAME}.dmg >> $GITHUB_ENV - echo UPLOAD_ASSET_TYPE=application/x-apple-diskimage >> $GITHUB_ENV - - name: windows dependencies - if: contains(matrix.os, 'windows') - shell: bash - run: | - pip install ninja - scripts/fetch_deps.sh - ln -sf "$PWD/cutter-deps/pyside/share/PySide6/"* "$PWD/cutter-deps/pyside/" - choco install winflexbison3 - - name: windows cmake - if: contains(matrix.os, 'windows') - shell: cmd - run: | - set ARCH=x64 - set CUTTER_DEPS=%CD%\cutter-deps - set PATH=%CD%\cutter-deps\qt\bin;%PATH% - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 - cd - mkdir build - cd build - set PACKAGE_NAME=Cutter-%PACKAGE_ID%-Windows-x86_64 - cmake ^ - -DCMAKE_BUILD_TYPE=Release ^ - -DCUTTER_USE_BUNDLED_RIZIN=ON ^ - -DCUTTER_ENABLE_PYTHON=ON ^ - -DCUTTER_ENABLE_PYTHON_BINDINGS=ON ^ - -DCUTTER_ENABLE_PACKAGING=ON ^ - -DPython3_FIND_REGISTRY=NEVER ^ - -DPython3_FIND_STRATEGY=LOCATION ^ - -DPython_FIND_REGISTRY=NEVER ^ - -DPython_FIND_STRATEGY=LOCATION ^ - -DCUTTER_ENABLE_SIGDB=ON ^ - -DCUTTER_PACKAGE_DEPENDENCIES=ON ^ - -DCUTTER_PACKAGE_RZ_GHIDRA=ON ^ - -DCUTTER_PACKAGE_RZ_LIBSWIFT=ON ^ - -DCUTTER_PACKAGE_RZ_LIBYARA=ON ^ - -DCUTTER_PACKAGE_RZ_SILHOUETTE=ON ^ - -DCUTTER_PACKAGE_JSDEC=ON ^ - -DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON ^ - -DCMAKE_PREFIX_PATH="%CUTTER_DEPS%\pyside" ^ - -DCPACK_PACKAGE_FILE_NAME=%PACKAGE_NAME% ^ - -G Ninja ^ - .. - cmake --build . --config Release - cmake --build . --config Release --target package - echo PACKAGE_NAME=%PACKAGE_NAME%.zip >> %GITHUB_ENV% - echo PACKAGE_PATH=build/%PACKAGE_NAME%.zip >> %GITHUB_ENV% - echo UPLOAD_ASSET_TYPE=application/zip >> %GITHUB_ENV% - - uses: actions/upload-artifact@v7 - if: env.PACKAGE_NAME != null - with: - name: ${{ env.PACKAGE_NAME }} - path: ${{ env.PACKAGE_PATH }} - - name: Get release - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - id: get_release - uses: rizinorg/gha-get-release@c8074dd5d13ddd0a194d8c9205a1466973c7dc0d - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload release assets - if: steps.get_release.outputs.upload_url != null && env.PACKAGE_NAME != null - uses: actions/upload-release-asset@v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: ${{ env.PACKAGE_PATH }} - asset_name: ${{ env.PACKAGE_NAME }} - asset_content_type: ${{ env.UPLOAD_ASSET_TYPE }} - - - name: Set output - if: matrix.output-id != '' - id: output_setup - shell: bash - run: | - echo "${{ matrix.output-id }}=${PACKAGE_NAME}" >> "$GITHUB_OUTPUT" - outputs: - artifact_macos: ${{ steps.output_setup.outputs.artifact_macos }} - artifact_windows: ${{ steps.output_setup.outputs.artifact_windows }} - - plugin-test: - name: plugin-test-${{ matrix.name }} - runs-on: ${{ matrix.os }} - needs: [build-linux, build] - strategy: - matrix: - name: [ - linux-x86_64, - macos-arm64, - windows, - ] - include: - - name: linux-x86_64 - os: ubuntu-22.04 - artifact-job: build-linux - artifact-output: artifact_linux - - name: macos-arm64 - os: macos-14 - artifact-job: build - artifact-output: artifact_macos - - name: windows - os: windows-2022 - artifact-job: build - artifact-output: artifact_windows - fail-fast: false - steps: - - uses: actions/checkout@v4 - with: - path: 'cutter-src-tmp' - persist-credentials: false - # Only needed for QT, in theory could use qt that's sourced in other way. - # But that introduces risk of problems caused by incompatibility between the two versions. - - name: Cutter deps - shell: bash - run: | - echo "PACKAGE_NAME=${{needs[matrix.artifact-job].outputs[matrix.artifact-output] || 'bad_id'}}" >> $GITHUB_ENV - ls -alh - pwd - ./cutter-src-tmp/scripts/fetch_deps.sh - cp -r ./cutter-src-tmp/src/plugins/sample-cpp . - rm -r ./cutter-src-tmp/cutter-deps/python/ || true # copying python folder on macOs doesn't work well, it's not needed for plugin compilation - cp -r ./cutter-src-tmp/cutter-deps . - rm -r cutter-src-tmp - ls -alh - pwd - - - name: Download cutter build - uses: actions/download-artifact@v4 - with: - name: ${{ needs[matrix.artifact-job].outputs[matrix.artifact-output] || 'bad_id2' }} - - name: build-linux - if: contains(matrix.name, 'linux') - run: | - sudo apt-get -y install libxcb1-dev \ - libxkbcommon-dev \ - libxcb-*-dev \ - libegl1 \ - mesa-common-dev - ls - chmod +x ./$PACKAGE_NAME - ./$PACKAGE_NAME --appimage-extract - - cd sample-cpp - mkdir build - cmake -B build -DCMAKE_PREFIX_PATH="$PWD/../squashfs-root/usr/;$PWD/../cutter-deps/qt" --debug-find-pkg=Qt6Widgets -DQT_DEBUG_FIND_PACKAGE=ON - cmake --build build - - name: build-macos - if: contains(matrix.name, 'macos') - run: | - hdiutil attach $PACKAGE_NAME - ls /Volumes/Cutter/ - cd sample-cpp - mkdir build - cmake -B build -DCMAKE_PREFIX_PATH="/Volumes/Cutter/Cutter.app/Contents/Resources;../cutter-deps/qt" - cmake --build build - - name: Build windows - if: contains(matrix.name, 'windows') - shell: cmd - run: | - 7z.exe x %PACKAGE_NAME% - ren %PACKAGE_NAME:~0,-4% cutter - dir - cd sample-cpp - mkdir build - cmake -B build -DCMAKE_PREFIX_PATH="%CD%/../cutter;%CD%/../cutter-deps/qt" - cmake --build build diff --git a/.github/workflows/workflows/coverity-scan.yml b/.github/workflows/workflows/coverity-scan.yml deleted file mode 100644 index 58a4886f06..0000000000 --- a/.github/workflows/workflows/coverity-scan.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: coverity-scan -on: - schedule: - - cron: "0 9 * * 1,5" # Bi-weekly at 09:00 UTC on Monday and Thursday - -jobs: - latest: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - uses: actions/setup-python@v6 - with: - python-version: 3.9.x - - - name: Download Coverity Build Tool - run: | - wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=rizinorg%2Fcutter" -O cov-analysis-linux64.tar.gz - mkdir cov-analysis-linux64 - tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 - env: - TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} - - - name: Fixed world writable dirs - run: | - chmod go-w $HOME - sudo chmod -R go-w /usr/share - - - name: apt dependencies - run: sudo apt-get install ninja-build libgraphviz-dev mesa-common-dev - - - name: py dependencies - run: | - pip install meson - - - name: CMake - run: | - scripts/fetch_deps.sh - source cutter-deps/env.sh - export LD_LIBRARY_PATH="`llvm-config --libdir`:$LD_LIBRARY_PATH" - mkdir build - cd build - cmake .. - - - name: Build with cov-build - run: | - export PATH=`pwd`/cov-analysis-linux64/bin:$PATH - cd build - cov-build --dir cov-int make - - - name: Submit the result to Coverity Scan - run: | - cd build - tar czvf cutter.tgz cov-int - curl \ - --form project=radareorg-cutter \ - --form token=$TOKEN \ - --form email=noreply@radare.org \ - --form file=@cutter.tgz \ - --form version=trunk \ - --form description="Cutter" \ - https://scan.coverity.com/builds?project=radareorg%2Fcutter - env: - TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} diff --git a/.github/workflows/workflows/docs.yml b/.github/workflows/workflows/docs.yml deleted file mode 100644 index a4e77ac303..0000000000 --- a/.github/workflows/workflows/docs.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Docs - -on: - push: - branches: - - dev - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: install dependencies - run: | - sudo apt-get install -y doxygen - pip install -U sphinx breathe sphinx-rtd-theme recommonmark - - name: build docs - run: | - export PATH="/home/runner/.local/bin:$PATH" - cd docs - make html - cd .. - - name: deploy docs - run: | - openssl aes-256-cbc -K ${{ secrets.CUTTER_DOCS_KEY }} -iv ${{ secrets.CUTTER_DOCS_IV }} -in scripts/deploy_docs_rsa.enc -out scripts/deploy_docs_rsa -d - chmod 600 scripts/deploy_docs_rsa - export GIT_SSH_COMMAND="/usr/bin/ssh -i $PWD/scripts/deploy_docs_rsa" - git config --global user.name "Github Actions" - git config --global user.email "actions@github.com" - bash scripts/deploy_docs.sh diff --git a/.github/workflows/workflows/linter.yml b/.github/workflows/workflows/linter.yml deleted file mode 100644 index 39171b890f..0000000000 --- a/.github/workflows/workflows/linter.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: "Linter" - -on: - push: - branches: - - dev - - stable - pull_request: - branches: - - dev - - stable - -jobs: - changes: - runs-on: ubuntu-latest - outputs: - clang-format: ${{ steps.filter.outputs.clang-format }} - steps: - - uses: actions/checkout@v4 - - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - clang-format: - - '**.cpp' - - '**.c' - - '**.h' - - '.github/workflows/linter.yml' - - 'scripts/clang-format.py' - - '_clang-format' - - clang-format: - needs: changes - runs-on: ubuntu-22.04 - if: ${{ needs.changes.outputs.clang-format == 'true' }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install wget, software-properties-common, lsb-release (dependencies of LLVM install script) - run: sudo apt --assume-yes install wget software-properties-common lsb-release - - - name: Uninstall old conflicting packages - run: sudo apt purge --assume-yes --auto-remove llvm python3-lldb-14 llvm-14 - - - name: Install automatic LLVM 16 - run: wget https://apt.llvm.org/llvm.sh -O /tmp/llvm-install.sh; chmod +x /tmp/llvm-install.sh; sudo /tmp/llvm-install.sh 16 - - - name: Install clang-format-16 - run: sudo apt --assume-yes install clang-format-16 - - - name: Install gitpython - run: sudo pip install gitpython - - - name: Run clang-format - run: | - sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-16 160 - clang-format --version - python scripts/clang-format.py --check --verbose