From a03215e967dd5b192f7d5999deb8a4e6cb796632 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Thu, 24 Oct 2024 15:47:50 +0300 Subject: [PATCH 01/40] Add Ubuntu CI in github vm and rewrite rockylinux CI --- .github/workflows/linux_build.yml | 35 +++++++++++-- .github/workflows/macos_build.yml | 13 ++--- .github/workflows/setup_environment.yml | 66 ++++++++++++++----------- buildScripts/github/build.sh | 6 ++- buildScripts/github/build_installer.sh | 11 ++--- buildScripts/github/install_Linux.sh | 38 +++++++++++--- buildScripts/github/run_tests.sh | 2 +- buildScripts/github/test.sh | 5 +- 8 files changed, 115 insertions(+), 61 deletions(-) diff --git a/.github/workflows/linux_build.yml b/.github/workflows/linux_build.yml index 8622d86fc8..3b0df1ec13 100644 --- a/.github/workflows/linux_build.yml +++ b/.github/workflows/linux_build.yml @@ -51,7 +51,7 @@ jobs: os: ubuntu-latest build: true build_installer: false - qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent" + qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers" build-altlinux-release-tests: needs: lint @@ -61,9 +61,19 @@ jobs: container_name: "altlinux/base:latest" build: true build_installer: false - qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent" + qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers" tests: true - executor: time + + build-rockylinux-release-tests: + needs: lint + uses: ./.github/workflows/setup_environment.yml + with: + os: ubuntu-latest + container_name: "rockylinux:9" + build: true + build_installer: false + qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=sanitizer CONFIG+=sanitize-undefined" + gcc_version: "13" build-ubuntu-debug-tests: needs: lint @@ -73,7 +83,8 @@ jobs: build: true build_installer: false config: debug - qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" + qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" + trik_python3_version_minor: 10 build-ubuntu-installer: needs: [build-ubuntu-debug-tests, build-ubuntu-release-tests] @@ -82,6 +93,20 @@ jobs: os: ubuntu-latest build: true build_installer: true - qmake_extra: "CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" + qmake_extra: "CONFIG+=noPch CONFIG+=ccache" + tests: true + trik_python3_version_minor: 10 + secrets: inherit + + build-rockylinux-installer: + needs: [build-rockylinux-release-tests] + uses: ./.github/workflows/setup_environment.yml + with: + os: ubuntu-latest + container_name: "rockylinux:9" + build: true + build_installer: true tests: true + qmake_extra: "CONFIG+=noPch CONFIG+=ccache" + gcc_version: "13" secrets: inherit diff --git a/.github/workflows/macos_build.yml b/.github/workflows/macos_build.yml index af00d54cf6..3df76ee7bd 100644 --- a/.github/workflows/macos_build.yml +++ b/.github/workflows/macos_build.yml @@ -50,33 +50,30 @@ jobs: uses: ./.github/workflows/setup_environment.yml with: os: macos-12 - executor: "time" build: true build_installer: false - qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" - trik-python3-version-minor: "11" + qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=warn_off" + trik_python3_version_minor: "11" build-macos-debug-tests: needs: lint uses: ./.github/workflows/setup_environment.yml with: os: macos-12 - executor: "time" build: true build_installer: false config: debug - qmake_extra: "CONFIG+=warn_off CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" - trik-python3-version-minor: "11" + qmake_extra: "CONFIG+=warn_off CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" + trik_python3_version_minor: "11" build-macos-installer: needs: [build-macos-debug-tests, build-macos-release-tests] uses: ./.github/workflows/setup_environment.yml with: os: macos-12 - executor: "time" build: true build_installer: true qmake_extra: " CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" - trik-python3-version-minor: "11" + trik_python3_version_minor: "11" tests: true secrets: inherit diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index ffa1b8a40e..7c4e208ba2 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -9,7 +9,7 @@ on: executor: required: false type: string - default: "time docker exec -i builder" + default: "time" lint: required: false type: string @@ -20,19 +20,19 @@ on: build_installer: required: true type: string - trik-qt-version: + trik_qt_version: required: false type: string default: '5.12' - trik-python3-version-minor: + trik_python3_version_minor: required: false type: string default: '9' - qtifw-version: + qtifw_version: required: false type: string default: '4.6.1' - xcode-version: + xcode_version: required: false type: string default: '13.4' @@ -52,25 +52,30 @@ on: required: false type: string default: "" + gcc_version: + required: false + type: string + default: "13" jobs: job: defaults: run: - shell: bash + shell: bash -l {0} runs-on: ${{ inputs.os }} - container: - image: ${{ inputs.container_name }} - options: > - -v ${{ github.workspace }}:${{ github.workspace }} - -w ${{ github.workspace }} + container: ${{ inputs.container_name }} steps: - name: Install dependencies run: apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git if: startsWith(inputs.container_name, 'altlinux') == true + + - name: Install dependencies + run: yum update -y && yum install -y git-core + if: startsWith(inputs.container_name, 'rocky') == true + - name: Configure git run: | git config --global core.symlinks true @@ -80,18 +85,23 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - fetch-depth: 0 + fetch-depth: 1 - name: Set up environment run: buildScripts/github/install_${{ runner.os }}.sh env: - TRIK_QT_VERSION: ${{ inputs.trik-qt-version }} - TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }} - QTIFW_VERSION: ${{ inputs.qtifw-version }} - XCODE_VERSION: ${{ inputs.xcode-version }} + TRIK_QT_VERSION: ${{ inputs.trik_qt_version }} + TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik_python3_version_minor }} + QTIFW_VERSION: ${{ inputs.qtifw_version }} + XCODE_VERSION: ${{ inputs.xcode_version }} + BUILD_INSTALLER: ${{ inputs.build_installer }} + GCC_VERSION: ${{ inputs.gcc_version }} + if: ${{ inputs.build == 'true' }} - name: Lint - run: ${{ inputs.executor }} buildScripts/github/vera_translation.sh + run: | + sudo apt-get update && sudo apt-get install -y --no-install-recommends qttools5-dev-tools qtbase5-dev vera++ + ${{ inputs.executor }} buildScripts/github/vera_translation.sh if: ${{ inputs.lint == 'true' }} - name: Restore cache @@ -108,9 +118,9 @@ jobs: - name: Build run: buildScripts/github/build.sh env: - TRIK_QT_VERSION: ${{ inputs.trik-qt-version }} - TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }} - CCACHE_DIR: ${{ github.workspace }}/.ccache/${{ inputs.os }}-c${{ inputs.container_name }}-${{ inputs.config }} + TRIK_QT_VERSION: ${{ inputs.trik_qt_version }} + TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik_python3_version_minor }} + CACHE_DIR: ${{ github.workspace }}/.ccache/${{ inputs.os }}-c${{ inputs.container_name }}-${{ inputs.config }} CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache.conf PROJECT: "studio" CONFIG: ${{ inputs.config }} @@ -126,26 +136,22 @@ jobs: if: ${{ inputs.build == 'true' }} - name: Run tests - run: ${{ inputs.executor }} buildScripts/github/run_tests.sh + run: ${{ inputs.executor }} buildScripts/github/run_tests.sh && ${{ inputs.executor }} buildScripts/github/test.sh env: - TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }} + TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik_python3_version_minor }} TESTS: ${{ inputs.tests }} if: ${{ inputs.build == 'true' }} - name: Build Installer run: | BRANCH_NAME=${BRANCH_NAME//\//-} - ${{ inputs.executor }} env CONFIG=${{ inputs.config }} buildScripts/github/test.sh && buildScripts/github/build_installer.sh + buildScripts/github/build_installer.sh env: - TRIK_QT_VERSION: ${{ inputs.trik-qt-version }} - TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik-python3-version-minor }} - CCACHE_DIR: ${{ github.workspace }}/.ccache/${{ inputs.os }}-c${{ inputs.container_name }}-${{ inputs.config }} - CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache.conf + TRIK_QT_VERSION: ${{ inputs.trik_qt_version }} + TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik_python3_version_minor }} PROJECT: "studio" CONFIG: ${{ inputs.config }} EXECUTOR: ${{ inputs.executor }} - QMAKE_EXTRA: ${{ inputs.qmake_extra }} - TESTS: ${{ inputs.tests }} BRANCH_NAME: ${{ github.event.pull_request.head.ref }} PULLREQUESTNUMBER: ${{ github.event.pull_request.number }} ssh_key: ${{ secrets.DL_PRIVATE_SSH_KEY }} @@ -156,7 +162,7 @@ jobs: - name: Upload installer artifact uses: actions/upload-artifact@v4 with: - name: ${{ runner.os }}-installer + name: ${{ runner.os }}-${{ inputs.container_name }}-installer path: | installer/*.exe installer/*.run diff --git a/buildScripts/github/build.sh b/buildScripts/github/build.sh index 19505c5367..89f8631794 100755 --- a/buildScripts/github/build.sh +++ b/buildScripts/github/build.sh @@ -2,6 +2,8 @@ set -uxeo pipefail CODECOV=true +CCACHE_DIR="$CACHE_DIR" + case $RUNNER_OS in macOS) QT_DIR=$(ls -dv "$HOME"/Qt/${TRIK_QT_VERSION}*/*/bin | head -n 1) @@ -11,8 +13,8 @@ case $RUNNER_OS in echo "Now path is $PATH" ;; Linux) - ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) - if [ "$ID" = "altlinux" ]; then + ID=$(grep '^ID=' /etc/*release | cut -d'=' -f2) + if [[ "$ID" = "altlinux" || "$ID" = "rocky" || "$ID" = '"rocky"' ]]; then ln -s /usr/bin/qmake-qt5 /usr/bin/qmake fi ;; diff --git a/buildScripts/github/build_installer.sh b/buildScripts/github/build_installer.sh index d3f27f65f1..6b359fea98 100755 --- a/buildScripts/github/build_installer.sh +++ b/buildScripts/github/build_installer.sh @@ -5,13 +5,12 @@ QTBIN=${QTBIN:-$($EXECUTOR bash -c 'eval $(make qmake -n | cut -f 1 -d " ") -qu case $RUNNER_OS in macOS) QTIFWBIN=$HOME/qtifw/bin - TSNAME=trik-studio-installer-mac-$BRANCH_NAME.dmg -# export TRIK_PYTHON3_VERSION_MINOR="$(python3 -V | sed 's#^Python 3\.\([0-9]+\)\.[0-9]+$#\1#g')" + TSNAME="trik-studio-installer-mac-$BRANCH_NAME.dmg" ;; Linux) - QTIFWBIN=/opt/qtifw/bin - #QTIFWBIN=$($EXECUTOR bash -c 'find /Qt/Tools/QtInstallerFramework/ -maxdepth 2 -name bin -type d -print0 | sort -Vrz | head -zn 1') - TSNAME=trik-studio-installer-linux-$BRANCH_NAME.run + QTIFWBIN=$(find /Qt/Tools -name "bin" | head -n 1) + ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) + TSNAME="trik-studio-installer-linux-$BRANCH_NAME-$ID.run" ;; *) exit 1 ;; esac @@ -27,7 +26,7 @@ if [[ $RUNNER_OS == Linux ]] ; then echo Start build checker archive $EXECUTOR bash -c "bin/build-checker-installer.sh" if $NEED_DEPLOY ; then - $EXECUTOR bash -c "rsync -v --rsh='ssh -o StrictHostKeyChecking=no' bin/trik_checker.tar.xz $username@$host:~/dl/ts/fresh/checker/checker-linux-$CONFIG-$BRANCH_NAME.tar.xz" + $EXECUTOR bash -c "rsync -v --rsh='ssh -o StrictHostKeyChecking=no' bin/trik_checker.tar.xz $username@$host:~/dl/ts/fresh/checker/checker-linux-$CONFIG-$BRANCH_NAME-$ID.tar.xz" fi fi diff --git a/buildScripts/github/install_Linux.sh b/buildScripts/github/install_Linux.sh index d35b7b4032..d83b684b71 100755 --- a/buildScripts/github/install_Linux.sh +++ b/buildScripts/github/install_Linux.sh @@ -2,13 +2,37 @@ set -euxo pipefail ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) +BUILD_INSTALLER=${BUILD_INSTALLER:-false} +GCC_VERSION=${GCC_VERSION:-13} +TRIK_PYTHON="python3.${TRIK_PYTHON3_VERSION_MINOR}" if [ "$ID" = "altlinux" ]; then - apt-get update && apt-get install -y gcc-c++ curl xz p7zip-standalone rsync libusb-devel \ - libudev-devel libGL-devel libGLX-mesa python3-dev zlib-devel make ccache python3-module-pip time \ - rsync qt5-multimedia-devel qt5-svg-devel qt5-script-devel qt5-tools qt5-serialport-devel -else - docker pull trikset/linux-builder - docker run --cap-add SYS_PTRACE -d -v $HOME:$HOME:rw -w `pwd` --name builder trikset/linux-builder Xvfb :0 - docker exec builder git config --global --add safe.directory '*' + apt-get update && apt-get install -y gcc-c++ curl xz p7zip-standalone rsync libusb-devel \ + libudev-devel libGL-devel libGLX-mesa python3-dev zlib-devel make ccache python3-module-pip time \ + qt5-multimedia-devel qt5-svg-devel qt5-script-devel qt5-tools qt5-serialport-devel +elif [ "$ID" = "ubuntu" ]; then + sudo apt-get update && sudo apt-get install -y --no-install-recommends \ + ccache curl libusb-1.0-0-dev make qtscript5-dev qttools5-dev-tools qtmultimedia5-dev libqt5serialport5-dev libqt5svg5-dev \ + libudev-dev python3.${TRIK_PYTHON3_VERSION_MINOR}-dev qtbase5-private-dev +elif [[ "$ID" = "rocky" || "$ID" = '"rocky"' ]]; then + yum update -y && yum install -y epel-release + yum install --allowerasing -y sudo which libusbx-devel curl wget make gcc-toolset-"$GCC_VERSION"-{gcc-c++,libasan-devel,libubsan-devel,gdb} \ + git-core ccache zlib-devel rsync python3-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip xz time + yum install -y libxkbcommon-x11 qt5-qtbase-gui #no desire to enumerate all required libraries for QtIFw + yum install -y pulseaudio-libs-glib2 # to run TS and 2D-model even with `minimal` platform + + # yum install -y qt5-qtscript-devel qt5-qttools-devel qt5-qtmultimedia-devel qt5-qtserialport-devel qt5-qtsvg-devel qt5-qtbase-devel + "$TRIK_PYTHON" -m pip install -U pip + "$TRIK_PYTHON" -m pip install aqtinstall + aqt install-qt linux desktop "$TRIK_QT_VERSION" -O /Qt -m qtscript --archives qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats icu qtwayland + QT_ROOT_DIR=$(ls -1d /Qt/"$TRIK_QT_VERSION"*/gcc_64 | head -n 1) + + echo "$QT_ROOT_DIR/bin" >> $GITHUB_PATH + echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile +fi + +if [ "$BUILD_INSTALLER" = "true" ]; then + "$TRIK_PYTHON" -m pip install -U pip + "$TRIK_PYTHON" -m pip install aqtinstall + "$TRIK_PYTHON" -m aqt install-tool -O /Qt linux desktop tools_ifw fi diff --git a/buildScripts/github/run_tests.sh b/buildScripts/github/run_tests.sh index 6793fdea0a..957fb52af6 100755 --- a/buildScripts/github/run_tests.sh +++ b/buildScripts/github/run_tests.sh @@ -1,6 +1,6 @@ #!/bin/bash export QT_QPA_PLATFORM=minimal -export ASAN_OPTIONS=$(if [[ $RUNNER_OS == Linux ]]; then echo 'detect_leaks=1:'; else echo -n ''; fi)detect_stack_use_after_return=1:fast_unwind_on_malloc=0 +export ASAN_OPTIONS=$(if [[ $RUNNER_OS == Linux ]]; then echo 'detect_leaks=1:'; else echo -n ''; fi)detect_stack_use_after_return=1:fast_unwind_on_malloc=0:detect_odr_violation=0 # dirty hack for libtrikQsLog and libtrikRuntimeQsLog export LSAN_OPTIONS=suppressions=$PWD/bin/lsan.supp:print_suppressions=0 export DISPLAY=:0 export TRIK_PYTHONPATH=${TRIK_PYTHONPATH:-$(python3.${TRIK_PYTHON3_VERSION_MINOR} -c 'import sys; import os; print(os.pathsep.join(sys.path))')} diff --git a/buildScripts/github/test.sh b/buildScripts/github/test.sh index 2f24452a3f..279b345302 100755 --- a/buildScripts/github/test.sh +++ b/buildScripts/github/test.sh @@ -2,8 +2,9 @@ set -euo pipefail [ -r tests_qrs.7z ] || curl -Lo tests_qrs.7z https://dl.trikset.com/edu/.solutions20200701/testing_small.7z -7z -y x tests_qrs.7z -env ASAN_OPTIONS=${ASAN_OPTIONS:-use_sigaltstack=0:fast_unwind_on_malloc=0:detect_leaks=1:detect_stack_use_after_return=1} \ +which 7z &> /dev/null && 7z -y x tests_qrs.7z || 7za x tests_qrs.7z +export ASAN_OPTIONS=$(if [[ $RUNNER_OS == Linux ]]; then echo 'detect_leaks=1:'; else echo -n ''; fi)detect_stack_use_after_return=1:fast_unwind_on_malloc=0:detect_odr_violation=0 # dirty hack for +env ASAN_OPTIONS=${ASAN_OPTIONS} \ LSAN_OPTIONS=${LSAN_OPTIONS:-suppressions=$PWD/bin/lsan.supp:print_suppressions=0} \ QT_QPA_PLATFORM=${QT_QPA_PLATFORM:-minimal} \ TRIK_PYTHONPATH=${TRIK_PYTHONPATH:-$(python3.${TRIK_PYTHON3_VERSION_MINOR} -c 'import sys; import os; print(os.pathsep.join(sys.path))')} \ From ea52984ec9dce4f299fc26c869fc95cd1dcb1a64 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Thu, 24 Oct 2024 15:49:13 +0300 Subject: [PATCH 02/40] Delete unnecessary files --- .github/workflows/rockylinux.yml | 212 ------------------------ buildScripts/docker/Dockerfile.altlinux | 19 --- 2 files changed, 231 deletions(-) delete mode 100644 .github/workflows/rockylinux.yml delete mode 100644 buildScripts/docker/Dockerfile.altlinux diff --git a/.github/workflows/rockylinux.yml b/.github/workflows/rockylinux.yml deleted file mode 100644 index 207d63e0f8..0000000000 --- a/.github/workflows/rockylinux.yml +++ /dev/null @@ -1,212 +0,0 @@ -name: Check with RockyLinux -on: - push: - branches-ignore: - - 'dependabot**' - tags: - - '*' - paths-ignore: - - '**/lsan.supp' - - 'buildScripts/travis/*' - - 'buildScripts/azure/*' - - 'buildScripts/docker/*' - - 'azure-pipelines.yml' - - '.cirrus.yml' - - '.travis.yml' - - '.mergify.yml' - - 'Brewfile' - - '**/*.html' - - '**/*.txt' - - '**/*.md' - - 'installer/packages/**/meta/prebuild-win32.sh' - - '**/*.dockerfile' - - '**/*.Dockerfile' - - '**/Dockerfile' - - '**/Dockerfile.*' - - 'plugins/robots/checker/scripts/build-checker-installer.sh' - - '.github/workflows/main.yml' - pull_request: - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - lint: - uses: ./.github/workflows/setup_environment.yml - with: - os: ubuntu-latest - lint: true - build: false - build_installer: false - build: - needs: lint - runs-on: ubuntu-latest - container: rockylinux:9 - defaults: - run: - shell: bash -l {0} # to force import of ~/.bash_profile - strategy: - fail-fast: false - matrix: - include: - - qt-version: '5.12' - python-minor: 9 - gcc-version: 13 - deploy-installer: true - - steps: - - - name: Install packages - run: | - yum install -y epel-release # for ccache and p7zip - yum update -y # useless? - yum install --allowerasing -y \ - sudo which \ - libusbx-devel curl wget make gcc-toolset-${{ matrix.gcc-version }}-{gcc-c++,libasan-devel,libubsan-devel,gdb} \ - git-core ccache zlib-devel rsync python3-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip - - yum install -y libxkbcommon-x11 qt5-qtbase-gui #no desire to enumerate all required libraries for QtIFw - yum install -y pulseaudio-libs-glib2 # to run TS and 2D-model even with `minimal` platform - - echo "source scl_source enable gcc-toolset-${{ matrix.gcc-version }}" >> ~/.bash_profile - - - name: Prepare environment variables - run: | - DIR=$(realpath "$GITHUB_WORKSPACE"/../build) - echo "BUILD_DIR=$DIR" >> $GITHUB_ENV - echo "LC_ALL=C.UTF-8" >> $GITHUB_ENV - - - name: Configure git - run: | - git --version - git config --global core.symlinks true - git config --global core.autocrlf false - - #prepare for actions/checkout, otherwise it fails - #echo "$(dirname $(realpath $(which git)))" >> $GITHUB_PATH - #echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV - #echo "PERL5LIB=$PERL5LIB" >> $GITHUB_ENV - - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 1 - submodules: recursive - - - name: Inject slug/short variables - uses: rlespinasse/github-slug-action@v3.x - - - name: Create build directory - run: mkdir -vp ${{ env.BUILD_DIR }} - - - name: Install Qt - run: | - set -ueo pipefail - python3 -m pip install -U pip - python3 -m pip install aqtinstall - aqt install-qt linux desktop "${{ matrix.qt-version }}" -O /Qt -m qtscript --archives qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats icu qtwayland - aqt install-tool linux desktop tools_ifw -O /Qt - - QT_ROOT_DIR=$(ls -1d /Qt/${{ matrix.qt-version }}*/gcc_64 | head -n 1) - - echo "IQTA_TOOLS=/Qt/Tools" >> $GITHUB_ENV - echo "QT_ROOT_DIR=$QT_ROOT_DIR" >> $GITHUB_ENV - echo "$QT_ROOT_DIR/bin" >> $GITHUB_PATH - - - - name: Check PATH - run: echo PATH="$PATH" - - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2.14 - - - name: Check available tools - run: | - set -xueo pipefail - uname -a - rsync --version - qmake --version && qmake -query - python3 --version - which g++ - g++ --version - ccache --version - - - name: QMake - timeout-minutes: 1 - run: | - cd ${{ env.BUILD_DIR }} - qmake $GITHUB_WORKSPACE/studio.pro CONFIG+=release CONFIG+=tests \ - PYTHON_VERSION=3.${{ matrix.python-minor }} PYTHON_DIR=$(python-3.${{ matrix.python-minor }}-config --prefix) \ - CONFIG+=noPch CONFIG+=ccache CONFIG+=sanitizer CONFIG+=sanitize-undefined - - - name: QMake all - timeout-minutes: 5 - run: | - cd ${{ env.BUILD_DIR }} - make -j $(nproc) qmake_all - - - name: Make all - timeout-minutes: 70 - run: | - cd ${{ env.BUILD_DIR }} - make -j $(nproc) all - - - name: Unit tests - timeout-minutes: 5 - run: | - cd ${{ env.BUILD_DIR }} - export TRIK_PYTHONPATH=$(python3.${{ matrix.python-minor }} -c "import sys; import os; print(os.pathsep.join(sys.path))") - make -k check TESTARGS="-platform offscreen" - - - name: Download tests - run: | - curl --output tests.7z "https://dl.trikset.com/edu/.solutions20200701/testing_small.7z" - 7za x tests.7z - ls $GITHUB_WORKSPACE/testing_small - - - name: Tests - id: tests - timeout-minutes: 2 - continue-on-error: true - run: | - echo "$PATH" - echo ------ - cd ${{ env.BUILD_DIR }}/bin - env QT_QPA_PLATFORM=minimal python3 "${GITHUB_WORKSPACE}/buildScripts/tests/fieldstest.py" ./2D-model "${GITHUB_WORKSPACE}/testing_small" - - - name: Build installer - run: | - set -vx - cd "$GITHUB_WORKSPACE"/installer - export TRIK_PYTHON3_VERSION_MINOR=${{ matrix.python-minor }} - bash -xv ./build-trik-studio.sh "${QT_ROOT_DIR}/bin" $(ls -1d "${IQTA_TOOLS}"/QtInstallerFramework/*/bin | head -n 1) "${{ env.BUILD_DIR }}" - - - name: Push installer - uses: actions/upload-artifact@v4 - with: - name: trik-studio-auto-installer-rockylinux-qt${{ matrix.qt-version }} - path: | - installer/trik-studio*installer*.run - installer/trik_studio*.qs - installer/reinstall* - - - name: Check errors - if: ${{ steps.tests.outcome == 'failure' }} - run: | - echo Errors occurred in the step Tests - exit 1 - - - name: Get tag - run: echo "CURRENT_TAG=$(git tag --contains HEAD | sort -Vr | head -n1)" >> $GITHUB_ENV - - name: Check tag - if: ${{ env.CURRENT_TAG != ''}} - run: echo "GITHUB_REF_SLUG=${{ env.CURRENT_TAG }}" >> $GITHUB_ENV - - - name: Deploy installer - if: ${{ false && matrix.deploy-installer && github.event_name != 'pull_request' && github.repository_owner == 'trikset' }} - run: | - install -m 600 -D /dev/null ~/.ssh/id_rsa - echo "${{ secrets.DL_PRIVATE_SSH_KEY }}" > ~/.ssh/id_rsa - rsync -v --rsh="ssh -o StrictHostKeyChecking=no" installer/trik-studio*installer*.run ${{ secrets.DL_USERNAME }}@${{ secrets.DL_HOST }}:~/dl/ts/fresh/installer/trik-studio-${{ env.GITHUB_REF_SLUG }}-linux-generic-installer.run diff --git a/buildScripts/docker/Dockerfile.altlinux b/buildScripts/docker/Dockerfile.altlinux deleted file mode 100644 index f733b5b4bc..0000000000 --- a/buildScripts/docker/Dockerfile.altlinux +++ /dev/null @@ -1,19 +0,0 @@ -FROM altlinux/base:latest -MAINTAINER Iakov Kirilenko -#ENV DEBIAN_FRONTEND noninteractive -#ARG CHECKER_TAG=latest -#Run everything at once to create a single layer -#ENV TRIK_PYTHON3_VERSION_MINOR 9 -#Since LANG has the lowest priority (of LC_ALL, LC_CTYPE) and can be overrided by other vars, we prefer to use LANG -ENV LANG C.UTF-8 -RUN set -eu \ - && apt-get update \ - && apt-get -y dist-upgrade \ - && true -RUN true && apt-get install -y \ - curl xz p7zip-standalone \ - rsync qt5-multimedia-devel qt5-svg-devel qt5-script-devel qt5-tools libusb-devel python3-dev \ - && apt-get autoremove -y && apt-get clean -RUN true && apt-get install -y zlib-devel make qt5-serialport-devel \ - && apt-get autoremove -y && apt-get clean -RUN du -csh /* 2>/dev/null | sort -h || : From 09a58a99ea3f07e8bee8d737f3b73451a1a00d8e Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Thu, 24 Oct 2024 17:01:22 +0300 Subject: [PATCH 03/40] Set detect_leaks=0 for Ubuntu builds and cut out invalid characters from the artifact name --- .github/workflows/linux_build.yml | 1 + .github/workflows/setup_environment.yml | 8 +++++++- buildScripts/github/run_tests.sh | 2 +- buildScripts/github/test.sh | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux_build.yml b/.github/workflows/linux_build.yml index 3b0df1ec13..e4d438a80d 100644 --- a/.github/workflows/linux_build.yml +++ b/.github/workflows/linux_build.yml @@ -52,6 +52,7 @@ jobs: build: true build_installer: false qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers" + trik_python3_version_minor: 10 build-altlinux-release-tests: needs: lint diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index 7c4e208ba2..1c9528203c 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -159,10 +159,16 @@ jobs: host: ${{ secrets.DL_HOST }} if: ${{ inputs.build_installer == 'true' }} + - name: Eval artifact name + run: | + CONTAINER_NAME=${{ inputs.container_name }} + PATCH_CONTAINER_NAME=${CONTAINER_NAME//[^a-zA-Z0-9_-]/} + echo "PATCH_CONTAINER_NAME=$PATCH_CONTAINER_NAME" >> $GITHUB_ENV + - name: Upload installer artifact uses: actions/upload-artifact@v4 with: - name: ${{ runner.os }}-${{ inputs.container_name }}-installer + name: ${{ runner.os }}-${{ env.PATCH_CONTAINER_NAME }}-installer path: | installer/*.exe installer/*.run diff --git a/buildScripts/github/run_tests.sh b/buildScripts/github/run_tests.sh index 957fb52af6..35a842dbf9 100755 --- a/buildScripts/github/run_tests.sh +++ b/buildScripts/github/run_tests.sh @@ -1,6 +1,6 @@ #!/bin/bash export QT_QPA_PLATFORM=minimal -export ASAN_OPTIONS=$(if [[ $RUNNER_OS == Linux ]]; then echo 'detect_leaks=1:'; else echo -n ''; fi)detect_stack_use_after_return=1:fast_unwind_on_malloc=0:detect_odr_violation=0 # dirty hack for libtrikQsLog and libtrikRuntimeQsLog +export ASAN_OPTIONS=$(if [[ $RUNNER_OS == Linux ]]; then echo 'detect_leaks=0:'; else echo -n ''; fi)detect_stack_use_after_return=1:fast_unwind_on_malloc=0:detect_odr_violation=0 # dirty hack for libtrikQsLog and libtrikRuntimeQsLog export LSAN_OPTIONS=suppressions=$PWD/bin/lsan.supp:print_suppressions=0 export DISPLAY=:0 export TRIK_PYTHONPATH=${TRIK_PYTHONPATH:-$(python3.${TRIK_PYTHON3_VERSION_MINOR} -c 'import sys; import os; print(os.pathsep.join(sys.path))')} diff --git a/buildScripts/github/test.sh b/buildScripts/github/test.sh index 279b345302..40955fd2e3 100755 --- a/buildScripts/github/test.sh +++ b/buildScripts/github/test.sh @@ -3,7 +3,7 @@ set -euo pipefail [ -r tests_qrs.7z ] || curl -Lo tests_qrs.7z https://dl.trikset.com/edu/.solutions20200701/testing_small.7z which 7z &> /dev/null && 7z -y x tests_qrs.7z || 7za x tests_qrs.7z -export ASAN_OPTIONS=$(if [[ $RUNNER_OS == Linux ]]; then echo 'detect_leaks=1:'; else echo -n ''; fi)detect_stack_use_after_return=1:fast_unwind_on_malloc=0:detect_odr_violation=0 # dirty hack for +export ASAN_OPTIONS=$(if [[ $RUNNER_OS == Linux ]]; then echo 'detect_leaks=0:'; else echo -n ''; fi)detect_stack_use_after_return=1:fast_unwind_on_malloc=0:detect_odr_violation=0 # dirty hack for libtrikQsLog and libtrikRuntimeQsLog env ASAN_OPTIONS=${ASAN_OPTIONS} \ LSAN_OPTIONS=${LSAN_OPTIONS:-suppressions=$PWD/bin/lsan.supp:print_suppressions=0} \ QT_QPA_PLATFORM=${QT_QPA_PLATFORM:-minimal} \ From a6e26df55c50e56cd7de9a30f13749c38e77640a Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Thu, 24 Oct 2024 17:16:08 +0300 Subject: [PATCH 04/40] Format setup_environment.yml --- .github/workflows/setup_environment.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index 1c9528203c..ec9bacf30c 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -141,7 +141,7 @@ jobs: TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik_python3_version_minor }} TESTS: ${{ inputs.tests }} if: ${{ inputs.build == 'true' }} - + - name: Build Installer run: | BRANCH_NAME=${BRANCH_NAME//\//-} @@ -161,10 +161,10 @@ jobs: - name: Eval artifact name run: | - CONTAINER_NAME=${{ inputs.container_name }} - PATCH_CONTAINER_NAME=${CONTAINER_NAME//[^a-zA-Z0-9_-]/} - echo "PATCH_CONTAINER_NAME=$PATCH_CONTAINER_NAME" >> $GITHUB_ENV - + CONTAINER_NAME=${{ inputs.container_name }} + PATCH_CONTAINER_NAME=${CONTAINER_NAME//[^a-zA-Z0-9_-]/} + echo "PATCH_CONTAINER_NAME=$PATCH_CONTAINER_NAME" >> $GITHUB_ENV + - name: Upload installer artifact uses: actions/upload-artifact@v4 with: From baefb6110e3532cb715739fb93e34d15457c0a92 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Thu, 24 Oct 2024 17:48:55 +0300 Subject: [PATCH 05/40] Cleanup --- .../{linux_build.yml => common_build.yml} | 33 ++++++++ .github/workflows/macos_build.yml | 79 ------------------- buildScripts/github/install_Linux.sh | 2 +- 3 files changed, 34 insertions(+), 80 deletions(-) rename .github/workflows/{linux_build.yml => common_build.yml} (73%) delete mode 100644 .github/workflows/macos_build.yml diff --git a/.github/workflows/linux_build.yml b/.github/workflows/common_build.yml similarity index 73% rename from .github/workflows/linux_build.yml rename to .github/workflows/common_build.yml index e4d438a80d..e968729a78 100644 --- a/.github/workflows/linux_build.yml +++ b/.github/workflows/common_build.yml @@ -44,6 +44,39 @@ jobs: build: false build_installer: false + build-macos-release-tests: + needs: lint + uses: ./.github/workflows/setup_environment.yml + with: + os: macos-12 + build: true + build_installer: false + qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=warn_off" + trik_python3_version_minor: "11" + + build-macos-debug-tests: + needs: lint + uses: ./.github/workflows/setup_environment.yml + with: + os: macos-12 + build: true + build_installer: false + config: debug + qmake_extra: "CONFIG+=warn_off CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" + trik_python3_version_minor: "11" + + build-macos-installer: + needs: [build-macos-debug-tests, build-macos-release-tests] + uses: ./.github/workflows/setup_environment.yml + with: + os: macos-12 + build: true + build_installer: true + qmake_extra: " CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" + trik_python3_version_minor: "11" + tests: true + secrets: inherit + build-ubuntu-release-tests: needs: lint uses: ./.github/workflows/setup_environment.yml diff --git a/.github/workflows/macos_build.yml b/.github/workflows/macos_build.yml deleted file mode 100644 index 3df76ee7bd..0000000000 --- a/.github/workflows/macos_build.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: macOS CI - -on: - push: - branches-ignore: - - 'dependabot**' - tags: - - '*' - paths-ignore: - - '**/lsan.supp' - - 'buildScripts/travis/*' - - 'buildScripts/azure/*' - - 'buildScripts/docker/*' - - 'azure-pipelines.yml' - - '.cirrus.yml' - - '.travis.yml' - - '.mergify.yml' - - 'Brewfile' - - '**/*.html' - - '**/*.txt' - - '**/*.md' - - 'installer/packages/**/meta/prebuild-mac.sh' - - 'installer/packages/**/meta/prebuild-linux-gnu.sh' - - '**/*.dockerfile' - - '**/*.Dockerfile' - - '**/Dockerfile' - - '**/Dockerfile.*' - - 'plugins/robots/checker/scripts/build-checker-installer.sh' - - '.github/workflows/centos.yml' - pull_request: - branches-ignore: - - 'dependabot**' - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - lint: - uses: ./.github/workflows/setup_environment.yml - with: - os: ubuntu-latest - lint: true - build: false - build_installer: false - - build-macos-release-tests: - needs: lint - uses: ./.github/workflows/setup_environment.yml - with: - os: macos-12 - build: true - build_installer: false - qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=warn_off" - trik_python3_version_minor: "11" - - build-macos-debug-tests: - needs: lint - uses: ./.github/workflows/setup_environment.yml - with: - os: macos-12 - build: true - build_installer: false - config: debug - qmake_extra: "CONFIG+=warn_off CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" - trik_python3_version_minor: "11" - - build-macos-installer: - needs: [build-macos-debug-tests, build-macos-release-tests] - uses: ./.github/workflows/setup_environment.yml - with: - os: macos-12 - build: true - build_installer: true - qmake_extra: " CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" - trik_python3_version_minor: "11" - tests: true - secrets: inherit diff --git a/buildScripts/github/install_Linux.sh b/buildScripts/github/install_Linux.sh index d83b684b71..a0e60dcd9f 100755 --- a/buildScripts/github/install_Linux.sh +++ b/buildScripts/github/install_Linux.sh @@ -34,5 +34,5 @@ fi if [ "$BUILD_INSTALLER" = "true" ]; then "$TRIK_PYTHON" -m pip install -U pip "$TRIK_PYTHON" -m pip install aqtinstall - "$TRIK_PYTHON" -m aqt install-tool -O /Qt linux desktop tools_ifw + sudo "$TRIK_PYTHON" -m aqt install-tool -O /Qt linux desktop tools_ifw fi From d14d78df1f14f5006c6c8cfdcc88e976b5b5d792 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Thu, 24 Oct 2024 18:28:50 +0300 Subject: [PATCH 06/40] Change path for QTIFW installation --- buildScripts/github/build_installer.sh | 2 +- buildScripts/github/install_Linux.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/buildScripts/github/build_installer.sh b/buildScripts/github/build_installer.sh index 6b359fea98..dfe22fbf79 100755 --- a/buildScripts/github/build_installer.sh +++ b/buildScripts/github/build_installer.sh @@ -8,7 +8,7 @@ case $RUNNER_OS in TSNAME="trik-studio-installer-mac-$BRANCH_NAME.dmg" ;; Linux) - QTIFWBIN=$(find /Qt/Tools -name "bin" | head -n 1) + QTIFWBIN=$(find $PWD/Qt/Tools -name "bin" | head -n 1) ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) TSNAME="trik-studio-installer-linux-$BRANCH_NAME-$ID.run" ;; diff --git a/buildScripts/github/install_Linux.sh b/buildScripts/github/install_Linux.sh index a0e60dcd9f..17f020dc70 100755 --- a/buildScripts/github/install_Linux.sh +++ b/buildScripts/github/install_Linux.sh @@ -24,8 +24,8 @@ elif [[ "$ID" = "rocky" || "$ID" = '"rocky"' ]]; then # yum install -y qt5-qtscript-devel qt5-qttools-devel qt5-qtmultimedia-devel qt5-qtserialport-devel qt5-qtsvg-devel qt5-qtbase-devel "$TRIK_PYTHON" -m pip install -U pip "$TRIK_PYTHON" -m pip install aqtinstall - aqt install-qt linux desktop "$TRIK_QT_VERSION" -O /Qt -m qtscript --archives qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats icu qtwayland - QT_ROOT_DIR=$(ls -1d /Qt/"$TRIK_QT_VERSION"*/gcc_64 | head -n 1) + aqt install-qt linux desktop "$TRIK_QT_VERSION" -O $PWD/Qt -m qtscript --archives qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats icu qtwayland + QT_ROOT_DIR=$(ls -1d $PWD/Qt/"$TRIK_QT_VERSION"*/gcc_64 | head -n 1) echo "$QT_ROOT_DIR/bin" >> $GITHUB_PATH echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile @@ -34,5 +34,5 @@ fi if [ "$BUILD_INSTALLER" = "true" ]; then "$TRIK_PYTHON" -m pip install -U pip "$TRIK_PYTHON" -m pip install aqtinstall - sudo "$TRIK_PYTHON" -m aqt install-tool -O /Qt linux desktop tools_ifw + "$TRIK_PYTHON" -m aqt install-tool -O $PWD/Qt linux desktop tools_ifw fi From 694e3509db310cae75b1124b26d758b125e44497 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Thu, 24 Oct 2024 20:43:29 +0300 Subject: [PATCH 07/40] Enable cpu feature sse4.2 --- buildScripts/github/install_Linux.sh | 11 ++--------- plugins/editorsSdk/extraCompilers.pri | 6 +++--- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/buildScripts/github/install_Linux.sh b/buildScripts/github/install_Linux.sh index 17f020dc70..1176c18040 100755 --- a/buildScripts/github/install_Linux.sh +++ b/buildScripts/github/install_Linux.sh @@ -13,21 +13,14 @@ if [ "$ID" = "altlinux" ]; then elif [ "$ID" = "ubuntu" ]; then sudo apt-get update && sudo apt-get install -y --no-install-recommends \ ccache curl libusb-1.0-0-dev make qtscript5-dev qttools5-dev-tools qtmultimedia5-dev libqt5serialport5-dev libqt5svg5-dev \ - libudev-dev python3.${TRIK_PYTHON3_VERSION_MINOR}-dev qtbase5-private-dev + libudev-dev python3.${TRIK_PYTHON3_VERSION_MINOR}-dev qtbase5-private-dev libqt5waylandclient5 libqt5waylandcompositor5 elif [[ "$ID" = "rocky" || "$ID" = '"rocky"' ]]; then yum update -y && yum install -y epel-release yum install --allowerasing -y sudo which libusbx-devel curl wget make gcc-toolset-"$GCC_VERSION"-{gcc-c++,libasan-devel,libubsan-devel,gdb} \ git-core ccache zlib-devel rsync python3-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip xz time yum install -y libxkbcommon-x11 qt5-qtbase-gui #no desire to enumerate all required libraries for QtIFw yum install -y pulseaudio-libs-glib2 # to run TS and 2D-model even with `minimal` platform - - # yum install -y qt5-qtscript-devel qt5-qttools-devel qt5-qtmultimedia-devel qt5-qtserialport-devel qt5-qtsvg-devel qt5-qtbase-devel - "$TRIK_PYTHON" -m pip install -U pip - "$TRIK_PYTHON" -m pip install aqtinstall - aqt install-qt linux desktop "$TRIK_QT_VERSION" -O $PWD/Qt -m qtscript --archives qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats icu qtwayland - QT_ROOT_DIR=$(ls -1d $PWD/Qt/"$TRIK_QT_VERSION"*/gcc_64 | head -n 1) - - echo "$QT_ROOT_DIR/bin" >> $GITHUB_PATH + yum install -y qt5-qtscript-devel qt5-qttools-devel qt5-qtmultimedia-devel qt5-qtserialport-devel qt5-qtsvg-devel qt5-qtbase-devel echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile fi diff --git a/plugins/editorsSdk/extraCompilers.pri b/plugins/editorsSdk/extraCompilers.pri index 4005a4b2d1..ea1c4541c6 100644 --- a/plugins/editorsSdk/extraCompilers.pri +++ b/plugins/editorsSdk/extraCompilers.pri @@ -19,11 +19,11 @@ QRXC_GENERATED_PATH = $$OUT_PWD # QT_NO_CPU_FEATURE=sse4.2 and QT_HASH_SEED=0 as an attempt ot get predictable qHash win32 { - QRXC_COMMAND = cd $$QRXC_GENERATED_PATH && set QT_NO_CPU_FEATURE=sse4.2 && set QT_HASH_SEED=0 && $$QRXC + QRXC_COMMAND = cd $$QRXC_GENERATED_PATH && set QT_HASH_SEED=0 && $$QRXC } else:!macx { - QRXC_COMMAND = cd $$QRXC_GENERATED_PATH && env ASAN_OPTIONS=detect_leaks=0 LD_LIBRARY_PATH=$$QRXC_DIR QT_NO_CPU_FEATURE=sse4.2 QT_HASH_SEED=0 $$QRXC + QRXC_COMMAND = cd $$QRXC_GENERATED_PATH && env ASAN_OPTIONS=detect_leaks=0 LD_LIBRARY_PATH=$$QRXC_DIR QT_HASH_SEED=0 $$QRXC } else { - QRXC_COMMAND = cd $$QRXC_GENERATED_PATH && env ASAN_OPTIONS=detect_leaks=0 DYLD_LIBRARY_PATH=$$QRXC_DIR QT_NO_CPU_FEATURE=sse4.2 QT_HASH_SEED=0 $$QRXC + QRXC_COMMAND = cd $$QRXC_GENERATED_PATH && env ASAN_OPTIONS=detect_leaks=0 DYLD_LIBRARY_PATH=$$QRXC_DIR QT_HASH_SEED=0 $$QRXC } qrxc_source.commands = $$QRXC_COMMAND $$EDITOR_PATH/$$QREAL_XML From 7852daeb38ad18f1b20677a25bbff24e261deda5 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Thu, 24 Oct 2024 21:02:22 +0300 Subject: [PATCH 08/40] Add private headers --- buildScripts/github/install_Linux.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildScripts/github/install_Linux.sh b/buildScripts/github/install_Linux.sh index 1176c18040..59d4690eed 100755 --- a/buildScripts/github/install_Linux.sh +++ b/buildScripts/github/install_Linux.sh @@ -17,10 +17,10 @@ elif [ "$ID" = "ubuntu" ]; then elif [[ "$ID" = "rocky" || "$ID" = '"rocky"' ]]; then yum update -y && yum install -y epel-release yum install --allowerasing -y sudo which libusbx-devel curl wget make gcc-toolset-"$GCC_VERSION"-{gcc-c++,libasan-devel,libubsan-devel,gdb} \ - git-core ccache zlib-devel rsync python3-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip xz time + git-core ccache zlib-devel rsync "$TRIK_PYTHON"-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip xz time yum install -y libxkbcommon-x11 qt5-qtbase-gui #no desire to enumerate all required libraries for QtIFw yum install -y pulseaudio-libs-glib2 # to run TS and 2D-model even with `minimal` platform - yum install -y qt5-qtscript-devel qt5-qttools-devel qt5-qtmultimedia-devel qt5-qtserialport-devel qt5-qtsvg-devel qt5-qtbase-devel + yum install -y qt5-qtscript-devel qt5-qttools-devel qt5-qtmultimedia-devel qt5-qtserialport-devel qt5-qtsvg-devel qt5-qtbase-devel qt5-qtbase-private-devel echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile fi From 14c7242c60ee586f39f31a5b352f14842a503395 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Thu, 24 Oct 2024 21:06:45 +0300 Subject: [PATCH 09/40] Update submodule and enable ASAN_OPTIONS=detect_leaks=1 --- buildScripts/github/run_tests.sh | 2 +- buildScripts/github/test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buildScripts/github/run_tests.sh b/buildScripts/github/run_tests.sh index 35a842dbf9..957fb52af6 100755 --- a/buildScripts/github/run_tests.sh +++ b/buildScripts/github/run_tests.sh @@ -1,6 +1,6 @@ #!/bin/bash export QT_QPA_PLATFORM=minimal -export ASAN_OPTIONS=$(if [[ $RUNNER_OS == Linux ]]; then echo 'detect_leaks=0:'; else echo -n ''; fi)detect_stack_use_after_return=1:fast_unwind_on_malloc=0:detect_odr_violation=0 # dirty hack for libtrikQsLog and libtrikRuntimeQsLog +export ASAN_OPTIONS=$(if [[ $RUNNER_OS == Linux ]]; then echo 'detect_leaks=1:'; else echo -n ''; fi)detect_stack_use_after_return=1:fast_unwind_on_malloc=0:detect_odr_violation=0 # dirty hack for libtrikQsLog and libtrikRuntimeQsLog export LSAN_OPTIONS=suppressions=$PWD/bin/lsan.supp:print_suppressions=0 export DISPLAY=:0 export TRIK_PYTHONPATH=${TRIK_PYTHONPATH:-$(python3.${TRIK_PYTHON3_VERSION_MINOR} -c 'import sys; import os; print(os.pathsep.join(sys.path))')} diff --git a/buildScripts/github/test.sh b/buildScripts/github/test.sh index 40955fd2e3..b53380d3f4 100755 --- a/buildScripts/github/test.sh +++ b/buildScripts/github/test.sh @@ -3,7 +3,7 @@ set -euo pipefail [ -r tests_qrs.7z ] || curl -Lo tests_qrs.7z https://dl.trikset.com/edu/.solutions20200701/testing_small.7z which 7z &> /dev/null && 7z -y x tests_qrs.7z || 7za x tests_qrs.7z -export ASAN_OPTIONS=$(if [[ $RUNNER_OS == Linux ]]; then echo 'detect_leaks=0:'; else echo -n ''; fi)detect_stack_use_after_return=1:fast_unwind_on_malloc=0:detect_odr_violation=0 # dirty hack for libtrikQsLog and libtrikRuntimeQsLog +export ASAN_OPTIONS=$(if [[ $RUNNER_OS == Linux ]]; then echo 'detect_leaks=1:'; else echo -n ''; fi)detect_stack_use_after_return=1:fast_unwind_on_malloc=0:detect_odr_violation=0 # dirty hack for libtrikQsLog and libtrikRuntimeQsLog env ASAN_OPTIONS=${ASAN_OPTIONS} \ LSAN_OPTIONS=${LSAN_OPTIONS:-suppressions=$PWD/bin/lsan.supp:print_suppressions=0} \ QT_QPA_PLATFORM=${QT_QPA_PLATFORM:-minimal} \ From 573eb6313d43511c65bd8ef640b3cc0a091cc570 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Thu, 24 Oct 2024 23:21:45 +0300 Subject: [PATCH 10/40] Add qtwayland dependecies --- buildScripts/github/install_Linux.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/buildScripts/github/install_Linux.sh b/buildScripts/github/install_Linux.sh index 59d4690eed..57032ef81e 100755 --- a/buildScripts/github/install_Linux.sh +++ b/buildScripts/github/install_Linux.sh @@ -13,14 +13,15 @@ if [ "$ID" = "altlinux" ]; then elif [ "$ID" = "ubuntu" ]; then sudo apt-get update && sudo apt-get install -y --no-install-recommends \ ccache curl libusb-1.0-0-dev make qtscript5-dev qttools5-dev-tools qtmultimedia5-dev libqt5serialport5-dev libqt5svg5-dev \ - libudev-dev python3.${TRIK_PYTHON3_VERSION_MINOR}-dev qtbase5-private-dev libqt5waylandclient5 libqt5waylandcompositor5 + libudev-dev python3.${TRIK_PYTHON3_VERSION_MINOR}-dev qtbase5-private-dev qtwayland5 elif [[ "$ID" = "rocky" || "$ID" = '"rocky"' ]]; then yum update -y && yum install -y epel-release yum install --allowerasing -y sudo which libusbx-devel curl wget make gcc-toolset-"$GCC_VERSION"-{gcc-c++,libasan-devel,libubsan-devel,gdb} \ git-core ccache zlib-devel rsync "$TRIK_PYTHON"-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip xz time yum install -y libxkbcommon-x11 qt5-qtbase-gui #no desire to enumerate all required libraries for QtIFw yum install -y pulseaudio-libs-glib2 # to run TS and 2D-model even with `minimal` platform - yum install -y qt5-qtscript-devel qt5-qttools-devel qt5-qtmultimedia-devel qt5-qtserialport-devel qt5-qtsvg-devel qt5-qtbase-devel qt5-qtbase-private-devel + yum install -y qt5-qtscript-devel qt5-qttools-devel qt5-qtmultimedia-devel qt5-qtserialport-devel qt5-qtsvg-devel qt5-qtbase-devel qt5-qtbase-private-devel \ + qt5-qtwayland-devel echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile fi From 868066ee0c318c0d32b975acbe6f1578b1b24368 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 30 Oct 2024 16:06:26 +0300 Subject: [PATCH 11/40] Split the environment for the installer and the build environment for the distribution --- .github/workflows/common_build.yml | 47 ++++++++++--------- .github/workflows/setup_environment.yml | 24 +++++++--- buildScripts/github/build_internal.sh | 1 - buildScripts/github/install_Linux.sh | 10 +--- .../github/install_installer_environment.sh | 18 +++++++ 5 files changed, 63 insertions(+), 37 deletions(-) create mode 100755 buildScripts/github/install_installer_environment.sh diff --git a/.github/workflows/common_build.yml b/.github/workflows/common_build.yml index e968729a78..9a80c5763d 100644 --- a/.github/workflows/common_build.yml +++ b/.github/workflows/common_build.yml @@ -52,7 +52,7 @@ jobs: build: true build_installer: false qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=warn_off" - trik_python3_version_minor: "11" + trik_python3_version_minor: 11 build-macos-debug-tests: needs: lint @@ -63,7 +63,7 @@ jobs: build_installer: false config: debug qmake_extra: "CONFIG+=warn_off CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" - trik_python3_version_minor: "11" + trik_python3_version_minor: 11 build-macos-installer: needs: [build-macos-debug-tests, build-macos-release-tests] @@ -73,7 +73,7 @@ jobs: build: true build_installer: true qmake_extra: " CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" - trik_python3_version_minor: "11" + trik_python3_version_minor: 11 tests: true secrets: inherit @@ -92,22 +92,37 @@ jobs: uses: ./.github/workflows/setup_environment.yml with: os: ubuntu-latest - container_name: "altlinux/base:latest" + container_name: altlinux/base:latest build: true build_installer: false qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers" tests: true - build-rockylinux-release-tests: + build-rockylinux-distro-release-tests: needs: lint uses: ./.github/workflows/setup_environment.yml with: os: ubuntu-latest - container_name: "rockylinux:9" + container_name: rockylinux:9 build: true build_installer: false qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=sanitizer CONFIG+=sanitize-undefined" - gcc_version: "13" + gcc_version: 13 + + # Use Python 3.11, as the Python 3.12 package in Rocky Linux AppStream x86_64 crashes + # with a segmentation fault when restarting the interpreter during the import of asyncio + # (specifically when loading _ssl) in PythonQt::init(). + build-rockylinux-installer-release-tests: + needs: lint + uses: ./.github/workflows/setup_environment.yml + with: + os: ubuntu-latest + container_name: rockylinux:9 + build: true + qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=sanitizer CONFIG+=sanitize-undefined CONFIG+=sanitize_address" + gcc_version: 13 + trik_qt_version: 5.15 + trik_python3_version_minor: 3.11 build-ubuntu-debug-tests: needs: lint @@ -119,21 +134,9 @@ jobs: config: debug qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" trik_python3_version_minor: 10 - - build-ubuntu-installer: - needs: [build-ubuntu-debug-tests, build-ubuntu-release-tests] - uses: ./.github/workflows/setup_environment.yml - with: - os: ubuntu-latest - build: true - build_installer: true - qmake_extra: "CONFIG+=noPch CONFIG+=ccache" - tests: true - trik_python3_version_minor: 10 - secrets: inherit build-rockylinux-installer: - needs: [build-rockylinux-release-tests] + needs: [build-rockylinux-installer-release-tests] uses: ./.github/workflows/setup_environment.yml with: os: ubuntu-latest @@ -142,5 +145,7 @@ jobs: build_installer: true tests: true qmake_extra: "CONFIG+=noPch CONFIG+=ccache" - gcc_version: "13" + gcc_version: 13 + trik_qt_version: 5.15 + trik_python3_version_minor: 3.11 secrets: inherit diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index ec9bacf30c..50ed3f1735 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -13,13 +13,17 @@ on: lint: required: false type: string - default: 'false' + default: false build: required: true type: string build_installer: required: true type: string + linux_installer_environment: + required: false + type: string + default: false trik_qt_version: required: false type: string @@ -31,15 +35,15 @@ on: qtifw_version: required: false type: string - default: '4.6.1' + default: 4.6.1 xcode_version: required: false type: string - default: '13.4' + default: 13.4 config: required: false type: string - default: 'release' + default: release qmake_extra: required: false type: string @@ -55,7 +59,7 @@ on: gcc_version: required: false type: string - default: "13" + default: 13 jobs: job: @@ -96,8 +100,16 @@ jobs: XCODE_VERSION: ${{ inputs.xcode_version }} BUILD_INSTALLER: ${{ inputs.build_installer }} GCC_VERSION: ${{ inputs.gcc_version }} - if: ${{ inputs.build == 'true' }} + if: ${{ inputs.build == true && inputs.linux_installer_environment != true}} + - name: Set up installer environment + run: buildScripts/github/install_installer_environment.sh + env: + TRIK_QT_VERSION: ${{ inputs.trik_qt_version }} + TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik_python3_version_minor }} + GCC_VERSION: ${{ inputs.gcc_version }} + if: ${{ linux_installer_environment == "true"}} + - name: Lint run: | sudo apt-get update && sudo apt-get install -y --no-install-recommends qttools5-dev-tools qtbase5-dev vera++ diff --git a/buildScripts/github/build_internal.sh b/buildScripts/github/build_internal.sh index 7e77057c19..995e18a491 100755 --- a/buildScripts/github/build_internal.sh +++ b/buildScripts/github/build_internal.sh @@ -11,7 +11,6 @@ ccache -sz { which python3 && python3 -V || true ; } { which python && python -V || true ; } export PYTHON_DIR=$(python3.${TRIK_PYTHON3_VERSION_MINOR}-config --prefix) -export PKG_CONFIG_PATH="$PYTHON_DIR/lib/pkgconfig" rm -f .qmake.cache qmake -Wall PYTHON_VERSION=3.$TRIK_PYTHON3_VERSION_MINOR PYTHON_PATH=/usr CONFIG+=$CONFIG $QMAKE_EXTRA $PROJECT.pro make -j $(nproc) qmake_all 2>&1 | tee -a build.log diff --git a/buildScripts/github/install_Linux.sh b/buildScripts/github/install_Linux.sh index 57032ef81e..e328fcd487 100755 --- a/buildScripts/github/install_Linux.sh +++ b/buildScripts/github/install_Linux.sh @@ -2,9 +2,7 @@ set -euxo pipefail ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) -BUILD_INSTALLER=${BUILD_INSTALLER:-false} GCC_VERSION=${GCC_VERSION:-13} -TRIK_PYTHON="python3.${TRIK_PYTHON3_VERSION_MINOR}" if [ "$ID" = "altlinux" ]; then apt-get update && apt-get install -y gcc-c++ curl xz p7zip-standalone rsync libusb-devel \ @@ -17,16 +15,10 @@ elif [ "$ID" = "ubuntu" ]; then elif [[ "$ID" = "rocky" || "$ID" = '"rocky"' ]]; then yum update -y && yum install -y epel-release yum install --allowerasing -y sudo which libusbx-devel curl wget make gcc-toolset-"$GCC_VERSION"-{gcc-c++,libasan-devel,libubsan-devel,gdb} \ - git-core ccache zlib-devel rsync "$TRIK_PYTHON"-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip xz time + git-core ccache zlib-devel rsync python3-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip xz time yum install -y libxkbcommon-x11 qt5-qtbase-gui #no desire to enumerate all required libraries for QtIFw yum install -y pulseaudio-libs-glib2 # to run TS and 2D-model even with `minimal` platform yum install -y qt5-qtscript-devel qt5-qttools-devel qt5-qtmultimedia-devel qt5-qtserialport-devel qt5-qtsvg-devel qt5-qtbase-devel qt5-qtbase-private-devel \ qt5-qtwayland-devel echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile fi - -if [ "$BUILD_INSTALLER" = "true" ]; then - "$TRIK_PYTHON" -m pip install -U pip - "$TRIK_PYTHON" -m pip install aqtinstall - "$TRIK_PYTHON" -m aqt install-tool -O $PWD/Qt linux desktop tools_ifw -fi diff --git a/buildScripts/github/install_installer_environment.sh b/buildScripts/github/install_installer_environment.sh new file mode 100755 index 0000000000..2c6388b0b3 --- /dev/null +++ b/buildScripts/github/install_installer_environment.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -euxo pipefail + +GCC_VERSION=${GCC_VERSION:-13} + +TRIK_PYTHON="python3.${TRIK_PYTHON3_VERSION_MINOR}" +TRIK_QT_VERSION=${TRIK_QT_VERSION:-5.15} + +yum update -y && yum install -y epel-release +yum install --allowerasing -y sudo which libusbx-devel curl wget make gcc-toolset-"$GCC_VERSION"-{gcc-c++,libasan-devel,libubsan-devel,gdb} \ +git-core ccache zlib-devel rsync "$TRIK_PYTHON"-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip xz time +yum install -y libxkbcommon-x11 qt5-qtbase-gui +yum install -y pulseaudio-libs-glib2 +echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile + +"$TRIK_PYTHON" -m pip install -U pip +"$TRIK_PYTHON" -m pip install aqtinstall +"$TRIK_PYTHON" -m aqt install-tool -O $PWD/Qt linux desktop tools_ifw From 76c1f631d12a6a57b34ced378d9acb0c56f29d56 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 30 Oct 2024 16:14:18 +0300 Subject: [PATCH 12/40] Format --- .github/workflows/common_build.yml | 2 ++ .github/workflows/setup_environment.yml | 15 ++++++++------- buildScripts/github/build_installer.sh | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/common_build.yml b/.github/workflows/common_build.yml index 9a80c5763d..358bf1c0dd 100644 --- a/.github/workflows/common_build.yml +++ b/.github/workflows/common_build.yml @@ -123,6 +123,7 @@ jobs: gcc_version: 13 trik_qt_version: 5.15 trik_python3_version_minor: 3.11 + linux_installer_environment: true build-ubuntu-debug-tests: needs: lint @@ -148,4 +149,5 @@ jobs: gcc_version: 13 trik_qt_version: 5.15 trik_python3_version_minor: 3.11 + linux_installer_environment: true secrets: inherit diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index 50ed3f1735..5c1a21b137 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -108,13 +108,14 @@ jobs: TRIK_QT_VERSION: ${{ inputs.trik_qt_version }} TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik_python3_version_minor }} GCC_VERSION: ${{ inputs.gcc_version }} - if: ${{ linux_installer_environment == "true"}} + BUILD_INSTALLER: ${{ inputs.build_installer }} + if: ${{ inputs.linux_installer_environment == true}} - name: Lint run: | sudo apt-get update && sudo apt-get install -y --no-install-recommends qttools5-dev-tools qtbase5-dev vera++ ${{ inputs.executor }} buildScripts/github/vera_translation.sh - if: ${{ inputs.lint == 'true' }} + if: ${{ inputs.lint == true }} - name: Restore cache uses: actions/cache@v4 @@ -125,7 +126,7 @@ jobs: ccache-c${{ inputs.container_name }}-${{ inputs.os }}-${{ inputs.config }}-${{ inputs.qmake_extra }} ccache-c${{ inputs.container_name }}-${{ inputs.os }}-${{ inputs.config }} ccache-c${{ inputs.container_name }}-${{ inputs.os }} - if: ${{ inputs.build == 'true' }} + if: ${{ inputs.build == true }} - name: Build run: buildScripts/github/build.sh @@ -138,7 +139,7 @@ jobs: CONFIG: ${{ inputs.config }} EXECUTOR: ${{ inputs.executor }} QMAKE_EXTRA: ${{ inputs.qmake_extra }} - if: ${{ inputs.build == 'true' }} + if: ${{ inputs.build == true }} - name: Save build cache uses: actions/cache/save@v4 @@ -152,7 +153,7 @@ jobs: env: TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik_python3_version_minor }} TESTS: ${{ inputs.tests }} - if: ${{ inputs.build == 'true' }} + if: ${{ inputs.build == true }} - name: Build Installer run: | @@ -169,7 +170,7 @@ jobs: ssh_key: ${{ secrets.DL_PRIVATE_SSH_KEY }} username: ${{ secrets.DL_USERNAME }} host: ${{ secrets.DL_HOST }} - if: ${{ inputs.build_installer == 'true' }} + if: ${{ inputs.build_installer == true }} - name: Eval artifact name run: | @@ -185,4 +186,4 @@ jobs: installer/*.exe installer/*.run installer/*.dmg - if: ${{ inputs.build_installer == 'true' }} + if: ${{ inputs.build_installer == true }} diff --git a/buildScripts/github/build_installer.sh b/buildScripts/github/build_installer.sh index dfe22fbf79..6b359fea98 100755 --- a/buildScripts/github/build_installer.sh +++ b/buildScripts/github/build_installer.sh @@ -8,7 +8,7 @@ case $RUNNER_OS in TSNAME="trik-studio-installer-mac-$BRANCH_NAME.dmg" ;; Linux) - QTIFWBIN=$(find $PWD/Qt/Tools -name "bin" | head -n 1) + QTIFWBIN=$(find /Qt/Tools -name "bin" | head -n 1) ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) TSNAME="trik-studio-installer-linux-$BRANCH_NAME-$ID.run" ;; From 197807a42b869e2618b0c572f2946b8a0441b3f1 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 30 Oct 2024 16:50:13 +0300 Subject: [PATCH 13/40] Add auto remove script for artifact for next pipeline and add option for installscript.qs --- .github/workflows/common_build.yml | 1 + .github/workflows/setup_environment.yml | 1 + .../github/instal_installer_environment.sh | 24 +++++++++++++++++++ .../ru.qreal.root/meta/installscript.qs | 6 ++++- 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 buildScripts/github/instal_installer_environment.sh diff --git a/.github/workflows/common_build.yml b/.github/workflows/common_build.yml index 358bf1c0dd..d903041ed0 100644 --- a/.github/workflows/common_build.yml +++ b/.github/workflows/common_build.yml @@ -119,6 +119,7 @@ jobs: os: ubuntu-latest container_name: rockylinux:9 build: true + build_installer: false qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=sanitizer CONFIG+=sanitize-undefined CONFIG+=sanitize_address" gcc_version: 13 trik_qt_version: 5.15 diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index 5c1a21b137..a944ce2345 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -186,4 +186,5 @@ jobs: installer/*.exe installer/*.run installer/*.dmg + installer/trik_studio_uninstallscript.qs if: ${{ inputs.build_installer == true }} diff --git a/buildScripts/github/instal_installer_environment.sh b/buildScripts/github/instal_installer_environment.sh new file mode 100644 index 0000000000..ebff752114 --- /dev/null +++ b/buildScripts/github/instal_installer_environment.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -euxo pipefail + +GCC_VERSION=${GCC_VERSION:-13} + +TRIK_PYTHON="python3.${TRIK_PYTHON3_VERSION_MINOR}" +TRIK_QT_VERSION=${TRIK_QT_VERSION:-5.15} + +yum update -y && yum install -y epel-release +yum install --allowerasing -y sudo which libusbx-devel curl wget make gcc-toolset-"$GCC_VERSION"-{gcc-c++,libasan-devel,libubsan-devel,gdb} \ +git-core ccache zlib-devel rsync "$TRIK_PYTHON"-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip xz time +yum install -y libxkbcommon-x11 qt5-qtbase-gui +yum install -y pulseaudio-libs-glib2 +echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile + +"$TRIK_PYTHON" -m pip install -U pip +"$TRIK_PYTHON" -m pip install aqtinstall +"$TRIK_PYTHON" -m aqt install-qt linux desktop "$TRIK_QT_VERSION" -O /Qt -m qtscript --archives qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats icu qtwayland + +if [ "$BUILD_INSTALLER" = "true" ]; then + "$TRIK_PYTHON" -m pip install -U pip + "$TRIK_PYTHON" -m pip install aqtinstall + "$TRIK_PYTHON" -m aqt install-tool -O /Qt linux desktop tools_ifw +fi diff --git a/installer/packages/qreal-base/ru.qreal.root/meta/installscript.qs b/installer/packages/qreal-base/ru.qreal.root/meta/installscript.qs index 82275f893a..c0ea7437b8 100644 --- a/installer/packages/qreal-base/ru.qreal.root/meta/installscript.qs +++ b/installer/packages/qreal-base/ru.qreal.root/meta/installscript.qs @@ -142,7 +142,11 @@ function Component() installer.installationStarted.connect(function() { if (installer.shouldDeinstallPrevious) { - installer.performOperation("Execute", Dir.toNativeSeparator("@TargetDir@/" + installer.maintenanceName)); + additionalOptions = installer.environmentVariable("UNINSTALL_SCRIPT_PATH"); + if (additionalOptions != "") { + additionalOptions = " --sript" + additionalOptions; + } + installer.performOperation("Execute", Dir.toNativeSeparator("@TargetDir@/" + installer.maintenanceName) + additionalOptions); if (installer.value("os") == "win") { var timeoutBatch = "ping localhost -n 4 > nul"; installer.performOperation("Execute", ["cmd", "/c", timeoutBatch]); From 2dfde73fadf6e80fbac9db8013af10519418d07e Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 30 Oct 2024 17:07:13 +0300 Subject: [PATCH 14/40] Switch to boolean type on.workflow_call.inputs --- .github/workflows/setup_environment.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index a944ce2345..3c45a88b0e 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -12,17 +12,17 @@ on: default: "time" lint: required: false - type: string + type: boolean default: false build: required: true - type: string + type: boolean build_installer: required: true - type: string + type: boolean linux_installer_environment: required: false - type: string + type: boolean default: false trik_qt_version: required: false @@ -100,7 +100,7 @@ jobs: XCODE_VERSION: ${{ inputs.xcode_version }} BUILD_INSTALLER: ${{ inputs.build_installer }} GCC_VERSION: ${{ inputs.gcc_version }} - if: ${{ inputs.build == true && inputs.linux_installer_environment != true}} + if: ${{ inputs.build == true && inputs.linux_installer_environment != true }} - name: Set up installer environment run: buildScripts/github/install_installer_environment.sh @@ -109,7 +109,7 @@ jobs: TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik_python3_version_minor }} GCC_VERSION: ${{ inputs.gcc_version }} BUILD_INSTALLER: ${{ inputs.build_installer }} - if: ${{ inputs.linux_installer_environment == true}} + if: ${{ inputs.linux_installer_environment == true }} - name: Lint run: | From 77cca7f11e7f5f683b250b72ed429987e3020aef Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 30 Oct 2024 17:11:47 +0300 Subject: [PATCH 15/40] Add SDK Qt packages for installer environment --- .../github/instal_installer_environment.sh | 24 ------------------- .../github/install_installer_environment.sh | 8 ++++++- 2 files changed, 7 insertions(+), 25 deletions(-) delete mode 100644 buildScripts/github/instal_installer_environment.sh mode change 100755 => 100644 buildScripts/github/install_installer_environment.sh diff --git a/buildScripts/github/instal_installer_environment.sh b/buildScripts/github/instal_installer_environment.sh deleted file mode 100644 index ebff752114..0000000000 --- a/buildScripts/github/instal_installer_environment.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -set -euxo pipefail - -GCC_VERSION=${GCC_VERSION:-13} - -TRIK_PYTHON="python3.${TRIK_PYTHON3_VERSION_MINOR}" -TRIK_QT_VERSION=${TRIK_QT_VERSION:-5.15} - -yum update -y && yum install -y epel-release -yum install --allowerasing -y sudo which libusbx-devel curl wget make gcc-toolset-"$GCC_VERSION"-{gcc-c++,libasan-devel,libubsan-devel,gdb} \ -git-core ccache zlib-devel rsync "$TRIK_PYTHON"-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip xz time -yum install -y libxkbcommon-x11 qt5-qtbase-gui -yum install -y pulseaudio-libs-glib2 -echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile - -"$TRIK_PYTHON" -m pip install -U pip -"$TRIK_PYTHON" -m pip install aqtinstall -"$TRIK_PYTHON" -m aqt install-qt linux desktop "$TRIK_QT_VERSION" -O /Qt -m qtscript --archives qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats icu qtwayland - -if [ "$BUILD_INSTALLER" = "true" ]; then - "$TRIK_PYTHON" -m pip install -U pip - "$TRIK_PYTHON" -m pip install aqtinstall - "$TRIK_PYTHON" -m aqt install-tool -O /Qt linux desktop tools_ifw -fi diff --git a/buildScripts/github/install_installer_environment.sh b/buildScripts/github/install_installer_environment.sh old mode 100755 new mode 100644 index 2c6388b0b3..ebff752114 --- a/buildScripts/github/install_installer_environment.sh +++ b/buildScripts/github/install_installer_environment.sh @@ -15,4 +15,10 @@ echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile "$TRIK_PYTHON" -m pip install -U pip "$TRIK_PYTHON" -m pip install aqtinstall -"$TRIK_PYTHON" -m aqt install-tool -O $PWD/Qt linux desktop tools_ifw +"$TRIK_PYTHON" -m aqt install-qt linux desktop "$TRIK_QT_VERSION" -O /Qt -m qtscript --archives qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats icu qtwayland + +if [ "$BUILD_INSTALLER" = "true" ]; then + "$TRIK_PYTHON" -m pip install -U pip + "$TRIK_PYTHON" -m pip install aqtinstall + "$TRIK_PYTHON" -m aqt install-tool -O /Qt linux desktop tools_ifw +fi From d04dbdb2aae22c5bb1b1d075ff2e2c90092c92d0 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 30 Oct 2024 17:15:16 +0300 Subject: [PATCH 16/40] Add executable bit --- buildScripts/github/install_installer_environment.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 buildScripts/github/install_installer_environment.sh diff --git a/buildScripts/github/install_installer_environment.sh b/buildScripts/github/install_installer_environment.sh old mode 100644 new mode 100755 From 89df0d7b7ca68a6de18a002acd5423e2da2cbe74 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 30 Oct 2024 17:38:40 +0300 Subject: [PATCH 17/40] Fix python minor version --- .github/workflows/common_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/common_build.yml b/.github/workflows/common_build.yml index d903041ed0..d1eadbe8f2 100644 --- a/.github/workflows/common_build.yml +++ b/.github/workflows/common_build.yml @@ -123,7 +123,7 @@ jobs: qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=sanitizer CONFIG+=sanitize-undefined CONFIG+=sanitize_address" gcc_version: 13 trik_qt_version: 5.15 - trik_python3_version_minor: 3.11 + trik_python3_version_minor: 11 linux_installer_environment: true build-ubuntu-debug-tests: @@ -149,6 +149,6 @@ jobs: qmake_extra: "CONFIG+=noPch CONFIG+=ccache" gcc_version: 13 trik_qt_version: 5.15 - trik_python3_version_minor: 3.11 + trik_python3_version_minor: 11 linux_installer_environment: true secrets: inherit From 3788c2520415f9a518f2cf6c506659a5154b64b0 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 30 Oct 2024 17:58:34 +0300 Subject: [PATCH 18/40] Add Qt installation to GITHUB_PATH --- buildScripts/github/install_installer_environment.sh | 3 +++ .../packages/qreal-base/ru.qreal.root/meta/installscript.qs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/buildScripts/github/install_installer_environment.sh b/buildScripts/github/install_installer_environment.sh index ebff752114..d6393cc5d3 100755 --- a/buildScripts/github/install_installer_environment.sh +++ b/buildScripts/github/install_installer_environment.sh @@ -17,6 +17,9 @@ echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile "$TRIK_PYTHON" -m pip install aqtinstall "$TRIK_PYTHON" -m aqt install-qt linux desktop "$TRIK_QT_VERSION" -O /Qt -m qtscript --archives qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats icu qtwayland +QT_ROOT_DIR=$(ls -1d /Qt/$TRIK_QT_VERSION*/gcc_64 | head -n 1) +echo "$QT_ROOT_DIR/bin" >> $GITHUB_PATH + if [ "$BUILD_INSTALLER" = "true" ]; then "$TRIK_PYTHON" -m pip install -U pip "$TRIK_PYTHON" -m pip install aqtinstall diff --git a/installer/packages/qreal-base/ru.qreal.root/meta/installscript.qs b/installer/packages/qreal-base/ru.qreal.root/meta/installscript.qs index c0ea7437b8..2000bea0cd 100644 --- a/installer/packages/qreal-base/ru.qreal.root/meta/installscript.qs +++ b/installer/packages/qreal-base/ru.qreal.root/meta/installscript.qs @@ -144,7 +144,7 @@ function Component() if (installer.shouldDeinstallPrevious) { additionalOptions = installer.environmentVariable("UNINSTALL_SCRIPT_PATH"); if (additionalOptions != "") { - additionalOptions = " --sript" + additionalOptions; + additionalOptions = " --sript " + additionalOptions; } installer.performOperation("Execute", Dir.toNativeSeparator("@TargetDir@/" + installer.maintenanceName) + additionalOptions); if (installer.value("os") == "win") { From 77769ab6c9b3c89740f37f183c68e519f084be56 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 30 Oct 2024 20:22:32 +0300 Subject: [PATCH 19/40] Add qtwaylandcompositor module to aqtinstall --- buildScripts/github/install_installer_environment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildScripts/github/install_installer_environment.sh b/buildScripts/github/install_installer_environment.sh index d6393cc5d3..059ff3cbef 100755 --- a/buildScripts/github/install_installer_environment.sh +++ b/buildScripts/github/install_installer_environment.sh @@ -15,7 +15,7 @@ echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile "$TRIK_PYTHON" -m pip install -U pip "$TRIK_PYTHON" -m pip install aqtinstall -"$TRIK_PYTHON" -m aqt install-qt linux desktop "$TRIK_QT_VERSION" -O /Qt -m qtscript --archives qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats icu qtwayland +"$TRIK_PYTHON" -m aqt install-qt linux desktop "$TRIK_QT_VERSION" -O /Qt -m qtscript qtwaylandcompositor --archives qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats icu qtwayland QT_ROOT_DIR=$(ls -1d /Qt/$TRIK_QT_VERSION*/gcc_64 | head -n 1) echo "$QT_ROOT_DIR/bin" >> $GITHUB_PATH From be25e834242215df6868ebf515ae0b39d2393e3f Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 6 Nov 2024 05:47:09 +0300 Subject: [PATCH 20/40] Add worflow for install TRIK Studio and switch to macOS-13 --- .github/workflows/common_build.yml | 101 +++++++++++++----- .github/workflows/installer.yml | 83 ++++++++++++++ .github/workflows/setup_environment.yml | 22 ++-- buildScripts/github/install_Linux.sh | 2 +- .../github/install_installer_Linux.sh | 47 ++++++++ .../github/install_installer_environment.sh | 14 +-- .../github/install_installer_macOS.sh | 22 ++++ buildScripts/github/install_macOS.sh | 4 +- .../meta/prebuild-linux-gnu.sh | 3 + installer/utils/linux-gnu_utils.sh | 2 +- installer/utils/mac_utils.sh | 8 +- 11 files changed, 256 insertions(+), 52 deletions(-) create mode 100644 .github/workflows/installer.yml create mode 100644 buildScripts/github/install_installer_Linux.sh create mode 100644 buildScripts/github/install_installer_macOS.sh diff --git a/.github/workflows/common_build.yml b/.github/workflows/common_build.yml index d1eadbe8f2..4a5a248677 100644 --- a/.github/workflows/common_build.yml +++ b/.github/workflows/common_build.yml @@ -1,4 +1,4 @@ -name: ubuntu CI +name: Common CI on: push: branches-ignore: @@ -30,11 +30,11 @@ on: branches-ignore: - 'dependabot**' workflow_dispatch: - + concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true - + jobs: lint: uses: ./.github/workflows/setup_environment.yml @@ -48,7 +48,7 @@ jobs: needs: lint uses: ./.github/workflows/setup_environment.yml with: - os: macos-12 + os: macos-13 build: true build_installer: false qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=warn_off" @@ -58,25 +58,32 @@ jobs: needs: lint uses: ./.github/workflows/setup_environment.yml with: - os: macos-12 + os: macos-13 build: true build_installer: false config: debug qmake_extra: "CONFIG+=warn_off CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" trik_python3_version_minor: 11 - + build-macos-installer: needs: [build-macos-debug-tests, build-macos-release-tests] uses: ./.github/workflows/setup_environment.yml with: - os: macos-12 + os: macos-13 build: true build_installer: true qmake_extra: " CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" trik_python3_version_minor: 11 tests: true secrets: inherit - + + install-macos-installer: + needs: build-macos-installer + uses: ./.github/workflows/installer.yml + with: + os: macos-13 + artifact_name: macos-13-installer + build-ubuntu-release-tests: needs: lint uses: ./.github/workflows/setup_environment.yml @@ -86,7 +93,18 @@ jobs: build_installer: false qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers" trik_python3_version_minor: 10 - + + build-ubuntu-debug-tests: + needs: lint + uses: ./.github/workflows/setup_environment.yml + with: + os: ubuntu-latest + build: true + build_installer: false + config: debug + qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" + trik_python3_version_minor: 10 + build-altlinux-release-tests: needs: lint uses: ./.github/workflows/setup_environment.yml @@ -97,18 +115,19 @@ jobs: build_installer: false qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers" tests: true - + build-rockylinux-distro-release-tests: needs: lint uses: ./.github/workflows/setup_environment.yml with: os: ubuntu-latest - container_name: rockylinux:9 + container_name: rockylinux:8 build: true build_installer: false qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=sanitizer CONFIG+=sanitize-undefined" gcc_version: 13 - + shell: bash -l {0} + # Use Python 3.11, as the Python 3.12 package in Rocky Linux AppStream x86_64 crashes # with a segmentation fault when restarting the interpreter during the import of asyncio # (specifically when loading _ssl) in PythonQt::init(). @@ -117,7 +136,7 @@ jobs: uses: ./.github/workflows/setup_environment.yml with: os: ubuntu-latest - container_name: rockylinux:9 + container_name: rockylinux:8 build: true build_installer: false qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=sanitizer CONFIG+=sanitize-undefined CONFIG+=sanitize_address" @@ -125,30 +144,60 @@ jobs: trik_qt_version: 5.15 trik_python3_version_minor: 11 linux_installer_environment: true + shell: bash -l {0} - build-ubuntu-debug-tests: - needs: lint - uses: ./.github/workflows/setup_environment.yml - with: - os: ubuntu-latest - build: true - build_installer: false - config: debug - qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" - trik_python3_version_minor: 10 - build-rockylinux-installer: needs: [build-rockylinux-installer-release-tests] uses: ./.github/workflows/setup_environment.yml with: os: ubuntu-latest - container_name: "rockylinux:9" + container_name: rockylinux:8 build: true build_installer: true tests: true - qmake_extra: "CONFIG+=noPch CONFIG+=ccache" + qmake_extra: "CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=warn_off" gcc_version: 13 trik_qt_version: 5.15 trik_python3_version_minor: 11 linux_installer_environment: true + shell: bash -l {0} secrets: inherit + + install-ubuntu-installer: + needs: [build-rockylinux-installer] + uses: ./.github/workflows/installer.yml + with: + os: ubuntu-latest + artifact_name: ubuntu-latest-installer + + install-ubuntu-installer-1-concurrency: + needs: [build-rockylinux-installer] + uses: ./.github/workflows/installer.yml + with: + os: ubuntu-latest + artifact_name: ubuntu-latest-installer + concurrency: 1 + + install-rockylinux-installer: + needs: [build-rockylinux-installer] + uses: ./.github/workflows/installer.yml + with: + os: ubuntu-latest + container_name: rockylinux:8 + artifact_name: ubuntu-latest-installer + + install-altlinux-installer: + needs: [build-rockylinux-installer] + uses: ./.github/workflows/installer.yml + with: + os: ubuntu-latest + container_name: altlinux/base:latest + artifact_name: ubuntu-latest-installer + + install-archlinux-installer: + needs: [build-rockylinux-installer] + uses: ./.github/workflows/installer.yml + with: + os: ubuntu-latest + container_name: archlinux:latest + artifact_name: ubuntu-latest-installer diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml new file mode 100644 index 0000000000..cc3e3bc058 --- /dev/null +++ b/.github/workflows/installer.yml @@ -0,0 +1,83 @@ +name: Installer action + +on: + workflow_call: + inputs: + os: + required: true + type: string + container_name: + required: false + type: string + default: "" + artifact_name: + required: true + type: string + concurrency: + required: false + type: number + default: 0 +jobs: + job: + defaults: + run: + shell: bash + + runs-on: ${{ inputs.os }} + container: ${{ inputs.container_name }} + + steps: + + - name: Install dependencies + run: apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git p7zip curl + if: startsWith(inputs.container_name, 'altlinux') == true + + - name: Install dependencies + run: yum install -y epel-release && yum update -y && yum install -y git-core findutils p7zip + if: startsWith(inputs.container_name, 'rocky') == true + + - name: Install dependencies + run: pacman -Sy && pacman -S git p7zip --noconfirm + if: startsWith(inputs.container_name, 'arch') == true + + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 1 + + - name: Download installer artifact + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.artifact_name }} + + - name: Install trik-studio and dll search + run: | + ls + export UNINSTALL_SCRIPT_PATH=$GITHUB_WORKSPACE/trik_studio_uninstallscript.qs + export INSTALLER_EXT_NAME=$(ls -1d *-installer-* | head -n 1) + export INSTALLER_NAME="${INSTALLER_EXT_NAME%.*}" + buildScripts/github/install_installer_${{ runner.os }}.sh + env: + CONCURRENCY: ${{ inputs.concurrency }} + + - name: Reinstall trik-studio and dll search + run: | + export UNINSTALL_SCRIPT_PATH=$GITHUB_WORKSPACE/trik_studio_uninstallscript.qs + export INSTALLER_EXT_NAME=$(ls -1d *-installer-* | head -n 1) + export INSTALLER_NAME="${INSTALLER_EXT_NAME%.*}" + buildScripts/github/install_installer_${{ runner.os }}.sh + env: + CONCURRENCY: ${{ inputs.concurrency }} + + - name: Downloads minimal tests + run: | + curl --output tests.7z "https://dl.trikset.com/edu/.solutions20200701/testing_small.7z" + 7z x tests.7z || 7za x tests.7z + + - name: Run minimal tests + run: | + TWOD_EXEC_NAME=$(ls -1d $BIN_DIR/2D-model* | head -n 1) + #TRIK_PYTHONPATH_BUNDLE_DIR="$LIB_DIR"/python-runtime + #export TRIK_PYTHONPATH=.:"${TRIK_PYTHONPATH_BUNDLE_DIR}/base_library.zip:${TRIK_PYTHONPATH_BUNDLE_DIR}/lib-dynload:${TRIK_PYTHONPATH_BUNDLE_DIR}" + for i in $GITHUB_WORKSPACE/testing_small/*; do "$TWOD_EXEC_NAME" -b -s 5 "$i" --platform minimal; done diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index 3c45a88b0e..baca363bf1 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -39,7 +39,7 @@ on: xcode_version: required: false type: string - default: 13.4 + default: 14.3 config: required: false type: string @@ -60,12 +60,16 @@ on: required: false type: string default: 13 + shell: + required: false + type: string + default: bash jobs: - job: + build: defaults: run: - shell: bash -l {0} + shell: ${{ inputs.shell }} runs-on: ${{ inputs.os }} container: ${{ inputs.container_name }} @@ -146,7 +150,7 @@ jobs: with: path: ${{ github.workspace }}/.ccache/${{ inputs.os }}-c${{ inputs.container_name }}-${{ inputs.config }} key: ccache-c${{ inputs.container_name }}-${{ inputs.os }}-${{ inputs.config }}-${{ inputs.qmake_extra }}-${{ github.sha }} - if: ${{ inputs.build == 'true' }} + if: ${{ inputs.build == true }} - name: Run tests run: ${{ inputs.executor }} buildScripts/github/run_tests.sh && ${{ inputs.executor }} buildScripts/github/test.sh @@ -172,19 +176,13 @@ jobs: host: ${{ secrets.DL_HOST }} if: ${{ inputs.build_installer == true }} - - name: Eval artifact name - run: | - CONTAINER_NAME=${{ inputs.container_name }} - PATCH_CONTAINER_NAME=${CONTAINER_NAME//[^a-zA-Z0-9_-]/} - echo "PATCH_CONTAINER_NAME=$PATCH_CONTAINER_NAME" >> $GITHUB_ENV - - name: Upload installer artifact uses: actions/upload-artifact@v4 with: - name: ${{ runner.os }}-${{ env.PATCH_CONTAINER_NAME }}-installer + name: ${{ inputs.os }}-installer path: | installer/*.exe installer/*.run installer/*.dmg - installer/trik_studio_uninstallscript.qs + installer/*.qs if: ${{ inputs.build_installer == true }} diff --git a/buildScripts/github/install_Linux.sh b/buildScripts/github/install_Linux.sh index e328fcd487..3085be1d70 100755 --- a/buildScripts/github/install_Linux.sh +++ b/buildScripts/github/install_Linux.sh @@ -19,6 +19,6 @@ elif [[ "$ID" = "rocky" || "$ID" = '"rocky"' ]]; then yum install -y libxkbcommon-x11 qt5-qtbase-gui #no desire to enumerate all required libraries for QtIFw yum install -y pulseaudio-libs-glib2 # to run TS and 2D-model even with `minimal` platform yum install -y qt5-qtscript-devel qt5-qttools-devel qt5-qtmultimedia-devel qt5-qtserialport-devel qt5-qtsvg-devel qt5-qtbase-devel qt5-qtbase-private-devel \ - qt5-qtwayland-devel + qt5-qtwayland echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile fi diff --git a/buildScripts/github/install_installer_Linux.sh b/buildScripts/github/install_installer_Linux.sh new file mode 100644 index 0000000000..659933880e --- /dev/null +++ b/buildScripts/github/install_installer_Linux.sh @@ -0,0 +1,47 @@ +#!/bin/bash +set -eux + +ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) + +if [ "$ID" = "altlinux" ]; then + apt-get update && apt-get install -y libxkbcommon-x11 libX11 fontconfig libxcbutil-icccm \ + libxcbutil-image libdbus libxcbutil-keysyms libxcb-render-util +elif [ "$ID" = "ubuntu" ]; then + sudo apt-get update && sudo apt-get install -y libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 \ + libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-sync1 libxcb-xfixes0 \ + libxcb-shape0 libx11-xcb1 libfreetype6 libfontconfig1 libdbus-1-3 +elif [ "$ID" = "arch" ]; then + pacman -Sy && pacman -S libxkbcommon-x11 xcb-util-wm xcb-util-image xcb-util-keysyms xcb-util-renderutil fontconfig libx11 --noconfirm +elif [[ "$ID" = "rocky" || "$ID" = '"rocky"' ]]; then + yum update -y && yum install -y libxkbcommon-x11 xcb-util-wm libX11 xcb-util-image \ + dbus-libs xcb-util-keysyms xcb-util-renderutil fontconfig libX11-xcb +fi + +INSTALLER_NAME="$INSTALLER_NAME.run" +chmod +x "$INSTALLER_NAME" + +if [[ -z "$CONCURRENCY" ]]; then + ./$INSTALLER_NAME --verbose --script trik_studio_installscript.qs --platform minimal --mco "$CONCURRENCY" +else + ./$INSTALLER_NAME --verbose --script trik_studio_installscript.qs --platform minimal +fi + +if [ "$ID" = "ubuntu" ]; then + BIN_DIR=$HOME/TRIKStudio/bin && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV + LIB_DIR=$HOME/TRIKStudio/lib && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV + APP_DIR=$HOME/TRIKStudio && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV +else + BIN_DIR=/opt/TRIKStudio/bin && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV + LIB_DIR=/opt/TRIKStudio/lib && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV + APP_DIR=/opt/TRIKStudio && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV +fi + +export LD_LIBRARY_PATH="$LIB_DIR" +"$BIN_DIR"/2D-model --version --platform minimal +"$APP_DIR"/maintenance --version --platform minimal +"$APP_DIR"/trik-studio --version --platform minimal +"$BIN_DIR"/patcher --version + +cd "$LIB_DIR" +ls *.so* | xargs ldd | grep "not found" || exit 0 +exit 1 diff --git a/buildScripts/github/install_installer_environment.sh b/buildScripts/github/install_installer_environment.sh index 059ff3cbef..771d696467 100755 --- a/buildScripts/github/install_installer_environment.sh +++ b/buildScripts/github/install_installer_environment.sh @@ -8,18 +8,20 @@ TRIK_QT_VERSION=${TRIK_QT_VERSION:-5.15} yum update -y && yum install -y epel-release yum install --allowerasing -y sudo which libusbx-devel curl wget make gcc-toolset-"$GCC_VERSION"-{gcc-c++,libasan-devel,libubsan-devel,gdb} \ -git-core ccache zlib-devel rsync "$TRIK_PYTHON"-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip xz time -yum install -y libxkbcommon-x11 qt5-qtbase-gui -yum install -y pulseaudio-libs-glib2 +git-core ccache zlib-devel rsync "$TRIK_PYTHON"-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip xz time findutils +yum install -y pulseaudio-libs-glib2 qt5-qtbase-gui libwayland-{server,client,cursor} libxkbcommon-x11 echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile "$TRIK_PYTHON" -m pip install -U pip "$TRIK_PYTHON" -m pip install aqtinstall -"$TRIK_PYTHON" -m aqt install-qt linux desktop "$TRIK_QT_VERSION" -O /Qt -m qtscript qtwaylandcompositor --archives qtbase qtmultimedia qtsvg qtscript qttools qtserialport qtimageformats icu qtwayland - +"$TRIK_PYTHON" -m aqt install-qt linux desktop "$TRIK_QT_VERSION" -O /Qt -m qtscript qtwaylandcompositor --archives qtbase qtmultimedia qtsvg qtscript \ +qttools qtserialport qtimageformats icu qtwayland qtdeclarative + +#libQt5WaylandCompositor.so.5.15: libQt5Quick.so.5 libQt5Qml.so.5 libQt5QmlModels.so.5 + QT_ROOT_DIR=$(ls -1d /Qt/$TRIK_QT_VERSION*/gcc_64 | head -n 1) echo "$QT_ROOT_DIR/bin" >> $GITHUB_PATH - + if [ "$BUILD_INSTALLER" = "true" ]; then "$TRIK_PYTHON" -m pip install -U pip "$TRIK_PYTHON" -m pip install aqtinstall diff --git a/buildScripts/github/install_installer_macOS.sh b/buildScripts/github/install_installer_macOS.sh new file mode 100644 index 0000000000..2e9f0e0399 --- /dev/null +++ b/buildScripts/github/install_installer_macOS.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -euxo pipefail + +sudo hdiutil attach "$INSTALLER_EXT_NAME" +sudo cp -rf "/Volumes/$INSTALLER_NAME/$INSTALLER_NAME.app" $GITHUB_WORKSPACE +sudo hdiutil detach /Volumes/"$INSTALLER_NAME" +./$INSTALLER_NAME.app/Contents/MacOS/$INSTALLER_NAME --verbose --script trik_studio_installscript.qs + +BIN_DIR=/Applications/TRIKStudio/bin && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV +LIB_DIR=/Applications/TRIKStudio/lib && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV +APP_DIR=/Applications/TRIKStudio && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV + +ls /Applications/TRIKStudio/ +export DYLD_LIBRARY_PATH="$LIB_DIR" +"$BIN_DIR"/2D-model --version +"$BIN_DIR"/checkapp --version +"$BIN_DIR"/patcher --version +"$APP_DIR"/maintenance --version +"$APP_DIR"/trik-studio --version + +ls "*.dylib" | xargs otool -L | grep "not found" || exit 0 +exit 1 diff --git a/buildScripts/github/install_macOS.sh b/buildScripts/github/install_macOS.sh index e855972e58..85a59c3c43 100755 --- a/buildScripts/github/install_macOS.sh +++ b/buildScripts/github/install_macOS.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -euo pipefail +set -xeuo pipefail export HOMEBREW_NO_INSTALL_CLEANUP=1 export HOMEBREW_NO_AUTO_UPDATE=1 brew tap "hudochenkov/sshpass" @@ -13,7 +13,7 @@ TRIK_PYTHON=python3.${TRIK_PYTHON3_VERSION_MINOR} "$TRIK_PYTHON" -m pip install -U pip "$TRIK_PYTHON" -m pip install aqtinstall "$TRIK_PYTHON" -m aqt install-qt -m qtscript -O "$HOME/Qt" mac desktop "${TRIK_QT_VERSION}" -[ -d $HOME/qtifw ] || env TRIK_QT_INSTALL_DIR="$HOME/qtifw" "$(dirname $(realpath ${BASH_SOURCE[0]}))"/install_qtifw_mac.sh +[ -d $HOME/qtifw ] || env TRIK_QT_INSTALL_DIR="$HOME/qtifw" "$(dirname $(grealpath ${BASH_SOURCE[0]}))"/install_qtifw_mac.sh sudo xcode-select -s /Applications/Xcode_${XCODE_VERSION}.app/Contents/Developer xcodebuild -showsdks diff --git a/installer/packages/trik-studio/ru.qreal.root.trik.core/meta/prebuild-linux-gnu.sh b/installer/packages/trik-studio/ru.qreal.root.trik.core/meta/prebuild-linux-gnu.sh index 0833d147e8..2d7f0335f1 100755 --- a/installer/packages/trik-studio/ru.qreal.root.trik.core/meta/prebuild-linux-gnu.sh +++ b/installer/packages/trik-studio/ru.qreal.root.trik.core/meta/prebuild-linux-gnu.sh @@ -3,6 +3,7 @@ set -o nounset set -o errexit cd "$(dirname "$0")" +source "$INSTALLER_ROOT"/utils/linux-gnu_utils.sh mkdir -p "$PWD/../data/lib/python-runtime" mkdir -p "$PWD"/../data/lib/plugins/editors @@ -48,5 +49,7 @@ rsync -avR --remove-source-files dist/trik/_internal/./*.so* "$PWD/../data/lib/" rm dist/trik/trik rsync -avRm --ignore-missing-args --delete --delete-after dist/trik/_internal/./* "$PWD/../data/lib/python-runtime" +add_required_libs "$PWD/../data/lib" + #PythonQt requires for dlopen'ing pushd "$PWD/../data/lib" && for f in libpython3.*.so.* ; do ln -svf "$f" "$(echo "$f" | cut -d . -f 1-3)" ; done ; popd diff --git a/installer/utils/linux-gnu_utils.sh b/installer/utils/linux-gnu_utils.sh index c509e2bc7a..b1f915ef62 100644 --- a/installer/utils/linux-gnu_utils.sh +++ b/installer/utils/linux-gnu_utils.sh @@ -11,7 +11,7 @@ copy_required_libs() { local qtDirLib="$QT_LIB" local hostDirLib="$qtDirLib" local binaries="$@" - local libs=$(env LD_LIBRARY_PATH="$targetLibsDir:$hostDirLib:$qtDirLib:${LD_LIBRARY_PATH:-}" ldd $binaries \ + local libs=$(env LD_LIBRARY_PATH="$targetLibsDir:$hostDirLib:$qtDirLib:/usr/lib64:${LD_LIBRARY_PATH:-}" ldd $binaries \ | grep -Ev "not found$" | grep so | sed -e '/^[^\t]/ d' | sed -e 's/\t//' | sed -e 's/.*=..//' | sed -e 's/ (0.*)//' | grep -Ev "lib(c|dl|m|pthread|rt)\.so.*" \ | xargs realpath -L -s | sort -u | grep -Ev "^$(realpath -e $targetLibsDir)|linux-vdso|^/lib64/") local rsync="" diff --git a/installer/utils/mac_utils.sh b/installer/utils/mac_utils.sh index 64ddb59b98..5c53b7ae9e 100644 --- a/installer/utils/mac_utils.sh +++ b/installer/utils/mac_utils.sh @@ -9,7 +9,7 @@ function fix_dependencies { set -ueo pipefail local target="$1" pushd "$(dirname "$target")" - local prefix=$(realpath -e "$2") + local prefix=$(grealpath -e "$2") local subst="$LIB_PATH" local relative local change @@ -17,16 +17,16 @@ function fix_dependencies { local install_name install_name=$(otool -D "$target" | tail -n +2 | grep -v '^@' || : ) if [[ -n "$install_name" ]] ; then - short_id=$(realpath -e --relative-to "$prefix" "$install_name" || echo "@rpath/"$(basename "$install_name")) + short_id=$(grealpath -e --relative-to "$prefix" "$install_name" || echo "@rpath/"$(basename "$install_name")) change="-id \"$short_id\"" fi for dep in $(otool -L "$target" | grep "^\t[^@]" | cut -f 1 -d \( || : ) ; do if [[ "$dep" == /System/Library/Frameworks/* || "$dep" == /usr/lib/* || "$dep" == "$install_name" ]] ; then continue; fi - normalized=$(realpath -e "$dep") + normalized=$(grealpath -e "$dep") if [[ "$normalized" == "$prefix"/* ]] ; then - relative=$(realpath -e --relative-to "$prefix" "$normalized") + relative=$(grealpath -e --relative-to "$prefix" "$normalized") change="$change -change \"$dep\" \"$subst/$relative\"" fi done From 1808d7cc8cd37bffa63ce7a428f2492fe482a494 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 6 Nov 2024 06:18:05 +0300 Subject: [PATCH 21/40] Switch distro rockylinux build to python3.11 --- .github/workflows/common_build.yml | 1 + buildScripts/github/install_Linux.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/common_build.yml b/.github/workflows/common_build.yml index 4a5a248677..6c308863d9 100644 --- a/.github/workflows/common_build.yml +++ b/.github/workflows/common_build.yml @@ -127,6 +127,7 @@ jobs: qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=sanitizer CONFIG+=sanitize-undefined" gcc_version: 13 shell: bash -l {0} + trik_python3_version_minor: 11 # Use Python 3.11, as the Python 3.12 package in Rocky Linux AppStream x86_64 crashes # with a segmentation fault when restarting the interpreter during the import of asyncio diff --git a/buildScripts/github/install_Linux.sh b/buildScripts/github/install_Linux.sh index 3085be1d70..8fbfd4cae5 100755 --- a/buildScripts/github/install_Linux.sh +++ b/buildScripts/github/install_Linux.sh @@ -15,7 +15,7 @@ elif [ "$ID" = "ubuntu" ]; then elif [[ "$ID" = "rocky" || "$ID" = '"rocky"' ]]; then yum update -y && yum install -y epel-release yum install --allowerasing -y sudo which libusbx-devel curl wget make gcc-toolset-"$GCC_VERSION"-{gcc-c++,libasan-devel,libubsan-devel,gdb} \ - git-core ccache zlib-devel rsync python3-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip xz time + git-core ccache zlib-devel rsync python3.${TRIK_PYTHON3_VERSION_MINOR}-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip xz time yum install -y libxkbcommon-x11 qt5-qtbase-gui #no desire to enumerate all required libraries for QtIFw yum install -y pulseaudio-libs-glib2 # to run TS and 2D-model even with `minimal` platform yum install -y qt5-qtscript-devel qt5-qttools-devel qt5-qtmultimedia-devel qt5-qtserialport-devel qt5-qtsvg-devel qt5-qtbase-devel qt5-qtbase-private-devel \ From 932979e4bedeac8e6fa13ce113a3774cf323c7b5 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 6 Nov 2024 12:02:29 +0300 Subject: [PATCH 22/40] Add executable bit --- buildScripts/github/install_installer_Linux.sh | 0 buildScripts/github/install_installer_macOS.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 buildScripts/github/install_installer_Linux.sh mode change 100644 => 100755 buildScripts/github/install_installer_macOS.sh diff --git a/buildScripts/github/install_installer_Linux.sh b/buildScripts/github/install_installer_Linux.sh old mode 100644 new mode 100755 diff --git a/buildScripts/github/install_installer_macOS.sh b/buildScripts/github/install_installer_macOS.sh old mode 100644 new mode 100755 From 4c2e27a09988667456c6b6d40d01b9988c14bf0a Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 6 Nov 2024 14:12:31 +0300 Subject: [PATCH 23/40] Change macOS application dir --- buildScripts/github/install_installer_macOS.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/buildScripts/github/install_installer_macOS.sh b/buildScripts/github/install_installer_macOS.sh index 2e9f0e0399..0ec2a6fc3b 100755 --- a/buildScripts/github/install_installer_macOS.sh +++ b/buildScripts/github/install_installer_macOS.sh @@ -6,11 +6,11 @@ sudo cp -rf "/Volumes/$INSTALLER_NAME/$INSTALLER_NAME.app" $GITHUB_WORKSPACE sudo hdiutil detach /Volumes/"$INSTALLER_NAME" ./$INSTALLER_NAME.app/Contents/MacOS/$INSTALLER_NAME --verbose --script trik_studio_installscript.qs -BIN_DIR=/Applications/TRIKStudio/bin && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV -LIB_DIR=/Applications/TRIKStudio/lib && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV -APP_DIR=/Applications/TRIKStudio && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV +BIN_DIR="/Applications/TRIKStudio/TRIK Studio.app/" && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV +LIB_DIR="/Applications/TRIKStudio/TRIK Studio.app/Lib" && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV +APP_DIR="/Applications/TRIKStudio" && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV -ls /Applications/TRIKStudio/ +ls "/Applications/TRIKStudio/TRIK Studio.app" export DYLD_LIBRARY_PATH="$LIB_DIR" "$BIN_DIR"/2D-model --version "$BIN_DIR"/checkapp --version From f668e7b1d024b4bceef2c10ca3c3e3d08ff06c86 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 6 Nov 2024 14:43:05 +0300 Subject: [PATCH 24/40] Add ldd search for non system lib --- buildScripts/github/install_installer_Linux.sh | 5 +++++ buildScripts/github/install_installer_macOS.sh | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/buildScripts/github/install_installer_Linux.sh b/buildScripts/github/install_installer_Linux.sh index 659933880e..b76c97702c 100755 --- a/buildScripts/github/install_installer_Linux.sh +++ b/buildScripts/github/install_installer_Linux.sh @@ -43,5 +43,10 @@ export LD_LIBRARY_PATH="$LIB_DIR" "$BIN_DIR"/patcher --version cd "$LIB_DIR" + +ls *.so* | xargs ldd | grep -Ev "not found$" | grep so | sed -e '/^[^\t]/ d' | sed -e 's/\t//' \ + | sed -e 's/.*=..//' | sed -e 's/ (0.*)//' | grep -Ev "lib(c|dl|m|pthread|rt)\.so.*" \ + | grep -Ev "$LD_LIBRARY_PATH" | grep -Ev "ld|linux-vdso" + ls *.so* | xargs ldd | grep "not found" || exit 0 exit 1 diff --git a/buildScripts/github/install_installer_macOS.sh b/buildScripts/github/install_installer_macOS.sh index 0ec2a6fc3b..d2cac8d3c6 100755 --- a/buildScripts/github/install_installer_macOS.sh +++ b/buildScripts/github/install_installer_macOS.sh @@ -6,11 +6,11 @@ sudo cp -rf "/Volumes/$INSTALLER_NAME/$INSTALLER_NAME.app" $GITHUB_WORKSPACE sudo hdiutil detach /Volumes/"$INSTALLER_NAME" ./$INSTALLER_NAME.app/Contents/MacOS/$INSTALLER_NAME --verbose --script trik_studio_installscript.qs -BIN_DIR="/Applications/TRIKStudio/TRIK Studio.app/" && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV -LIB_DIR="/Applications/TRIKStudio/TRIK Studio.app/Lib" && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV -APP_DIR="/Applications/TRIKStudio" && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV +BIN_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents" && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV +LIB_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents/Lib" && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV +APP_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents" && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV -ls "/Applications/TRIKStudio/TRIK Studio.app" +ls "/Applications/TRIKStudio/TRIK Studio.app/Contents" export DYLD_LIBRARY_PATH="$LIB_DIR" "$BIN_DIR"/2D-model --version "$BIN_DIR"/checkapp --version @@ -18,5 +18,6 @@ export DYLD_LIBRARY_PATH="$LIB_DIR" "$APP_DIR"/maintenance --version "$APP_DIR"/trik-studio --version +cd "$LIB_DIR" ls "*.dylib" | xargs otool -L | grep "not found" || exit 0 exit 1 From 4f2c95de20e2106d8a56c1de26ad88a5371347a7 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 6 Nov 2024 15:53:21 +0300 Subject: [PATCH 25/40] Change application path --- buildScripts/github/install_installer_macOS.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/buildScripts/github/install_installer_macOS.sh b/buildScripts/github/install_installer_macOS.sh index d2cac8d3c6..f66ecf913d 100755 --- a/buildScripts/github/install_installer_macOS.sh +++ b/buildScripts/github/install_installer_macOS.sh @@ -6,11 +6,11 @@ sudo cp -rf "/Volumes/$INSTALLER_NAME/$INSTALLER_NAME.app" $GITHUB_WORKSPACE sudo hdiutil detach /Volumes/"$INSTALLER_NAME" ./$INSTALLER_NAME.app/Contents/MacOS/$INSTALLER_NAME --verbose --script trik_studio_installscript.qs -BIN_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents" && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV +BIN_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents/MacOS" && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV LIB_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents/Lib" && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV -APP_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents" && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV +APP_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents/MacOS" && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV -ls "/Applications/TRIKStudio/TRIK Studio.app/Contents" +ls "/Applications/TRIKStudio/TRIK Studio.app/Contents/MacOS" export DYLD_LIBRARY_PATH="$LIB_DIR" "$BIN_DIR"/2D-model --version "$BIN_DIR"/checkapp --version @@ -19,5 +19,5 @@ export DYLD_LIBRARY_PATH="$LIB_DIR" "$APP_DIR"/trik-studio --version cd "$LIB_DIR" -ls "*.dylib" | xargs otool -L | grep "not found" || exit 0 +ls *.dylib | xargs otool -L | grep "not found" || exit 0 exit 1 From 7b843cd38c4459c9d3c4a6daefa84ddfbe26ff9b Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 6 Nov 2024 16:52:01 +0300 Subject: [PATCH 26/40] Install dependencies for install TRIK Studio on macOS --- .github/workflows/installer.yml | 4 ++++ buildScripts/github/install_installer_macOS.sh | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index cc3e3bc058..f1fceb828d 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -40,6 +40,10 @@ jobs: run: pacman -Sy && pacman -S git p7zip --noconfirm if: startsWith(inputs.container_name, 'arch') == true + - name: Install dependencies + run: HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install p7zip || brew upgrade p7zip + if: startsWith(inputs.os, 'mac') == true + - name: Checkout repository uses: actions/checkout@v4 with: diff --git a/buildScripts/github/install_installer_macOS.sh b/buildScripts/github/install_installer_macOS.sh index f66ecf913d..b4ba5b992a 100755 --- a/buildScripts/github/install_installer_macOS.sh +++ b/buildScripts/github/install_installer_macOS.sh @@ -13,7 +13,6 @@ APP_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents/MacOS" && echo "APP_D ls "/Applications/TRIKStudio/TRIK Studio.app/Contents/MacOS" export DYLD_LIBRARY_PATH="$LIB_DIR" "$BIN_DIR"/2D-model --version -"$BIN_DIR"/checkapp --version "$BIN_DIR"/patcher --version "$APP_DIR"/maintenance --version "$APP_DIR"/trik-studio --version From a645acbe395bdec4863090a476c0bc0d5d4c3ff1 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 6 Nov 2024 17:38:24 +0300 Subject: [PATCH 27/40] Add step for test interpterer on existing .qrs --- .github/workflows/installer.yml | 16 ++++++++++++++-- buildScripts/github/install_installer_macOS.sh | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index f1fceb828d..10f6c723f4 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -82,6 +82,18 @@ jobs: - name: Run minimal tests run: | TWOD_EXEC_NAME=$(ls -1d $BIN_DIR/2D-model* | head -n 1) - #TRIK_PYTHONPATH_BUNDLE_DIR="$LIB_DIR"/python-runtime - #export TRIK_PYTHONPATH=.:"${TRIK_PYTHONPATH_BUNDLE_DIR}/base_library.zip:${TRIK_PYTHONPATH_BUNDLE_DIR}/lib-dynload:${TRIK_PYTHONPATH_BUNDLE_DIR}" for i in $GITHUB_WORKSPACE/testing_small/*; do "$TWOD_EXEC_NAME" -b -s 5 "$i" --platform minimal; done + + - name: Run minimal JavaScript interpeter tests + run: | + TWOD_EXEC_NAME=$(ls -1d $BIN_DIR/2D-model* | head -n 1) + for i in $GITHUB_WORKSPACE/testing_small/*; do "$TWOD_EXEC_NAME" --generate-path "$i".js --generate-mode javascript \ + -b -s 5 --direct-script-path "$i".js "$i" --platform minimal; done + + - name: Run minimal Python interpeter tests + run: | + TRIK_PYTHONPATH_BUNDLE_DIR="$LIB_DIR"/python-runtime + export TRIK_PYTHONPATH=.:"${TRIK_PYTHONPATH_BUNDLE_DIR}/base_library.zip:${TRIK_PYTHONPATH_BUNDLE_DIR}/lib-dynload:${TRIK_PYTHONPATH_BUNDLE_DIR}" + TWOD_EXEC_NAME=$(ls -1d $BIN_DIR/2D-model* | head -n 1) + for i in $GITHUB_WORKSPACE/testing_small/*; do "$TWOD_EXEC_NAME" --generate-path "$i".py \ + -b -s 5 --direct-script-path "$i".py "$i" --platform minimal; done diff --git a/buildScripts/github/install_installer_macOS.sh b/buildScripts/github/install_installer_macOS.sh index b4ba5b992a..654a3eda09 100755 --- a/buildScripts/github/install_installer_macOS.sh +++ b/buildScripts/github/install_installer_macOS.sh @@ -14,7 +14,7 @@ ls "/Applications/TRIKStudio/TRIK Studio.app/Contents/MacOS" export DYLD_LIBRARY_PATH="$LIB_DIR" "$BIN_DIR"/2D-model --version "$BIN_DIR"/patcher --version -"$APP_DIR"/maintenance --version +/Applications/TRIKStudio/maintenance.app/Contents/MacOS/maintenance --version "$APP_DIR"/trik-studio --version cd "$LIB_DIR" From c89c3869ec2b440ae36cbdbfc4380b5160f1e1b4 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 6 Nov 2024 19:05:40 +0300 Subject: [PATCH 28/40] Remove previous installation --- buildScripts/github/install_installer_macOS.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/buildScripts/github/install_installer_macOS.sh b/buildScripts/github/install_installer_macOS.sh index 654a3eda09..14ce26917b 100755 --- a/buildScripts/github/install_installer_macOS.sh +++ b/buildScripts/github/install_installer_macOS.sh @@ -10,6 +10,7 @@ BIN_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents/MacOS" && echo "BIN_D LIB_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents/Lib" && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV APP_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents/MacOS" && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV +sudo rm -rf $INSTALLER_NAME.app ls "/Applications/TRIKStudio/TRIK Studio.app/Contents/MacOS" export DYLD_LIBRARY_PATH="$LIB_DIR" "$BIN_DIR"/2D-model --version From c5c080ec9455f30c83172ac90d3dcb1369c8efc6 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Wed, 6 Nov 2024 20:17:26 +0300 Subject: [PATCH 29/40] Add quotes --- .github/workflows/installer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index 10f6c723f4..8c5bf936a8 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -81,12 +81,12 @@ jobs: - name: Run minimal tests run: | - TWOD_EXEC_NAME=$(ls -1d $BIN_DIR/2D-model* | head -n 1) + TWOD_EXEC_NAME=$(ls -1d "$BIN_DIR"/2D-model* | head -n 1) for i in $GITHUB_WORKSPACE/testing_small/*; do "$TWOD_EXEC_NAME" -b -s 5 "$i" --platform minimal; done - name: Run minimal JavaScript interpeter tests run: | - TWOD_EXEC_NAME=$(ls -1d $BIN_DIR/2D-model* | head -n 1) + TWOD_EXEC_NAME=$(ls -1d "$BIN_DIR"/2D-model* | head -n 1) for i in $GITHUB_WORKSPACE/testing_small/*; do "$TWOD_EXEC_NAME" --generate-path "$i".js --generate-mode javascript \ -b -s 5 --direct-script-path "$i".js "$i" --platform minimal; done From b86e352ef1d3f8f2f075c5db8d80c39100592190 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Sat, 9 Nov 2024 00:42:54 +0300 Subject: [PATCH 30/40] Format --- .../github/install_installer_Linux.sh | 21 +++++++------------ .../ru.qreal.root/meta/installscript.qs | 2 +- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/buildScripts/github/install_installer_Linux.sh b/buildScripts/github/install_installer_Linux.sh index b76c97702c..066989f80d 100755 --- a/buildScripts/github/install_installer_Linux.sh +++ b/buildScripts/github/install_installer_Linux.sh @@ -20,22 +20,17 @@ fi INSTALLER_NAME="$INSTALLER_NAME.run" chmod +x "$INSTALLER_NAME" -if [[ -z "$CONCURRENCY" ]]; then - ./$INSTALLER_NAME --verbose --script trik_studio_installscript.qs --platform minimal --mco "$CONCURRENCY" -else - ./$INSTALLER_NAME --verbose --script trik_studio_installscript.qs --platform minimal -fi - +./$INSTALLER_NAME --verbose --script trik_studio_installscript.qs --platform minimal --mco "$CONCURRENCY" + +PREFIX=/opt if [ "$ID" = "ubuntu" ]; then - BIN_DIR=$HOME/TRIKStudio/bin && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV - LIB_DIR=$HOME/TRIKStudio/lib && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV - APP_DIR=$HOME/TRIKStudio && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV -else - BIN_DIR=/opt/TRIKStudio/bin && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV - LIB_DIR=/opt/TRIKStudio/lib && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV - APP_DIR=/opt/TRIKStudio && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV + PREFIX=$HOME fi +BIN_DIR=$PREFIX/TRIKStudio/bin && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV +LIB_DIR=$PREFIX/TRIKStudio/lib && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV +APP_DIR=$PREFIX/TRIKStudio && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV + export LD_LIBRARY_PATH="$LIB_DIR" "$BIN_DIR"/2D-model --version --platform minimal "$APP_DIR"/maintenance --version --platform minimal diff --git a/installer/packages/qreal-base/ru.qreal.root/meta/installscript.qs b/installer/packages/qreal-base/ru.qreal.root/meta/installscript.qs index 2000bea0cd..250f6e0ec6 100644 --- a/installer/packages/qreal-base/ru.qreal.root/meta/installscript.qs +++ b/installer/packages/qreal-base/ru.qreal.root/meta/installscript.qs @@ -144,7 +144,7 @@ function Component() if (installer.shouldDeinstallPrevious) { additionalOptions = installer.environmentVariable("UNINSTALL_SCRIPT_PATH"); if (additionalOptions != "") { - additionalOptions = " --sript " + additionalOptions; + additionalOptions = " --script " + additionalOptions; } installer.performOperation("Execute", Dir.toNativeSeparator("@TargetDir@/" + installer.maintenanceName) + additionalOptions); if (installer.value("os") == "win") { From e3787b9a2cdf53dfec7de3d57d0b46334dd34668 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Sun, 10 Nov 2024 23:41:22 +0300 Subject: [PATCH 31/40] Minor fixes --- .github/workflows/common_build.yml | 2 +- .github/workflows/installer.yml | 16 +++++----- .github/workflows/setup_environment.yml | 4 +-- buildScripts/github/build_installer.sh | 2 +- .../github/install_installer_Linux.sh | 31 ++++++++++--------- .../github/install_installer_environment.sh | 17 +++++----- .../github/install_installer_macOS.sh | 6 ++-- 7 files changed, 41 insertions(+), 37 deletions(-) diff --git a/.github/workflows/common_build.yml b/.github/workflows/common_build.yml index 6c308863d9..6a03d332b5 100644 --- a/.github/workflows/common_build.yml +++ b/.github/workflows/common_build.yml @@ -192,7 +192,7 @@ jobs: uses: ./.github/workflows/installer.yml with: os: ubuntu-latest - container_name: altlinux/base:latest + container_name: alt:latest artifact_name: ubuntu-latest-installer install-archlinux-installer: diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index 8c5bf936a8..62d99cd911 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -29,15 +29,15 @@ jobs: steps: - name: Install dependencies - run: apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git p7zip curl + run: apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git-core p7zip curl sudo if: startsWith(inputs.container_name, 'altlinux') == true - name: Install dependencies - run: yum install -y epel-release && yum update -y && yum install -y git-core findutils p7zip + run: yum install -y epel-release && yum update -y && yum install -y git-core findutils p7zip sudo if: startsWith(inputs.container_name, 'rocky') == true - name: Install dependencies - run: pacman -Sy && pacman -S git p7zip --noconfirm + run: pacman -Sy && pacman -S git p7zip sudo --noconfirm if: startsWith(inputs.container_name, 'arch') == true - name: Install dependencies @@ -82,18 +82,18 @@ jobs: - name: Run minimal tests run: | TWOD_EXEC_NAME=$(ls -1d "$BIN_DIR"/2D-model* | head -n 1) - for i in $GITHUB_WORKSPACE/testing_small/*; do "$TWOD_EXEC_NAME" -b -s 5 "$i" --platform minimal; done + for i in "$GITHUB_WORKSPACE"/testing_small/*; do "$TWOD_EXEC_NAME" -b -s 5 "$i" --platform minimal; done - name: Run minimal JavaScript interpeter tests run: | TWOD_EXEC_NAME=$(ls -1d "$BIN_DIR"/2D-model* | head -n 1) - for i in $GITHUB_WORKSPACE/testing_small/*; do "$TWOD_EXEC_NAME" --generate-path "$i".js --generate-mode javascript \ - -b -s 5 --direct-script-path "$i".js "$i" --platform minimal; done + for i in "$GITHUB_WORKSPACE"/testing_small/*; do "$TWOD_EXEC_NAME" --generate-path "$i".js --generate-mode javascript \ + -b -s 5 --script-path "$i".js "$i" --platform minimal; done - name: Run minimal Python interpeter tests run: | TRIK_PYTHONPATH_BUNDLE_DIR="$LIB_DIR"/python-runtime export TRIK_PYTHONPATH=.:"${TRIK_PYTHONPATH_BUNDLE_DIR}/base_library.zip:${TRIK_PYTHONPATH_BUNDLE_DIR}/lib-dynload:${TRIK_PYTHONPATH_BUNDLE_DIR}" TWOD_EXEC_NAME=$(ls -1d $BIN_DIR/2D-model* | head -n 1) - for i in $GITHUB_WORKSPACE/testing_small/*; do "$TWOD_EXEC_NAME" --generate-path "$i".py \ - -b -s 5 --direct-script-path "$i".py "$i" --platform minimal; done + for i in "$GITHUB_WORKSPACE"/testing_small/*; do "$TWOD_EXEC_NAME" --generate-path "$i".py \ + -b -s 5 --script-path "$i".py "$i" --platform minimal; done diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index baca363bf1..19561a1513 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -76,12 +76,12 @@ jobs: steps: - name: Install dependencies - run: apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git + run: apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git sudo if: startsWith(inputs.container_name, 'altlinux') == true - name: Install dependencies - run: yum update -y && yum install -y git-core + run: yum update -y && yum install -y git-core sudo if: startsWith(inputs.container_name, 'rocky') == true - name: Configure git diff --git a/buildScripts/github/build_installer.sh b/buildScripts/github/build_installer.sh index 6b359fea98..69eb2bcbab 100755 --- a/buildScripts/github/build_installer.sh +++ b/buildScripts/github/build_installer.sh @@ -8,7 +8,7 @@ case $RUNNER_OS in TSNAME="trik-studio-installer-mac-$BRANCH_NAME.dmg" ;; Linux) - QTIFWBIN=$(find /Qt/Tools -name "bin" | head -n 1) + QTIFWBIN=$(find "$HOME"/Qt/Tools -name "bin" | head -n 1) ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) TSNAME="trik-studio-installer-linux-$BRANCH_NAME-$ID.run" ;; diff --git a/buildScripts/github/install_installer_Linux.sh b/buildScripts/github/install_installer_Linux.sh index 066989f80d..10443f0d11 100755 --- a/buildScripts/github/install_installer_Linux.sh +++ b/buildScripts/github/install_installer_Linux.sh @@ -4,44 +4,47 @@ set -eux ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) if [ "$ID" = "altlinux" ]; then - apt-get update && apt-get install -y libxkbcommon-x11 libX11 fontconfig libxcbutil-icccm \ + sudo apt-get update && sudo apt-get install -y libxkbcommon-x11 libX11 fontconfig libxcbutil-icccm \ libxcbutil-image libdbus libxcbutil-keysyms libxcb-render-util elif [ "$ID" = "ubuntu" ]; then - sudo apt-get update && sudo apt-get install -y libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 \ + sudo apt-get update && sudo apt-get install -y --no-install-recommends libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 \ libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-sync1 libxcb-xfixes0 \ libxcb-shape0 libx11-xcb1 libfreetype6 libfontconfig1 libdbus-1-3 elif [ "$ID" = "arch" ]; then - pacman -Sy && pacman -S libxkbcommon-x11 xcb-util-wm xcb-util-image xcb-util-keysyms xcb-util-renderutil fontconfig libx11 --noconfirm + sudo pacman -Sy && sudo pacman -S libxkbcommon-x11 xcb-util-wm xcb-util-image xcb-util-keysyms xcb-util-renderutil fontconfig libx11 --noconfirm elif [[ "$ID" = "rocky" || "$ID" = '"rocky"' ]]; then - yum update -y && yum install -y libxkbcommon-x11 xcb-util-wm libX11 xcb-util-image \ + sudo yum update -y && sudo yum install -y libxkbcommon-x11 xcb-util-wm libX11 xcb-util-image \ dbus-libs xcb-util-keysyms xcb-util-renderutil fontconfig libX11-xcb fi INSTALLER_NAME="$INSTALLER_NAME.run" chmod +x "$INSTALLER_NAME" -./$INSTALLER_NAME --verbose --script trik_studio_installscript.qs --platform minimal --mco "$CONCURRENCY" +# Default value --- 0 +./"$INSTALLER_NAME" --verbose --script trik_studio_installscript.qs --platform minimal --mco "$CONCURRENCY" PREFIX=/opt if [ "$ID" = "ubuntu" ]; then - PREFIX=$HOME + PREFIX="$HOME" fi -BIN_DIR=$PREFIX/TRIKStudio/bin && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV -LIB_DIR=$PREFIX/TRIKStudio/lib && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV -APP_DIR=$PREFIX/TRIKStudio && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV +BIN_DIR="$PREFIX"/TRIKStudio/bin && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV +LIB_DIR="$PREFIX"/TRIKStudio/lib && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV +APP_DIR="$PREFIX"/TRIKStudio && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV +export QT_PLATFORM_QPA=minimal export LD_LIBRARY_PATH="$LIB_DIR" -"$BIN_DIR"/2D-model --version --platform minimal -"$APP_DIR"/maintenance --version --platform minimal -"$APP_DIR"/trik-studio --version --platform minimal +"$BIN_DIR"/2D-model --version +"$APP_DIR"/maintenance --version +"$APP_DIR"/trik-studio --version "$BIN_DIR"/patcher --version cd "$LIB_DIR" -ls *.so* | xargs ldd | grep -Ev "not found$" | grep so | sed -e '/^[^\t]/ d' | sed -e 's/\t//' \ +# Find dependencies that have not been packaged, but are still in the system +ls -- *.so* | xargs ldd | grep -Ev "not found$" | grep so | sed -e '/^[^\t]/ d' | sed -e 's/\t//' \ | sed -e 's/.*=..//' | sed -e 's/ (0.*)//' | grep -Ev "lib(c|dl|m|pthread|rt)\.so.*" \ | grep -Ev "$LD_LIBRARY_PATH" | grep -Ev "ld|linux-vdso" -ls *.so* | xargs ldd | grep "not found" || exit 0 +ls -- *.so* | xargs ldd | grep "not found" || exit 0 exit 1 diff --git a/buildScripts/github/install_installer_environment.sh b/buildScripts/github/install_installer_environment.sh index 771d696467..87a105cabd 100755 --- a/buildScripts/github/install_installer_environment.sh +++ b/buildScripts/github/install_installer_environment.sh @@ -6,24 +6,25 @@ GCC_VERSION=${GCC_VERSION:-13} TRIK_PYTHON="python3.${TRIK_PYTHON3_VERSION_MINOR}" TRIK_QT_VERSION=${TRIK_QT_VERSION:-5.15} -yum update -y && yum install -y epel-release -yum install --allowerasing -y sudo which libusbx-devel curl wget make gcc-toolset-"$GCC_VERSION"-{gcc-c++,libasan-devel,libubsan-devel,gdb} \ +sudo yum update -y && sudo yum install -y epel-release +sudo yum install --allowerasing -y sudo which libusbx-devel curl wget make gcc-toolset-"$GCC_VERSION"-{gcc-c++,libasan-devel,libubsan-devel,gdb} \ git-core ccache zlib-devel rsync "$TRIK_PYTHON"-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip xz time findutils -yum install -y pulseaudio-libs-glib2 qt5-qtbase-gui libwayland-{server,client,cursor} libxkbcommon-x11 +sudo yum install -y pulseaudio-libs-glib2 qt5-qtbase-gui libwayland-{server,client,cursor} libxkbcommon-x11 echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile +"$TRIK_PYTHON" -m venv venv +. ./venv/bin/activate "$TRIK_PYTHON" -m pip install -U pip "$TRIK_PYTHON" -m pip install aqtinstall -"$TRIK_PYTHON" -m aqt install-qt linux desktop "$TRIK_QT_VERSION" -O /Qt -m qtscript qtwaylandcompositor --archives qtbase qtmultimedia qtsvg qtscript \ +"$TRIK_PYTHON" -m aqt install-qt linux desktop "$TRIK_QT_VERSION" -O "$HOME"/Qt -m qtscript qtwaylandcompositor --archives qtbase qtmultimedia qtsvg qtscript \ qttools qtserialport qtimageformats icu qtwayland qtdeclarative #libQt5WaylandCompositor.so.5.15: libQt5Quick.so.5 libQt5Qml.so.5 libQt5QmlModels.so.5 -QT_ROOT_DIR=$(ls -1d /Qt/$TRIK_QT_VERSION*/gcc_64 | head -n 1) +QT_ROOT_DIR=$(ls -1d "$HOME"/Qt/$TRIK_QT_VERSION*/gcc_64 | head -n 1) echo "$QT_ROOT_DIR/bin" >> $GITHUB_PATH if [ "$BUILD_INSTALLER" = "true" ]; then - "$TRIK_PYTHON" -m pip install -U pip - "$TRIK_PYTHON" -m pip install aqtinstall - "$TRIK_PYTHON" -m aqt install-tool -O /Qt linux desktop tools_ifw + "$TRIK_PYTHON" -m aqt install-tool -O "$HOME"/Qt linux desktop tools_ifw fi +deactivate diff --git a/buildScripts/github/install_installer_macOS.sh b/buildScripts/github/install_installer_macOS.sh index 14ce26917b..da18720fb1 100755 --- a/buildScripts/github/install_installer_macOS.sh +++ b/buildScripts/github/install_installer_macOS.sh @@ -1,16 +1,16 @@ #!/bin/bash -set -euxo pipefail +set -eux sudo hdiutil attach "$INSTALLER_EXT_NAME" sudo cp -rf "/Volumes/$INSTALLER_NAME/$INSTALLER_NAME.app" $GITHUB_WORKSPACE sudo hdiutil detach /Volumes/"$INSTALLER_NAME" -./$INSTALLER_NAME.app/Contents/MacOS/$INSTALLER_NAME --verbose --script trik_studio_installscript.qs +./"$INSTALLER_NAME".app/Contents/MacOS/$INSTALLER_NAME --verbose --script trik_studio_installscript.qs BIN_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents/MacOS" && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV LIB_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents/Lib" && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV APP_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents/MacOS" && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV -sudo rm -rf $INSTALLER_NAME.app +sudo rm -rf "$INSTALLER_NAME".app ls "/Applications/TRIKStudio/TRIK Studio.app/Contents/MacOS" export DYLD_LIBRARY_PATH="$LIB_DIR" "$BIN_DIR"/2D-model --version From cfd667ee2600dc7aa2496a27307af4978b2b26ac Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Mon, 11 Nov 2024 11:44:03 +0300 Subject: [PATCH 32/40] Fix codefactor issue --- buildScripts/github/install_installer_macOS.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildScripts/github/install_installer_macOS.sh b/buildScripts/github/install_installer_macOS.sh index da18720fb1..3047a09db7 100755 --- a/buildScripts/github/install_installer_macOS.sh +++ b/buildScripts/github/install_installer_macOS.sh @@ -19,5 +19,5 @@ export DYLD_LIBRARY_PATH="$LIB_DIR" "$APP_DIR"/trik-studio --version cd "$LIB_DIR" -ls *.dylib | xargs otool -L | grep "not found" || exit 0 +ls -- *.dylib | xargs otool -L | grep "not found" || exit 0 exit 1 From 8646d6134745c08e92b903402f8eec689142aeb0 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Mon, 11 Nov 2024 12:34:31 +0300 Subject: [PATCH 33/40] Change environment variable QT_QPA_PLATFORM --- .github/workflows/installer.yml | 2 +- .github/workflows/setup_environment.yml | 2 +- buildScripts/github/install_installer_Linux.sh | 4 ++-- buildScripts/github/install_installer_environment.sh | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index 62d99cd911..f906f6d62b 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -33,7 +33,7 @@ jobs: if: startsWith(inputs.container_name, 'altlinux') == true - name: Install dependencies - run: yum install -y epel-release && yum update -y && yum install -y git-core findutils p7zip sudo + run: yum install -y epel-release && yum update -y && yum install -y --setopt=install_weak_deps=False git-core findutils p7zip sudo if: startsWith(inputs.container_name, 'rocky') == true - name: Install dependencies diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index 19561a1513..f7b87eeb60 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -81,7 +81,7 @@ jobs: - name: Install dependencies - run: yum update -y && yum install -y git-core sudo + run: yum update -y && yum install -y --setopt=install_weak_deps=False git-core sudo if: startsWith(inputs.container_name, 'rocky') == true - name: Configure git diff --git a/buildScripts/github/install_installer_Linux.sh b/buildScripts/github/install_installer_Linux.sh index 10443f0d11..4cf02739ea 100755 --- a/buildScripts/github/install_installer_Linux.sh +++ b/buildScripts/github/install_installer_Linux.sh @@ -13,7 +13,7 @@ elif [ "$ID" = "ubuntu" ]; then elif [ "$ID" = "arch" ]; then sudo pacman -Sy && sudo pacman -S libxkbcommon-x11 xcb-util-wm xcb-util-image xcb-util-keysyms xcb-util-renderutil fontconfig libx11 --noconfirm elif [[ "$ID" = "rocky" || "$ID" = '"rocky"' ]]; then - sudo yum update -y && sudo yum install -y libxkbcommon-x11 xcb-util-wm libX11 xcb-util-image \ + sudo yum update -y && sudo yum install -y --setopt=install_weak_deps=False libxkbcommon-x11 xcb-util-wm libX11 xcb-util-image \ dbus-libs xcb-util-keysyms xcb-util-renderutil fontconfig libX11-xcb fi @@ -32,7 +32,7 @@ BIN_DIR="$PREFIX"/TRIKStudio/bin && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV LIB_DIR="$PREFIX"/TRIKStudio/lib && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV APP_DIR="$PREFIX"/TRIKStudio && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV -export QT_PLATFORM_QPA=minimal +export QT_QPA_PLATFORM=minimal export LD_LIBRARY_PATH="$LIB_DIR" "$BIN_DIR"/2D-model --version "$APP_DIR"/maintenance --version diff --git a/buildScripts/github/install_installer_environment.sh b/buildScripts/github/install_installer_environment.sh index 87a105cabd..047fb1464e 100755 --- a/buildScripts/github/install_installer_environment.sh +++ b/buildScripts/github/install_installer_environment.sh @@ -7,9 +7,9 @@ TRIK_PYTHON="python3.${TRIK_PYTHON3_VERSION_MINOR}" TRIK_QT_VERSION=${TRIK_QT_VERSION:-5.15} sudo yum update -y && sudo yum install -y epel-release -sudo yum install --allowerasing -y sudo which libusbx-devel curl wget make gcc-toolset-"$GCC_VERSION"-{gcc-c++,libasan-devel,libubsan-devel,gdb} \ +sudo yum install --allowerasing -y --setopt=install_weak_deps=False sudo which libusbx-devel curl wget make gcc-toolset-"$GCC_VERSION"-{gcc-c++,libasan-devel,libubsan-devel,gdb} \ git-core ccache zlib-devel rsync "$TRIK_PYTHON"-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip xz time findutils -sudo yum install -y pulseaudio-libs-glib2 qt5-qtbase-gui libwayland-{server,client,cursor} libxkbcommon-x11 +sudo yum install -y --setopt=install_weak_deps=False pulseaudio-libs-glib2 qt5-qtbase-gui libwayland-{server,client,cursor} libxkbcommon-x11 echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile "$TRIK_PYTHON" -m venv venv From 22e03e4d2b6311acf9a4af506fac37fc35caf900 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Mon, 11 Nov 2024 14:11:00 +0300 Subject: [PATCH 34/40] Switch to ofscreen platform --- .github/workflows/installer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index f906f6d62b..b3c6ed18e5 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -88,7 +88,7 @@ jobs: run: | TWOD_EXEC_NAME=$(ls -1d "$BIN_DIR"/2D-model* | head -n 1) for i in "$GITHUB_WORKSPACE"/testing_small/*; do "$TWOD_EXEC_NAME" --generate-path "$i".js --generate-mode javascript \ - -b -s 5 --script-path "$i".js "$i" --platform minimal; done + -b -s 5 --script-path "$i".js "$i" --platform offscreen; done - name: Run minimal Python interpeter tests run: | @@ -96,4 +96,4 @@ jobs: export TRIK_PYTHONPATH=.:"${TRIK_PYTHONPATH_BUNDLE_DIR}/base_library.zip:${TRIK_PYTHONPATH_BUNDLE_DIR}/lib-dynload:${TRIK_PYTHONPATH_BUNDLE_DIR}" TWOD_EXEC_NAME=$(ls -1d $BIN_DIR/2D-model* | head -n 1) for i in "$GITHUB_WORKSPACE"/testing_small/*; do "$TWOD_EXEC_NAME" --generate-path "$i".py \ - -b -s 5 --script-path "$i".py "$i" --platform minimal; done + -b -s 5 --script-path "$i".py "$i" --platform offscreen; done From 66291308c53fee72debf6d8257b5ea293190d53b Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Mon, 11 Nov 2024 15:44:45 +0300 Subject: [PATCH 35/40] Execute only qrs files --- .github/workflows/installer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index b3c6ed18e5..dffb3ff42c 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -87,7 +87,7 @@ jobs: - name: Run minimal JavaScript interpeter tests run: | TWOD_EXEC_NAME=$(ls -1d "$BIN_DIR"/2D-model* | head -n 1) - for i in "$GITHUB_WORKSPACE"/testing_small/*; do "$TWOD_EXEC_NAME" --generate-path "$i".js --generate-mode javascript \ + for i in "$GITHUB_WORKSPACE"/testing_small/*.qrs; do "$TWOD_EXEC_NAME" --generate-path "$i".js --generate-mode javascript \ -b -s 5 --script-path "$i".js "$i" --platform offscreen; done - name: Run minimal Python interpeter tests @@ -95,5 +95,5 @@ jobs: TRIK_PYTHONPATH_BUNDLE_DIR="$LIB_DIR"/python-runtime export TRIK_PYTHONPATH=.:"${TRIK_PYTHONPATH_BUNDLE_DIR}/base_library.zip:${TRIK_PYTHONPATH_BUNDLE_DIR}/lib-dynload:${TRIK_PYTHONPATH_BUNDLE_DIR}" TWOD_EXEC_NAME=$(ls -1d $BIN_DIR/2D-model* | head -n 1) - for i in "$GITHUB_WORKSPACE"/testing_small/*; do "$TWOD_EXEC_NAME" --generate-path "$i".py \ + for i in "$GITHUB_WORKSPACE"/testing_small/*.qrs; do "$TWOD_EXEC_NAME" --generate-path "$i".py \ -b -s 5 --script-path "$i".py "$i" --platform offscreen; done From 1a1ff359fe1b0ef00a0b67603204e4bac30e5560 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Mon, 11 Nov 2024 16:26:04 +0300 Subject: [PATCH 36/40] Switch from altlinux container to alt --- .github/workflows/common_build.yml | 2 +- .github/workflows/installer.yml | 11 +++++++---- .github/workflows/setup_environment.yml | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/common_build.yml b/.github/workflows/common_build.yml index 6a03d332b5..29def7c485 100644 --- a/.github/workflows/common_build.yml +++ b/.github/workflows/common_build.yml @@ -110,7 +110,7 @@ jobs: uses: ./.github/workflows/setup_environment.yml with: os: ubuntu-latest - container_name: altlinux/base:latest + container_name: alt:latest build: true build_installer: false qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers" diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index dffb3ff42c..a271328e83 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -30,7 +30,7 @@ jobs: - name: Install dependencies run: apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git-core p7zip curl sudo - if: startsWith(inputs.container_name, 'altlinux') == true + if: startsWith(inputs.container_name, 'alt') == true - name: Install dependencies run: yum install -y epel-release && yum update -y && yum install -y --setopt=install_weak_deps=False git-core findutils p7zip sudo @@ -81,19 +81,22 @@ jobs: - name: Run minimal tests run: | + export QT_QPA_PLATFORM=minimal TWOD_EXEC_NAME=$(ls -1d "$BIN_DIR"/2D-model* | head -n 1) - for i in "$GITHUB_WORKSPACE"/testing_small/*; do "$TWOD_EXEC_NAME" -b -s 5 "$i" --platform minimal; done + for i in "$GITHUB_WORKSPACE"/testing_small/*; do "$TWOD_EXEC_NAME" -b -s 5 "$i"; done - name: Run minimal JavaScript interpeter tests run: | + export QT_QPA_PLATFORM=offscreen TWOD_EXEC_NAME=$(ls -1d "$BIN_DIR"/2D-model* | head -n 1) for i in "$GITHUB_WORKSPACE"/testing_small/*.qrs; do "$TWOD_EXEC_NAME" --generate-path "$i".js --generate-mode javascript \ - -b -s 5 --script-path "$i".js "$i" --platform offscreen; done + -b -s 5 --script-path "$i".js "$i"; done - name: Run minimal Python interpeter tests run: | + export QT_QPA_PLATFORM=offscreen TRIK_PYTHONPATH_BUNDLE_DIR="$LIB_DIR"/python-runtime export TRIK_PYTHONPATH=.:"${TRIK_PYTHONPATH_BUNDLE_DIR}/base_library.zip:${TRIK_PYTHONPATH_BUNDLE_DIR}/lib-dynload:${TRIK_PYTHONPATH_BUNDLE_DIR}" TWOD_EXEC_NAME=$(ls -1d $BIN_DIR/2D-model* | head -n 1) for i in "$GITHUB_WORKSPACE"/testing_small/*.qrs; do "$TWOD_EXEC_NAME" --generate-path "$i".py \ - -b -s 5 --script-path "$i".py "$i" --platform offscreen; done + -b -s 5 --script-path "$i".py "$i"; done diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index f7b87eeb60..001bc25e44 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -77,7 +77,7 @@ jobs: steps: - name: Install dependencies run: apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git sudo - if: startsWith(inputs.container_name, 'altlinux') == true + if: startsWith(inputs.container_name, 'alt') == true - name: Install dependencies From f40f681f754458d45013db251e52d9848468334f Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Mon, 11 Nov 2024 17:33:11 +0300 Subject: [PATCH 37/40] Allow execute sudo for root --- .github/workflows/installer.yml | 13 ++++++++++--- .github/workflows/setup_environment.yml | 4 +++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index a271328e83..210bb5e051 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -29,7 +29,9 @@ jobs: steps: - name: Install dependencies - run: apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git-core p7zip curl sudo + run: | + apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git-core p7zip curl sudo + sed -i 's/^# \(WHEEL_USERS.*\)/\1/' /etc/sudoers if: startsWith(inputs.container_name, 'alt') == true - name: Install dependencies @@ -87,14 +89,19 @@ jobs: - name: Run minimal JavaScript interpeter tests run: | - export QT_QPA_PLATFORM=offscreen + if [[ "$RUNNER_OS" == Linux ]]; then + export QT_QPA_PLATFORM=offscreen + fi + TWOD_EXEC_NAME=$(ls -1d "$BIN_DIR"/2D-model* | head -n 1) for i in "$GITHUB_WORKSPACE"/testing_small/*.qrs; do "$TWOD_EXEC_NAME" --generate-path "$i".js --generate-mode javascript \ -b -s 5 --script-path "$i".js "$i"; done - name: Run minimal Python interpeter tests run: | - export QT_QPA_PLATFORM=offscreen + if [[ "$RUNNER_OS" == Linux ]]; then + export QT_QPA_PLATFORM=offscreen + fi TRIK_PYTHONPATH_BUNDLE_DIR="$LIB_DIR"/python-runtime export TRIK_PYTHONPATH=.:"${TRIK_PYTHONPATH_BUNDLE_DIR}/base_library.zip:${TRIK_PYTHONPATH_BUNDLE_DIR}/lib-dynload:${TRIK_PYTHONPATH_BUNDLE_DIR}" TWOD_EXEC_NAME=$(ls -1d $BIN_DIR/2D-model* | head -n 1) diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index 001bc25e44..7282490bac 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -76,7 +76,9 @@ jobs: steps: - name: Install dependencies - run: apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git sudo + run: | + apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git sudo + sed -i 's/^# \(WHEEL_USERS.*\)/\1/' /etc/sudoers if: startsWith(inputs.container_name, 'alt') == true From af6b02b6c082cf2c2f7f3bd8d1010fd4eb7b0ed2 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Mon, 11 Nov 2024 18:17:05 +0300 Subject: [PATCH 38/40] Use offscreen only for Linux --- .github/workflows/installer.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index 210bb5e051..ffc48bae0e 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -89,6 +89,7 @@ jobs: - name: Run minimal JavaScript interpeter tests run: | + export QT_QPA_PLATFORM=minimal if [[ "$RUNNER_OS" == Linux ]]; then export QT_QPA_PLATFORM=offscreen fi @@ -99,6 +100,7 @@ jobs: - name: Run minimal Python interpeter tests run: | + export QT_QPA_PLATFORM=minimal if [[ "$RUNNER_OS" == Linux ]]; then export QT_QPA_PLATFORM=offscreen fi From 955164d85946c6768a8227945ecc4236b7c92466 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Mon, 11 Nov 2024 19:11:44 +0300 Subject: [PATCH 39/40] Temporary run only on Linux --- .github/workflows/installer.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index ffc48bae0e..d609870d7e 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -89,23 +89,18 @@ jobs: - name: Run minimal JavaScript interpeter tests run: | - export QT_QPA_PLATFORM=minimal - if [[ "$RUNNER_OS" == Linux ]]; then - export QT_QPA_PLATFORM=offscreen - fi - + export QT_QPA_PLATFORM=offscreen TWOD_EXEC_NAME=$(ls -1d "$BIN_DIR"/2D-model* | head -n 1) for i in "$GITHUB_WORKSPACE"/testing_small/*.qrs; do "$TWOD_EXEC_NAME" --generate-path "$i".js --generate-mode javascript \ -b -s 5 --script-path "$i".js "$i"; done - + if: startsWith(inputs.os, 'ubuntu') == true + - name: Run minimal Python interpeter tests run: | - export QT_QPA_PLATFORM=minimal - if [[ "$RUNNER_OS" == Linux ]]; then - export QT_QPA_PLATFORM=offscreen - fi + export QT_QPA_PLATFORM=offscreen TRIK_PYTHONPATH_BUNDLE_DIR="$LIB_DIR"/python-runtime export TRIK_PYTHONPATH=.:"${TRIK_PYTHONPATH_BUNDLE_DIR}/base_library.zip:${TRIK_PYTHONPATH_BUNDLE_DIR}/lib-dynload:${TRIK_PYTHONPATH_BUNDLE_DIR}" TWOD_EXEC_NAME=$(ls -1d $BIN_DIR/2D-model* | head -n 1) for i in "$GITHUB_WORKSPACE"/testing_small/*.qrs; do "$TWOD_EXEC_NAME" --generate-path "$i".py \ -b -s 5 --script-path "$i".py "$i"; done + if: startsWith(inputs.os, 'ubuntu') == true From cdd6315b9873dd2201e46440b192bb526783e416 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Mon, 11 Nov 2024 19:45:07 +0300 Subject: [PATCH 40/40] Switch to valid GHA syntax --- .github/workflows/installer.yml | 12 ++++++------ .github/workflows/setup_environment.yml | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index d609870d7e..04a47f98cd 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -32,19 +32,19 @@ jobs: run: | apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git-core p7zip curl sudo sed -i 's/^# \(WHEEL_USERS.*\)/\1/' /etc/sudoers - if: startsWith(inputs.container_name, 'alt') == true + if: startsWith(inputs.container_name, 'alt') - name: Install dependencies run: yum install -y epel-release && yum update -y && yum install -y --setopt=install_weak_deps=False git-core findutils p7zip sudo - if: startsWith(inputs.container_name, 'rocky') == true + if: startsWith(inputs.container_name, 'rocky') - name: Install dependencies run: pacman -Sy && pacman -S git p7zip sudo --noconfirm - if: startsWith(inputs.container_name, 'arch') == true + if: startsWith(inputs.container_name, 'arch') - name: Install dependencies run: HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install p7zip || brew upgrade p7zip - if: startsWith(inputs.os, 'mac') == true + if: startsWith(inputs.os, 'mac') - name: Checkout repository uses: actions/checkout@v4 @@ -93,7 +93,7 @@ jobs: TWOD_EXEC_NAME=$(ls -1d "$BIN_DIR"/2D-model* | head -n 1) for i in "$GITHUB_WORKSPACE"/testing_small/*.qrs; do "$TWOD_EXEC_NAME" --generate-path "$i".js --generate-mode javascript \ -b -s 5 --script-path "$i".js "$i"; done - if: startsWith(inputs.os, 'ubuntu') == true + if: startsWith(inputs.os, 'ubuntu') - name: Run minimal Python interpeter tests run: | @@ -103,4 +103,4 @@ jobs: TWOD_EXEC_NAME=$(ls -1d $BIN_DIR/2D-model* | head -n 1) for i in "$GITHUB_WORKSPACE"/testing_small/*.qrs; do "$TWOD_EXEC_NAME" --generate-path "$i".py \ -b -s 5 --script-path "$i".py "$i"; done - if: startsWith(inputs.os, 'ubuntu') == true + if: startsWith(inputs.os, 'ubuntu') diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index 7282490bac..2f3b3e1baf 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -79,12 +79,12 @@ jobs: run: | apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git sudo sed -i 's/^# \(WHEEL_USERS.*\)/\1/' /etc/sudoers - if: startsWith(inputs.container_name, 'alt') == true + if: startsWith(inputs.container_name, 'alt') - name: Install dependencies run: yum update -y && yum install -y --setopt=install_weak_deps=False git-core sudo - if: startsWith(inputs.container_name, 'rocky') == true + if: startsWith(inputs.container_name, 'rocky') - name: Configure git run: | @@ -106,7 +106,7 @@ jobs: XCODE_VERSION: ${{ inputs.xcode_version }} BUILD_INSTALLER: ${{ inputs.build_installer }} GCC_VERSION: ${{ inputs.gcc_version }} - if: ${{ inputs.build == true && inputs.linux_installer_environment != true }} + if: ${{ inputs.build && !inputs.linux_installer_environment }} - name: Set up installer environment run: buildScripts/github/install_installer_environment.sh @@ -115,13 +115,13 @@ jobs: TRIK_PYTHON3_VERSION_MINOR: ${{ inputs.trik_python3_version_minor }} GCC_VERSION: ${{ inputs.gcc_version }} BUILD_INSTALLER: ${{ inputs.build_installer }} - if: ${{ inputs.linux_installer_environment == true }} + if: ${{ inputs.linux_installer_environment }} - name: Lint run: | sudo apt-get update && sudo apt-get install -y --no-install-recommends qttools5-dev-tools qtbase5-dev vera++ ${{ inputs.executor }} buildScripts/github/vera_translation.sh - if: ${{ inputs.lint == true }} + if: ${{ inputs.lint }} - name: Restore cache uses: actions/cache@v4 @@ -132,7 +132,7 @@ jobs: ccache-c${{ inputs.container_name }}-${{ inputs.os }}-${{ inputs.config }}-${{ inputs.qmake_extra }} ccache-c${{ inputs.container_name }}-${{ inputs.os }}-${{ inputs.config }} ccache-c${{ inputs.container_name }}-${{ inputs.os }} - if: ${{ inputs.build == true }} + if: ${{ inputs.build }} - name: Build run: buildScripts/github/build.sh @@ -145,14 +145,14 @@ jobs: CONFIG: ${{ inputs.config }} EXECUTOR: ${{ inputs.executor }} QMAKE_EXTRA: ${{ inputs.qmake_extra }} - if: ${{ inputs.build == true }} + if: ${{ inputs.build }} - name: Save build cache uses: actions/cache/save@v4 with: path: ${{ github.workspace }}/.ccache/${{ inputs.os }}-c${{ inputs.container_name }}-${{ inputs.config }} key: ccache-c${{ inputs.container_name }}-${{ inputs.os }}-${{ inputs.config }}-${{ inputs.qmake_extra }}-${{ github.sha }} - if: ${{ inputs.build == true }} + if: ${{ inputs.build }} - name: Run tests run: ${{ inputs.executor }} buildScripts/github/run_tests.sh && ${{ inputs.executor }} buildScripts/github/test.sh @@ -176,7 +176,7 @@ jobs: ssh_key: ${{ secrets.DL_PRIVATE_SSH_KEY }} username: ${{ secrets.DL_USERNAME }} host: ${{ secrets.DL_HOST }} - if: ${{ inputs.build_installer == true }} + if: ${{ inputs.build_installer }} - name: Upload installer artifact uses: actions/upload-artifact@v4 @@ -187,4 +187,4 @@ jobs: installer/*.run installer/*.dmg installer/*.qs - if: ${{ inputs.build_installer == true }} + if: ${{ inputs.build_installer }}