diff --git a/.github/workflows/common_build.yml b/.github/workflows/common_build.yml new file mode 100644 index 0000000000..29def7c485 --- /dev/null +++ b/.github/workflows/common_build.yml @@ -0,0 +1,204 @@ +name: Common 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-13 + 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-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-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 + with: + os: ubuntu-latest + build: true + 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 + with: + os: ubuntu-latest + container_name: alt:latest + build: true + 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: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} + 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 + # (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:8 + 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 + trik_python3_version_minor: 11 + linux_installer_environment: true + shell: bash -l {0} + + build-rockylinux-installer: + needs: [build-rockylinux-installer-release-tests] + uses: ./.github/workflows/setup_environment.yml + with: + os: ubuntu-latest + container_name: rockylinux:8 + build: true + build_installer: true + tests: true + 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: alt: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..04a47f98cd --- /dev/null +++ b/.github/workflows/installer.yml @@ -0,0 +1,106 @@ +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-core p7zip curl sudo + sed -i 's/^# \(WHEEL_USERS.*\)/\1/' /etc/sudoers + 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') + + - name: Install dependencies + run: pacman -Sy && pacman -S git p7zip sudo --noconfirm + 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') + + - 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: | + 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"; 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"; done + if: startsWith(inputs.os, 'ubuntu') + + - 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"; done + if: startsWith(inputs.os, 'ubuntu') diff --git a/.github/workflows/linux_build.yml b/.github/workflows/linux_build.yml deleted file mode 100644 index 8622d86fc8..0000000000 --- a/.github/workflows/linux_build.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: ubuntu 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-ubuntu-release-tests: - needs: lint - uses: ./.github/workflows/setup_environment.yml - with: - os: ubuntu-latest - build: true - build_installer: false - qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent" - - build-altlinux-release-tests: - needs: lint - uses: ./.github/workflows/setup_environment.yml - with: - os: ubuntu-latest - container_name: "altlinux/base:latest" - build: true - build_installer: false - qmake_extra: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent" - tests: true - executor: time - - 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+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address" - - 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 CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off" - tests: true - secrets: inherit diff --git a/.github/workflows/macos_build.yml b/.github/workflows/macos_build.yml deleted file mode 100644 index af00d54cf6..0000000000 --- a/.github/workflows/macos_build.yml +++ /dev/null @@ -1,82 +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 - 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" - - 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" - - 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" - tests: true - secrets: inherit 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/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index ffa1b8a40e..2f3b3e1baf 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -9,37 +9,41 @@ on: executor: required: false type: string - default: "time docker exec -i builder" + default: "time" lint: required: false - type: string - default: 'false' + type: boolean + default: false build: required: true - type: string + type: boolean build_installer: required: true - type: string - trik-qt-version: + type: boolean + linux_installer_environment: + required: false + type: boolean + default: false + 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: + default: 4.6.1 + xcode_version: required: false type: string - default: '13.4' + default: 14.3 config: required: false type: string - default: 'release' + default: release qmake_extra: required: false type: string @@ -52,25 +56,36 @@ on: required: false type: string default: "" + gcc_version: + required: false + type: string + default: 13 + shell: + required: false + type: string + default: bash jobs: - job: + build: defaults: run: - shell: bash + shell: ${{ inputs.shell }} 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 + 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') + + - name: Install dependencies + run: yum update -y && yum install -y --setopt=install_weak_deps=False git-core sudo + if: startsWith(inputs.container_name, 'rocky') + - name: Configure git run: | git config --global core.symlinks true @@ -80,19 +95,33 @@ 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 && !inputs.linux_installer_environment }} + - 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 }} + BUILD_INSTALLER: ${{ inputs.build_installer }} + if: ${{ inputs.linux_installer_environment }} + - name: Lint - run: ${{ inputs.executor }} buildScripts/github/vera_translation.sh - if: ${{ inputs.lint == 'true' }} + 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 }} - name: Restore cache uses: actions/cache@v4 @@ -103,62 +132,59 @@ 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 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 }} 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 + 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' }} - + 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 }} 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 with: - name: ${{ runner.os }}-installer + name: ${{ inputs.os }}-installer path: | installer/*.exe installer/*.run installer/*.dmg - if: ${{ inputs.build_installer == 'true' }} + installer/*.qs + if: ${{ inputs.build_installer }} 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 || : 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..69eb2bcbab 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 "$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" ;; *) 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/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 d35b7b4032..8fbfd4cae5 100755 --- a/buildScripts/github/install_Linux.sh +++ b/buildScripts/github/install_Linux.sh @@ -2,13 +2,23 @@ set -euxo pipefail ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) +GCC_VERSION=${GCC_VERSION:-13} 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 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 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 \ + 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 100755 index 0000000000..4cf02739ea --- /dev/null +++ b/buildScripts/github/install_installer_Linux.sh @@ -0,0 +1,50 @@ +#!/bin/bash +set -eux + +ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) + +if [ "$ID" = "altlinux" ]; then + 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 --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 + 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 --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 + +INSTALLER_NAME="$INSTALLER_NAME.run" +chmod +x "$INSTALLER_NAME" + +# Default value --- 0 +./"$INSTALLER_NAME" --verbose --script trik_studio_installscript.qs --platform minimal --mco "$CONCURRENCY" + +PREFIX=/opt +if [ "$ID" = "ubuntu" ]; then + 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 QT_QPA_PLATFORM=minimal +export LD_LIBRARY_PATH="$LIB_DIR" +"$BIN_DIR"/2D-model --version +"$APP_DIR"/maintenance --version +"$APP_DIR"/trik-studio --version +"$BIN_DIR"/patcher --version + +cd "$LIB_DIR" + +# 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 +exit 1 diff --git a/buildScripts/github/install_installer_environment.sh b/buildScripts/github/install_installer_environment.sh new file mode 100755 index 0000000000..047fb1464e --- /dev/null +++ b/buildScripts/github/install_installer_environment.sh @@ -0,0 +1,30 @@ +#!/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} + +sudo yum update -y && sudo yum install -y epel-release +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 --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 +. ./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 "$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 "$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 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 new file mode 100755 index 0000000000..3047a09db7 --- /dev/null +++ b/buildScripts/github/install_installer_macOS.sh @@ -0,0 +1,23 @@ +#!/bin/bash +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 + +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 +ls "/Applications/TRIKStudio/TRIK Studio.app/Contents/MacOS" +export DYLD_LIBRARY_PATH="$LIB_DIR" +"$BIN_DIR"/2D-model --version +"$BIN_DIR"/patcher --version +/Applications/TRIKStudio/maintenance.app/Contents/MacOS/maintenance --version +"$APP_DIR"/trik-studio --version + +cd "$LIB_DIR" +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/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..b53380d3f4 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 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} \ TRIK_PYTHONPATH=${TRIK_PYTHONPATH:-$(python3.${TRIK_PYTHON3_VERSION_MINOR} -c 'import sys; import os; print(os.pathsep.join(sys.path))')} \ 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..250f6e0ec6 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 = " --script " + 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]); 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 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