From aacd5dd33d718972497835a1b739defdd07611b5 Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Wed, 16 Sep 2020 19:57:25 +0200 Subject: [PATCH 01/71] Whitespace cleanup --- .github/workflows/ci.yml | 52 ++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9566f287e..83883e23a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: CMake on: push: - branches: + branches: - master env: @@ -12,7 +12,7 @@ env: jobs: build: # The CMake configure and build commands are platform agnostic and should work equally - # well on Windows or Mac. You can convert this to a matrix build if you need + # well on Windows or Mac. You can convert this to a matrix build if you need # cross-platform coverage. # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix runs-on: windows-latest @@ -24,49 +24,49 @@ jobs: - name: Set package name shell: bash run: echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-Windows-x86_64)" - + - uses: actions/checkout@v2 - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands run: cmake -E make_directory ${{runner.workspace}}/build - + - name: Enable Developer Command Prompt uses: ilammy/msvc-dev-cmd@v1.3.0 - + - name: Acquire Qt uses: jurplel/install-qt-action@v2.8.0 with: version: 5.15.1 - + - name: Acquire FFmpeg run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/ffmpeg-win.7z && 7z x ffmpeg-win.7z - + - name: Acquire OpenColorIO run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/ocio-win.7z && 7z x ocio-win.7z - + - name: Acquire OpenEXR run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/openexr-win.7z && 7z x openexr-win.7z - + - name: Acquire OpenImageIO run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/oiio-win.7z && 7z x oiio-win.7z - + - name: Acquire libpng run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/libpng-win.7z && 7z x libpng-win.7z - + - name: Acquire libtiff run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/libtiff-win.7z && 7z x libtiff-win.7z - + - name: Acquire turbojpeg run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/turbojpeg-win.7z && 7z x turbojpeg-win.7z - + - name: Acquire zlib run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/zlib-win.7z && 7z x zlib-win.7z - + - name: Acquire Boost run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/boost-win.7z && 7z x boost-win.7z - + - name: Acquire Crashpad run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/crashpad-win.7z && 7z x crashpad-win.7z @@ -75,21 +75,21 @@ jobs: # access regardless of the host operating system shell: bash working-directory: ${{runner.workspace}}/build - # Note the current convention is to use the -S and -B options here to specify source - # and build directories, but this is only available with CMake 3.13 and higher. + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: PATH=$GITHUB_WORKSPACE:$PATH cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -G "Ninja" - name: Build working-directory: ${{runner.workspace}}/build shell: bash - # Execute the build. You can specify a specific target with "--target " + # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config $BUILD_TYPE - name: Test working-directory: ${{runner.workspace}}/build shell: bash - # Execute tests defined by the CMake configuration. + # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest -C $BUILD_TYPE @@ -97,44 +97,44 @@ jobs: working-directory: ${{runner.workspace}}/build shell: cmd run: mkdir olive-editor && copy app\olive-editor.exe olive-editor && copy app\olive-editor.pdb olive-editor && windeployqt olive-editor\olive-editor.exe && copy %GITHUB_WORKSPACE%\bin\*.dll olive-editor && copy %GITHUB_WORKSPACE%\out\Default\crashpad_handler.exe olive-editor - + - name: Deploy Installer working-directory: ${{runner.workspace}}/build shell: cmd run: copy %GITHUB_WORKSPACE%\app\packaging\windows\nsis\* . && copy %GITHUB_WORKSPACE%\LICENSE . && "C:/Program Files (x86)/NSIS/makensis.exe" -V4 -DX64 "-XOutFile %PKGNAME%.exe" olive.nsi - + - name: Deploy Portable working-directory: ${{runner.workspace}}/build shell: cmd run: type NUL > olive-editor\portable && 7z a %PKGNAME%.zip olive-editor - + - name: Export Crashpad Symbols and Upload To Server working-directory: ${{runner.workspace}}/build shell: cmd env: GH_AUTH_KEY: ${{secrets.GH_AUTH_KEY}} run: curl -fLSs --retry 3 https://github.com/google/breakpad/blob/master/src/tools/windows/binaries/dump_syms.exe?raw=true > dump_syms.exe && dump_syms app\olive-editor.pdb > olive-editor.sym && curl -X POST -F symfile=@olive-editor.sym -F key="%GH_AUTH_KEY%" https://olivevideoeditor.org/crashpad/symbols.php - + - name: Upload Installer to Nightly Page shell: bash working-directory: ${{runner.workspace}}/build env: GH_AUTH_KEY: ${{secrets.GH_AUTH_KEY}} run: curl -X POST -F file=@$PKGNAME.exe -F key="$GH_AUTH_KEY" -F hash="$GITHUB_SHA" -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" https://olivevideoeditor.org/dl/push.php - + - name: Upload Portable to Nightly Page shell: bash working-directory: ${{runner.workspace}}/build env: GH_AUTH_KEY: ${{secrets.GH_AUTH_KEY}} run: curl -X POST -F file=@$PKGNAME.zip -F key="$GH_AUTH_KEY" -F hash="$GITHUB_SHA" -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" https://olivevideoeditor.org/dl/push.php - + - name: Upload Installer Artifact uses: actions/upload-artifact@v2 with: name: ${{env.PKGNAME}}.exe path: ${{runner.workspace}}/build/${{env.PKGNAME}}.exe - + - name: Upload Portable Artifact uses: actions/upload-artifact@v2 with: From c07cc9c2daee2ab9773ab509f5a8e9da35fbd7f5 Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Wed, 16 Sep 2020 20:01:37 +0200 Subject: [PATCH 02/71] Formatting --- .github/workflows/ci.yml | 94 +++++++++++++++++++++++++++++++--------- 1 file changed, 73 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83883e23a..040e800ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,14 +23,16 @@ jobs: steps: - name: Set package name shell: bash - run: echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-Windows-x86_64)" + run: | + echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-Windows-x86_64)" - uses: actions/checkout@v2 - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: | + cmake -E make_directory ${{runner.workspace}}/build - name: Enable Developer Command Prompt uses: ilammy/msvc-dev-cmd@v1.3.0 @@ -41,34 +43,54 @@ jobs: version: 5.15.1 - name: Acquire FFmpeg - run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/ffmpeg-win.7z && 7z x ffmpeg-win.7z + run: | + curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/ffmpeg-win.7z + 7z x ffmpeg-win.7z - name: Acquire OpenColorIO - run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/ocio-win.7z && 7z x ocio-win.7z + run: | + curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/ocio-win.7z + 7z x ocio-win.7z - name: Acquire OpenEXR - run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/openexr-win.7z && 7z x openexr-win.7z + run: | + curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/openexr-win.7z + 7z x openexr-win.7z - name: Acquire OpenImageIO - run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/oiio-win.7z && 7z x oiio-win.7z + run: | + curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/oiio-win.7z + 7z x oiio-win.7z - name: Acquire libpng - run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/libpng-win.7z && 7z x libpng-win.7z + run: | + curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/libpng-win.7z + 7z x libpng-win.7z - name: Acquire libtiff - run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/libtiff-win.7z && 7z x libtiff-win.7z + run: | + curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/libtiff-win.7z + 7z x libtiff-win.7z - name: Acquire turbojpeg - run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/turbojpeg-win.7z && 7z x turbojpeg-win.7z + run: | + curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/turbojpeg-win.7z + 7z x turbojpeg-win.7z - name: Acquire zlib - run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/zlib-win.7z && 7z x zlib-win.7z + run: | + curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/zlib-win.7z + 7z x zlib-win.7z - name: Acquire Boost - run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/boost-win.7z && 7z x boost-win.7z + run: | + curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/boost-win.7z + 7z x boost-win.7z - name: Acquire Crashpad - run: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/crashpad-win.7z && 7z x crashpad-win.7z + run: | + curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/crashpad-win.7z + 7z x crashpad-win.7z - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable @@ -78,56 +100,86 @@ jobs: # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 - run: PATH=$GITHUB_WORKSPACE:$PATH cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -G "Ninja" + run: | + PATH=$GITHUB_WORKSPACE:$PATH \ + cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -G "Ninja" - name: Build working-directory: ${{runner.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " - run: cmake --build . --config $BUILD_TYPE + run: | + cmake --build . --config $BUILD_TYPE - name: Test working-directory: ${{runner.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C $BUILD_TYPE + run: | + ctest -C $BUILD_TYPE - name: Create Package working-directory: ${{runner.workspace}}/build shell: cmd - run: mkdir olive-editor && copy app\olive-editor.exe olive-editor && copy app\olive-editor.pdb olive-editor && windeployqt olive-editor\olive-editor.exe && copy %GITHUB_WORKSPACE%\bin\*.dll olive-editor && copy %GITHUB_WORKSPACE%\out\Default\crashpad_handler.exe olive-editor + run: | + mkdir olive-editor + copy app\olive-editor.exe olive-editor + copy app\olive-editor.pdb olive-editor + windeployqt olive-editor\olive-editor.exe + copy %GITHUB_WORKSPACE%\bin\*.dll olive-editor + copy %GITHUB_WORKSPACE%\out\Default\crashpad_handler.exe olive-editor - name: Deploy Installer working-directory: ${{runner.workspace}}/build shell: cmd - run: copy %GITHUB_WORKSPACE%\app\packaging\windows\nsis\* . && copy %GITHUB_WORKSPACE%\LICENSE . && "C:/Program Files (x86)/NSIS/makensis.exe" -V4 -DX64 "-XOutFile %PKGNAME%.exe" olive.nsi + run: | + copy %GITHUB_WORKSPACE%\app\packaging\windows\nsis\* . + copy %GITHUB_WORKSPACE%\LICENSE . + "C:/Program Files (x86)/NSIS/makensis.exe" -V4 -DX64 "-XOutFile %PKGNAME%.exe" olive.nsi - name: Deploy Portable working-directory: ${{runner.workspace}}/build shell: cmd - run: type NUL > olive-editor\portable && 7z a %PKGNAME%.zip olive-editor + run: | + type NUL > olive-editor\portable + 7z a %PKGNAME%.zip olive-editor - name: Export Crashpad Symbols and Upload To Server working-directory: ${{runner.workspace}}/build shell: cmd env: GH_AUTH_KEY: ${{secrets.GH_AUTH_KEY}} - run: curl -fLSs --retry 3 https://github.com/google/breakpad/blob/master/src/tools/windows/binaries/dump_syms.exe?raw=true > dump_syms.exe && dump_syms app\olive-editor.pdb > olive-editor.sym && curl -X POST -F symfile=@olive-editor.sym -F key="%GH_AUTH_KEY%" https://olivevideoeditor.org/crashpad/symbols.php + run: | + curl -fLSs --retry 3 https://github.com/google/breakpad/blob/master/src/tools/windows/binaries/dump_syms.exe?raw=true > dump_syms.exe + dump_syms app\olive-editor.pdb > olive-editor.sym + curl -X POST -F symfile=@olive-editor.sym -F key="%GH_AUTH_KEY%" https://olivevideoeditor.org/crashpad/symbols.php - name: Upload Installer to Nightly Page shell: bash working-directory: ${{runner.workspace}}/build env: GH_AUTH_KEY: ${{secrets.GH_AUTH_KEY}} - run: curl -X POST -F file=@$PKGNAME.exe -F key="$GH_AUTH_KEY" -F hash="$GITHUB_SHA" -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" https://olivevideoeditor.org/dl/push.php + run: | + curl -X POST -F file=@$PKGNAME.exe \ + -F key="$GH_AUTH_KEY" \ + -F hash="$GITHUB_SHA" \ + -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ + -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ + https://olivevideoeditor.org/dl/push.php - name: Upload Portable to Nightly Page shell: bash working-directory: ${{runner.workspace}}/build env: GH_AUTH_KEY: ${{secrets.GH_AUTH_KEY}} - run: curl -X POST -F file=@$PKGNAME.zip -F key="$GH_AUTH_KEY" -F hash="$GITHUB_SHA" -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" https://olivevideoeditor.org/dl/push.php + run: | + curl -X POST -F file=@$PKGNAME.zip \ + -F key="$GH_AUTH_KEY" \ + -F hash="$GITHUB_SHA" \ + -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ + -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ + https://olivevideoeditor.org/dl/push.php - name: Upload Installer Artifact uses: actions/upload-artifact@v2 From b7ba48709c47ff772f91bec9e033eeaaa545f257 Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Thu, 17 Sep 2020 00:05:15 +0200 Subject: [PATCH 03/71] Rename workflow to CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 040e800ac..2c2506965 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: CMake +name: CI on: push: From 598e1d0fbb53061e50c95cb8ff0626a8c784f5a4 Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Thu, 17 Sep 2020 00:07:51 +0200 Subject: [PATCH 04/71] Formatting --- .github/workflows/ci.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c2506965..ce45a5ef5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands run: | - cmake -E make_directory ${{runner.workspace}}/build + cmake -E make_directory ${{ runner.workspace }}/build - name: Enable Developer Command Prompt uses: ilammy/msvc-dev-cmd@v1.3.0 @@ -96,7 +96,7 @@ jobs: # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{ runner.workspace }}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 @@ -105,14 +105,14 @@ jobs: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -G "Ninja" - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{ runner.workspace }}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --config $BUILD_TYPE - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{ runner.workspace }}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -120,7 +120,7 @@ jobs: ctest -C $BUILD_TYPE - name: Create Package - working-directory: ${{runner.workspace}}/build + working-directory: ${{ runner.workspace }}/build shell: cmd run: | mkdir olive-editor @@ -131,7 +131,7 @@ jobs: copy %GITHUB_WORKSPACE%\out\Default\crashpad_handler.exe olive-editor - name: Deploy Installer - working-directory: ${{runner.workspace}}/build + working-directory: ${{ runner.workspace }}/build shell: cmd run: | copy %GITHUB_WORKSPACE%\app\packaging\windows\nsis\* . @@ -139,17 +139,17 @@ jobs: "C:/Program Files (x86)/NSIS/makensis.exe" -V4 -DX64 "-XOutFile %PKGNAME%.exe" olive.nsi - name: Deploy Portable - working-directory: ${{runner.workspace}}/build + working-directory: ${{ runner.workspace }}/build shell: cmd run: | type NUL > olive-editor\portable 7z a %PKGNAME%.zip olive-editor - name: Export Crashpad Symbols and Upload To Server - working-directory: ${{runner.workspace}}/build + working-directory: ${{ runner.workspace }}/build shell: cmd env: - GH_AUTH_KEY: ${{secrets.GH_AUTH_KEY}} + GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} run: | curl -fLSs --retry 3 https://github.com/google/breakpad/blob/master/src/tools/windows/binaries/dump_syms.exe?raw=true > dump_syms.exe dump_syms app\olive-editor.pdb > olive-editor.sym @@ -157,9 +157,9 @@ jobs: - name: Upload Installer to Nightly Page shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{ runner.workspace }}/build env: - GH_AUTH_KEY: ${{secrets.GH_AUTH_KEY}} + GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} run: | curl -X POST -F file=@$PKGNAME.exe \ -F key="$GH_AUTH_KEY" \ @@ -170,9 +170,9 @@ jobs: - name: Upload Portable to Nightly Page shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{ runner.workspace }}/build env: - GH_AUTH_KEY: ${{secrets.GH_AUTH_KEY}} + GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} run: | curl -X POST -F file=@$PKGNAME.zip \ -F key="$GH_AUTH_KEY" \ @@ -184,11 +184,11 @@ jobs: - name: Upload Installer Artifact uses: actions/upload-artifact@v2 with: - name: ${{env.PKGNAME}}.exe - path: ${{runner.workspace}}/build/${{env.PKGNAME}}.exe + name: ${{ env.PKGNAME }}.exe + path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.exe - name: Upload Portable Artifact uses: actions/upload-artifact@v2 with: - name: ${{env.PKGNAME}}.zip - path: ${{runner.workspace}}/build/${{env.PKGNAME}}.zip + name: ${{ env.PKGNAME }}.zip + path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.zip From 711a3b4df324653c09673d99bee0fcfd1dcf1062 Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Thu, 17 Sep 2020 00:10:39 +0200 Subject: [PATCH 05/71] Remove unused and broken code --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce45a5ef5..d2b58866d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,9 +17,6 @@ jobs: # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix runs-on: windows-latest - env: - PKGNAME: Olive-${GITHUB_SHA:8}-Windows-x86_64 - steps: - name: Set package name shell: bash From d62e5a526748eec36e0ddbe36bccbe461946892a Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Thu, 17 Sep 2020 00:10:53 +0200 Subject: [PATCH 06/71] Add build matrix --- .github/workflows/ci.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2b58866d..09789a18f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,16 +5,20 @@ on: branches: - master -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: RelWithDebInfo - jobs: - build: - # The CMake configure and build commands are platform agnostic and should work equally - # well on Windows or Mac. You can convert this to a matrix build if you need - # cross-platform coverage. - # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix + windows: + strategy: + matrix: + build: [1] + include: + - build: 1 + build-type: RelWithDebInfo + compiler-name: MSVC 16.x + os-name: Windows + name: | + ${{ matrix.os-name }} + <${{ matrix.compiler-name }}, + ${{ matrix.build-type }}> runs-on: windows-latest steps: @@ -99,14 +103,14 @@ jobs: # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: | PATH=$GITHUB_WORKSPACE:$PATH \ - cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -G "Ninja" + cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -G "Ninja" - name: Build working-directory: ${{ runner.workspace }}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | - cmake --build . --config $BUILD_TYPE + cmake --build . --config ${{ matrix.build-type }} - name: Test working-directory: ${{ runner.workspace }}/build @@ -114,7 +118,7 @@ jobs: # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: | - ctest -C $BUILD_TYPE + ctest -C ${{ matrix.build-type }} - name: Create Package working-directory: ${{ runner.workspace }}/build From 621e500190ead16bea2ffb7b74a095c676115571 Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Thu, 17 Sep 2020 00:49:31 +0200 Subject: [PATCH 07/71] Formatting --- .github/workflows/ci.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09789a18f..929094a76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -154,7 +154,10 @@ jobs: run: | curl -fLSs --retry 3 https://github.com/google/breakpad/blob/master/src/tools/windows/binaries/dump_syms.exe?raw=true > dump_syms.exe dump_syms app\olive-editor.pdb > olive-editor.sym - curl -X POST -F symfile=@olive-editor.sym -F key="%GH_AUTH_KEY%" https://olivevideoeditor.org/crashpad/symbols.php + curl -X POST \ + -F symfile=@olive-editor.sym \ + -F key="%GH_AUTH_KEY%" \ + https://olivevideoeditor.org/crashpad/symbols.php - name: Upload Installer to Nightly Page shell: bash @@ -162,7 +165,8 @@ jobs: env: GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} run: | - curl -X POST -F file=@$PKGNAME.exe \ + curl -X POST \ + -F file=@$PKGNAME.exe \ -F key="$GH_AUTH_KEY" \ -F hash="$GITHUB_SHA" \ -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ @@ -175,7 +179,8 @@ jobs: env: GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} run: | - curl -X POST -F file=@$PKGNAME.zip \ + curl -X POST \ + -F file=@$PKGNAME.zip \ -F key="$GH_AUTH_KEY" \ -F hash="$GITHUB_SHA" \ -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ From e3d49e78b0389647800e4e17129edf9644c642ed Mon Sep 17 00:00:00 2001 From: Simran Date: Thu, 17 Sep 2020 01:04:59 +0200 Subject: [PATCH 08/71] Build on PRs against master But don't upload to nightly page (to be tested) --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 929094a76..c3b2fc8ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,9 @@ on: push: branches: - master + pull_request: + branches: + - master jobs: windows: @@ -172,6 +175,7 @@ jobs: -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ https://olivevideoeditor.org/dl/push.php + if: github.event_name != 'pull_request' - name: Upload Portable to Nightly Page shell: bash @@ -186,6 +190,7 @@ jobs: -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ https://olivevideoeditor.org/dl/push.php + if: github.event_name != 'pull_request' - name: Upload Installer Artifact uses: actions/upload-artifact@v2 From ad6b94e40623b4aecc64351a17918f6f72a1cbbe Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Thu, 17 Sep 2020 12:45:42 +0200 Subject: [PATCH 09/71] Remove pull_request trigger until better understood --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3b2fc8ff..b60641d31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,9 +4,6 @@ on: push: branches: - master - pull_request: - branches: - - master jobs: windows: From c668caf66ee740d2367a598c2972b6ae413cac50 Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Thu, 17 Sep 2020 12:46:50 +0200 Subject: [PATCH 10/71] Fix new line escaping for cmd --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b60641d31..19e7c9d77 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -154,9 +154,9 @@ jobs: run: | curl -fLSs --retry 3 https://github.com/google/breakpad/blob/master/src/tools/windows/binaries/dump_syms.exe?raw=true > dump_syms.exe dump_syms app\olive-editor.pdb > olive-editor.sym - curl -X POST \ - -F symfile=@olive-editor.sym \ - -F key="%GH_AUTH_KEY%" \ + curl -X POST ^ + -F symfile=@olive-editor.sym ^ + -F key="%GH_AUTH_KEY%" ^ https://olivevideoeditor.org/crashpad/symbols.php - name: Upload Installer to Nightly Page From a9242f0235b9b6e9f2105ddece93d05282eda2b4 Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Fri, 18 Sep 2020 00:07:44 +0200 Subject: [PATCH 11/71] We use Ninja single config --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19e7c9d77..105a4c4fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,7 +110,7 @@ jobs: shell: bash # Execute the build. You can specify a specific target with "--target " run: | - cmake --build . --config ${{ matrix.build-type }} + cmake --build . - name: Test working-directory: ${{ runner.workspace }}/build From e1baa154b47c0a86102d39645054c1d801d9c82e Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Fri, 18 Sep 2020 00:08:43 +0200 Subject: [PATCH 12/71] makensis seems to be in PATH in GitHub env --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 105a4c4fa..d3fda4bab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,7 +137,7 @@ jobs: run: | copy %GITHUB_WORKSPACE%\app\packaging\windows\nsis\* . copy %GITHUB_WORKSPACE%\LICENSE . - "C:/Program Files (x86)/NSIS/makensis.exe" -V4 -DX64 "-XOutFile %PKGNAME%.exe" olive.nsi + makensis -V4 -DX64 "-XOutFile %PKGNAME%.exe" olive.nsi - name: Deploy Portable working-directory: ${{ runner.workspace }}/build From e733d1c278aa4a644bb0a6ae6fe03735a9cfc409 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 18 Sep 2020 12:26:30 +1000 Subject: [PATCH 13/71] github: clarify what "commit hash" means in all templates --- .github/ISSUE_TEMPLATE/01-crash_issue.md | 2 +- .github/ISSUE_TEMPLATE/50-build_issue.md | 2 +- .github/ISSUE_TEMPLATE/50-cache_issue.md | 2 +- .github/ISSUE_TEMPLATE/50-codec_issue.md | 2 +- .github/ISSUE_TEMPLATE/50-color_issue.md | 2 +- .github/ISSUE_TEMPLATE/50-editing_issue.md | 2 +- .github/ISSUE_TEMPLATE/50-export_issue.md | 2 +- .github/ISSUE_TEMPLATE/50-node_issue.md | 2 +- .github/ISSUE_TEMPLATE/50-playback_issue.md | 2 +- .github/ISSUE_TEMPLATE/50-project_issue.md | 2 +- .github/ISSUE_TEMPLATE/50-renderer_issue.md | 2 +- .github/ISSUE_TEMPLATE/50-ui_issue.md | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/01-crash_issue.md b/.github/ISSUE_TEMPLATE/01-crash_issue.md index c05544838..0b68b7202 100644 --- a/.github/ISSUE_TEMPLATE/01-crash_issue.md +++ b/.github/ISSUE_TEMPLATE/01-crash_issue.md @@ -6,7 +6,7 @@ labels: "Crash, Triage" assignees: '' --- -**Commit Hash** +**Commit Hash (8 character string of letters/numbers in title bar)** **Platform** diff --git a/.github/ISSUE_TEMPLATE/50-build_issue.md b/.github/ISSUE_TEMPLATE/50-build_issue.md index f14b6c914..8d93ad06d 100644 --- a/.github/ISSUE_TEMPLATE/50-build_issue.md +++ b/.github/ISSUE_TEMPLATE/50-build_issue.md @@ -6,7 +6,7 @@ labels: "Building/Packaging, Triage" assignees: '' --- -**Commit Hash** +**Commit Hash (8 character string of letters/numbers in title bar)** **Platform** diff --git a/.github/ISSUE_TEMPLATE/50-cache_issue.md b/.github/ISSUE_TEMPLATE/50-cache_issue.md index 13b8bc14b..0d088aa8c 100644 --- a/.github/ISSUE_TEMPLATE/50-cache_issue.md +++ b/.github/ISSUE_TEMPLATE/50-cache_issue.md @@ -6,7 +6,7 @@ labels: "Disk Cache, Triage" assignees: '' --- -**Commit Hash** +**Commit Hash (8 character string of letters/numbers in title bar)** **Platform** diff --git a/.github/ISSUE_TEMPLATE/50-codec_issue.md b/.github/ISSUE_TEMPLATE/50-codec_issue.md index a3a936915..04082833f 100644 --- a/.github/ISSUE_TEMPLATE/50-codec_issue.md +++ b/.github/ISSUE_TEMPLATE/50-codec_issue.md @@ -6,7 +6,7 @@ labels: "Codec, Triage" assignees: '' --- -**Commit Hash** +**Commit Hash (8 character string of letters/numbers in title bar)** **Platform** diff --git a/.github/ISSUE_TEMPLATE/50-color_issue.md b/.github/ISSUE_TEMPLATE/50-color_issue.md index 6a7464ea3..99889a56b 100644 --- a/.github/ISSUE_TEMPLATE/50-color_issue.md +++ b/.github/ISSUE_TEMPLATE/50-color_issue.md @@ -6,7 +6,7 @@ labels: "Color Management, Triage" assignees: '' --- -**Commit Hash** +**Commit Hash (8 character string of letters/numbers in title bar)** **Platform** diff --git a/.github/ISSUE_TEMPLATE/50-editing_issue.md b/.github/ISSUE_TEMPLATE/50-editing_issue.md index c731e221f..0465e88a5 100644 --- a/.github/ISSUE_TEMPLATE/50-editing_issue.md +++ b/.github/ISSUE_TEMPLATE/50-editing_issue.md @@ -6,7 +6,7 @@ labels: "Timeline/Editing, Triage" assignees: '' --- -**Commit Hash** +**Commit Hash (8 character string of letters/numbers in title bar)** **Platform** diff --git a/.github/ISSUE_TEMPLATE/50-export_issue.md b/.github/ISSUE_TEMPLATE/50-export_issue.md index e21a79294..7ccef22fc 100644 --- a/.github/ISSUE_TEMPLATE/50-export_issue.md +++ b/.github/ISSUE_TEMPLATE/50-export_issue.md @@ -6,7 +6,7 @@ labels: "Export, Triage" assignees: '' --- -**Commit Hash** +**Commit Hash (8 character string of letters/numbers in title bar)** **Platform** diff --git a/.github/ISSUE_TEMPLATE/50-node_issue.md b/.github/ISSUE_TEMPLATE/50-node_issue.md index 7749521ba..4d15ecebe 100644 --- a/.github/ISSUE_TEMPLATE/50-node_issue.md +++ b/.github/ISSUE_TEMPLATE/50-node_issue.md @@ -6,7 +6,7 @@ labels: "Nodes/Compositing, Triage" assignees: '' --- -**Commit Hash** +**Commit Hash (8 character string of letters/numbers in title bar)** **Platform** diff --git a/.github/ISSUE_TEMPLATE/50-playback_issue.md b/.github/ISSUE_TEMPLATE/50-playback_issue.md index 00aa98149..5e35446f5 100644 --- a/.github/ISSUE_TEMPLATE/50-playback_issue.md +++ b/.github/ISSUE_TEMPLATE/50-playback_issue.md @@ -6,7 +6,7 @@ labels: "Playback, Triage" assignees: '' --- -**Commit Hash** +**Commit Hash (8 character string of letters/numbers in title bar)** **Platform** diff --git a/.github/ISSUE_TEMPLATE/50-project_issue.md b/.github/ISSUE_TEMPLATE/50-project_issue.md index 9e151539c..fa65f393e 100644 --- a/.github/ISSUE_TEMPLATE/50-project_issue.md +++ b/.github/ISSUE_TEMPLATE/50-project_issue.md @@ -6,7 +6,7 @@ labels: "Project, Triage" assignees: '' --- -**Commit Hash** +**Commit Hash (8 character string of letters/numbers in title bar)** **Platform** diff --git a/.github/ISSUE_TEMPLATE/50-renderer_issue.md b/.github/ISSUE_TEMPLATE/50-renderer_issue.md index 3d6812004..f97a22079 100644 --- a/.github/ISSUE_TEMPLATE/50-renderer_issue.md +++ b/.github/ISSUE_TEMPLATE/50-renderer_issue.md @@ -6,7 +6,7 @@ labels: "Renderer, Triage" assignees: '' --- -**Commit Hash** +**Commit Hash (8 character string of letters/numbers in title bar)** **Platform** diff --git a/.github/ISSUE_TEMPLATE/50-ui_issue.md b/.github/ISSUE_TEMPLATE/50-ui_issue.md index 12af9f863..a0cfa3c02 100644 --- a/.github/ISSUE_TEMPLATE/50-ui_issue.md +++ b/.github/ISSUE_TEMPLATE/50-ui_issue.md @@ -6,7 +6,7 @@ labels: "User Interface, Triage" assignees: '' --- -**Commit Hash** +**Commit Hash (8 character string of letters/numbers in title bar)** **Platform** From 8506c82a0c2d00aae4e814e2e02f2d99b23f2a2c Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 18 Sep 2020 12:58:24 +1000 Subject: [PATCH 14/71] import: safely handle unsupported files Fixes #1191 --- app/codec/ffmpeg/ffmpegdecoder.cpp | 34 +++++++++--- app/core.cpp | 10 +++- app/task/project/import/CMakeLists.txt | 2 + app/task/project/import/import.cpp | 5 +- app/task/project/import/import.h | 12 +++++ app/task/project/import/importerrordialog.cpp | 53 +++++++++++++++++++ app/task/project/import/importerrordialog.h | 40 ++++++++++++++ 7 files changed, 148 insertions(+), 8 deletions(-) create mode 100644 app/task/project/import/importerrordialog.cpp create mode 100644 app/task/project/import/importerrordialog.h diff --git a/app/codec/ffmpeg/ffmpegdecoder.cpp b/app/codec/ffmpeg/ffmpegdecoder.cpp index 096cfcd07..46cac10fc 100644 --- a/app/codec/ffmpeg/ffmpegdecoder.cpp +++ b/app/codec/ffmpeg/ffmpegdecoder.cpp @@ -477,14 +477,19 @@ bool FFmpegDecoder::Probe(Footage *f, const QAtomicInt* cancelled) // Retrieve metadata about the media avformat_find_stream_info(fmt_ctx, nullptr); + QVector streams(fmt_ctx->nb_streams); + // Dump it into the Footage object for (unsigned int i=0;inb_streams;i++) { AVStream* avstream = fmt_ctx->streams[i]; + // Find decoder for this stream, if it exists we can proceed + AVCodec* decoder = avcodec_find_decoder(avstream->codecpar->codec_id); + StreamPtr str; - if (avstream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { + if (avstream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && decoder) { bool image_is_still = false; rational pixel_aspect_ratio; @@ -564,7 +569,7 @@ bool FFmpegDecoder::Probe(Footage *f, const QAtomicInt* cancelled) str = image_stream; - } else if (avstream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { + } else if (avstream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && decoder) { // Create an audio stream object AudioStreamPtr audio_stream = std::make_shared(); @@ -600,7 +605,7 @@ bool FFmpegDecoder::Probe(Footage *f, const QAtomicInt* cancelled) str->set_type(Stream::kAttachment); break; default: - // We should never realistically get here, but we make an "invalid" stream just in case + // Fallback to an unknown stream str->set_type(Stream::kUnknown); break; } @@ -611,11 +616,27 @@ bool FFmpegDecoder::Probe(Footage *f, const QAtomicInt* cancelled) str->set_timebase(avstream->time_base); str->set_duration(avstream->duration); - f->add_stream(str); + streams[i] = str; } - // As long as we can open the container and retrieve information, this was a successful probe - result = true; + // Check if we could pick up any streams in this file + bool found_valid_streams = false; + + foreach (StreamPtr stream, streams) { + if (stream->type() != Stream::kUnknown) { + found_valid_streams = true; + break; + } + } + + if (found_valid_streams) { + // Copy streams over + foreach (StreamPtr stream, streams) { + f->add_stream(stream); + } + + result = true; + } } // Free all memory @@ -1330,6 +1351,7 @@ void FFmpegDecoderInstance::RemoveFirstFrame() FFmpegDecoderInstance::FFmpegDecoderInstance(const char *filename, int stream_index) : fmt_ctx_(nullptr), + codec_ctx_(nullptr), opts_(nullptr), scale_ctx_(nullptr), scale_divider_(0), diff --git a/app/core.cpp b/app/core.cpp index 9790246ed..5ba51ee45 100644 --- a/app/core.cpp +++ b/app/core.cpp @@ -51,6 +51,7 @@ #include "render/pixelformat.h" #include "render/shaderinfo.h" #include "task/project/import/import.h" +#include "task/project/import/importerrordialog.h" #include "task/project/load/load.h" #include "task/project/save/save.h" #include "task/taskmanager.h" @@ -473,7 +474,14 @@ void Core::AddOpenProjectFromTask(Task *task) void Core::ImportTaskComplete(Task* task) { - QUndoCommand *command = static_cast(task)->GetCommand(); + ProjectImportTask* import_task = static_cast(task); + + QUndoCommand *command = import_task->GetCommand(); + + if (import_task->HasInvalidFiles()) { + ProjectImportErrorDialog d(import_task->GetInvalidFiles(), main_window_); + d.exec(); + } undo_stack_.pushIfHasChildren(command); } diff --git a/app/task/project/import/CMakeLists.txt b/app/task/project/import/CMakeLists.txt index 77b4f31a6..4a25a6b03 100644 --- a/app/task/project/import/CMakeLists.txt +++ b/app/task/project/import/CMakeLists.txt @@ -18,5 +18,7 @@ set(OLIVE_SOURCES ${OLIVE_SOURCES} task/project/import/import.h task/project/import/import.cpp + task/project/import/importerrordialog.h + task/project/import/importerrordialog.cpp PARENT_SCOPE ) diff --git a/app/task/project/import/import.cpp b/app/task/project/import/import.cpp index 270e3a7d4..ef5767886 100644 --- a/app/task/project/import/import.cpp +++ b/app/task/project/import/import.cpp @@ -122,7 +122,10 @@ void ProjectImportTask::Import(Folder *folder, const QFileInfoList &import, int f->set_project(nullptr); - if (f->status() != Footage::kInvalid) { + if (f->status() == Footage::kInvalid) { + // Add to list so we can tell the user about it later + invalid_files_.append(file_info.absoluteFilePath()); + } else { // Create undoable command that adds the items to the model new ProjectViewModel::AddItemCommand(model_, folder, diff --git a/app/task/project/import/import.h b/app/task/project/import/import.h index d092fa192..2257fc8ea 100644 --- a/app/task/project/import/import.h +++ b/app/task/project/import/import.h @@ -42,6 +42,16 @@ public: return command_; } + const QStringList& GetInvalidFiles() const + { + return invalid_files_; + } + + bool HasInvalidFiles() const + { + return !invalid_files_.isEmpty(); + } + protected: virtual bool Run() override; @@ -58,6 +68,8 @@ private: int file_count_; + QStringList invalid_files_; + }; OLIVE_NAMESPACE_EXIT diff --git a/app/task/project/import/importerrordialog.cpp b/app/task/project/import/importerrordialog.cpp new file mode 100644 index 000000000..c6b5e4d8c --- /dev/null +++ b/app/task/project/import/importerrordialog.cpp @@ -0,0 +1,53 @@ +/*** + + Olive - Non-Linear Video Editor + Copyright (C) 2019 Olive Team + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +***/ + +#include "importerrordialog.h" + +#include +#include +#include +#include + +OLIVE_NAMESPACE_ENTER + +ProjectImportErrorDialog::ProjectImportErrorDialog(const QStringList& filenames, QWidget* parent) : + QDialog(parent) +{ + QVBoxLayout* layout = new QVBoxLayout(this); + + setWindowTitle(tr("Import Error")); + + layout->addWidget(new QLabel(tr("The following files failed to import. Olive likely does not " + "support their formats."))); + + QListWidget* list_widget = new QListWidget(); + foreach (const QString& s, filenames) { + list_widget->addItem(s); + } + layout->addWidget(list_widget); + + QDialogButtonBox* buttons = new QDialogButtonBox(); + buttons->setStandardButtons(QDialogButtonBox::Ok); + buttons->setCenterButtons(true); + connect(buttons, &QDialogButtonBox::accepted, this, &ProjectImportErrorDialog::accept); + layout->addWidget(buttons); +} + +OLIVE_NAMESPACE_EXIT diff --git a/app/task/project/import/importerrordialog.h b/app/task/project/import/importerrordialog.h new file mode 100644 index 000000000..8ee6bf740 --- /dev/null +++ b/app/task/project/import/importerrordialog.h @@ -0,0 +1,40 @@ +/*** + + Olive - Non-Linear Video Editor + Copyright (C) 2019 Olive Team + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +***/ + +#ifndef PROJECTIMPORTERRORDIALOG_H +#define PROJECTIMPORTERRORDIALOG_H + +#include + +#include "common/define.h" + +OLIVE_NAMESPACE_ENTER + +class ProjectImportErrorDialog : public QDialog +{ + Q_OBJECT +public: + ProjectImportErrorDialog(const QStringList& filenames, QWidget* parent = nullptr); + +}; + +OLIVE_NAMESPACE_EXIT + +#endif // PROJECTIMPORTERRORDIALOG_H From 9c488d9a37fd3c15aa00f354defeccaf7a84b82d Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 18 Sep 2020 12:59:16 +1000 Subject: [PATCH 15/71] timeline: use full viewport update Fixes #1190 --- app/widget/timelinewidget/view/timelineview.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/app/widget/timelinewidget/view/timelineview.cpp b/app/widget/timelinewidget/view/timelineview.cpp index 4b60ec0b7..99fd892a0 100644 --- a/app/widget/timelinewidget/view/timelineview.cpp +++ b/app/widget/timelinewidget/view/timelineview.cpp @@ -46,6 +46,7 @@ TimelineView::TimelineView(Qt::Alignment vertical_alignment, QWidget *parent) : setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); setBackgroundRole(QPalette::Window); setContextMenuPolicy(Qt::CustomContextMenu); + setViewportUpdateMode(QGraphicsView::FullViewportUpdate); viewport()->setMouseTracking(true); } From 01428276f74a34cd493c8285e0e5a74b7f7b26b4 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 18 Sep 2020 13:06:10 +1000 Subject: [PATCH 16/71] export: alternate method of checking video/audio parameters based on ticket type Fixes #1196 --- app/render/backend/renderbackend.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/render/backend/renderbackend.cpp b/app/render/backend/renderbackend.cpp index 9c72f47a9..8e5c0110b 100644 --- a/app/render/backend/renderbackend.cpp +++ b/app/render/backend/renderbackend.cpp @@ -375,13 +375,6 @@ void RenderBackend::RunNextJob() return; } - // Check if params are valid - if (!video_params_.is_valid() - || !audio_params_.is_valid()) { - qDebug() << "Failed to run job, parameters are invalid"; - return; - } - // If we have a value update queued, check if all workers are available and proceed from there if (autocache_enabled_ && !graph_update_queue_.isEmpty()) { bool all_workers_available = true; @@ -449,6 +442,8 @@ void RenderBackend::RunNextJob() switch (ticket->GetType()) { case RenderTicket::kTypeHash: + Q_ASSERT(video_params_.is_valid()); + QtConcurrent::run(&thread_pool_, worker, &RenderWorker::Hash, @@ -458,6 +453,8 @@ void RenderBackend::RunNextJob() break; case RenderTicket::kTypeVideo: { + Q_ASSERT(video_params_.is_valid()); + rational frame = ticket->GetTime().value(); QtConcurrent::run(&thread_pool_, @@ -474,6 +471,8 @@ void RenderBackend::RunNextJob() break; } case RenderTicket::kTypeAudio: + Q_ASSERT(audio_params_.is_valid()); + QtConcurrent::run(&thread_pool_, worker, &RenderWorker::RenderAudio, From 27a4dbc85fd16fae623ee8822c2e3363d45ab60a Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 18 Sep 2020 13:19:18 +1000 Subject: [PATCH 17/71] import: fixed progres reporting --- app/task/project/import/import.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/task/project/import/import.cpp b/app/task/project/import/import.cpp index ef5767886..c8cd0a6c9 100644 --- a/app/task/project/import/import.cpp +++ b/app/task/project/import/import.cpp @@ -135,7 +135,7 @@ void ProjectImportTask::Import(Folder *folder, const QFileInfoList &import, int counter++; - emit ProgressChanged((counter * 100) / file_count_); + emit ProgressChanged(static_cast(counter) / static_cast(file_count_)); } } From 3103359cd6898fe219af5a1c0c421d1dc20fc54e Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 18 Sep 2020 23:49:40 +1000 Subject: [PATCH 18/71] slider: fixed crash when clicking another mouse button while dragging --- app/widget/slider/sliderlabel.cpp | 10 ++++++---- app/widget/slider/sliderladder.cpp | 13 ++++++++++--- app/widget/slider/sliderladder.h | 2 ++ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/app/widget/slider/sliderlabel.cpp b/app/widget/slider/sliderlabel.cpp index d100379a5..ffc07fb2c 100644 --- a/app/widget/slider/sliderlabel.cpp +++ b/app/widget/slider/sliderlabel.cpp @@ -51,10 +51,12 @@ SliderLabel::SliderLabel(QWidget *parent) : void SliderLabel::mousePressEvent(QMouseEvent *e) { - if (e->modifiers() & Qt::AltModifier) { - emit RequestReset(); - } else { - emit LabelPressed(); + if (e->button() == Qt::LeftButton) { + if (e->modifiers() & Qt::AltModifier) { + emit RequestReset(); + } else { + emit LabelPressed(); + } } } diff --git a/app/widget/slider/sliderladder.cpp b/app/widget/slider/sliderladder.cpp index 5a9c4d235..c5c0054ae 100644 --- a/app/widget/slider/sliderladder.cpp +++ b/app/widget/slider/sliderladder.cpp @@ -103,9 +103,7 @@ void SliderLadder::mouseReleaseEvent(QMouseEvent *event) { Q_UNUSED(event) - drag_timer_.stop(); - - emit Released(); + this->close(); } void SliderLadder::showEvent(QShowEvent *event) @@ -115,6 +113,15 @@ void SliderLadder::showEvent(QShowEvent *event) drag_timer_.start(); } +void SliderLadder::closeEvent(QCloseEvent *event) +{ + Q_UNUSED(event) + + drag_timer_.stop(); + + emit Released(); +} + void SliderLadder::TimerUpdate() { int32_t x_mvmt, y_mvmt; diff --git a/app/widget/slider/sliderladder.h b/app/widget/slider/sliderladder.h index ce0ae6193..9fc30e511 100644 --- a/app/widget/slider/sliderladder.h +++ b/app/widget/slider/sliderladder.h @@ -75,6 +75,8 @@ protected: virtual void showEvent(QShowEvent *event) override; + virtual void closeEvent(QCloseEvent* event) override; + signals: void DraggedByValue(int value, double multiplier); From 6117ca44e931e14c9c715d05653c7250437d4d0d Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sat, 19 Sep 2020 12:07:36 +1000 Subject: [PATCH 19/71] sequence: ignore disabled streams --- app/project/item/sequence/sequence.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/project/item/sequence/sequence.cpp b/app/project/item/sequence/sequence.cpp index fcf76c8dd..ede8f6f88 100644 --- a/app/project/item/sequence/sequence.cpp +++ b/app/project/item/sequence/sequence.cpp @@ -268,6 +268,10 @@ void Sequence::set_parameters_from_footage(const QList footage) foreach (Footage* f, footage) { foreach (StreamPtr s, f->streams()) { + if (!s->enabled()) { + continue; + } + switch (s->type()) { case Stream::kVideo: { From 9c57899ae2d6582ec6b084ed13f1f6a539311d67 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sat, 19 Sep 2020 12:07:52 +1000 Subject: [PATCH 20/71] mainwindow: auto-close footage in footage viewer when closing parent project --- app/window/mainwindow/mainwindow.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/window/mainwindow/mainwindow.cpp b/app/window/mainwindow/mainwindow.cpp index 4c010e963..cbb4b48da 100644 --- a/app/window/mainwindow/mainwindow.cpp +++ b/app/window/mainwindow/mainwindow.cpp @@ -349,6 +349,22 @@ void MainWindow::ProjectClose(Project *p) CloseSequence(seq); } } + + // Close any open footage in footage viewer + QList footage = p->get_items_of_type(Item::kFootage); + QList footage_in_viewer = footage_viewer_panel_->GetSelectedFootage(); + + if (!footage_in_viewer.isEmpty()) { + // FootageViewer only has the one footage item + Footage* f = footage_in_viewer.first(); + + foreach (ItemPtr i, footage) { + if (f == i.get()) { + footage_viewer_panel_->SetFootage(nullptr); + break; + } + } + } } void MainWindow::SetApplicationProgressStatus(ProgressStatus status) From 855c460ff37687f3a1c5167ea6b650772fe057a5 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sat, 19 Sep 2020 12:30:42 +1000 Subject: [PATCH 21/71] footageviewer: use sequence functions to set video/audio params Code improvement by re-using existing code. Existing code prevents crash when loading a still image. --- app/widget/viewer/footageviewer.cpp | 51 +++++++++++------------------ app/widget/viewer/footageviewer.h | 4 +-- 2 files changed, 22 insertions(+), 33 deletions(-) diff --git a/app/widget/viewer/footageviewer.cpp b/app/widget/viewer/footageviewer.cpp index c4df185ce..5ca81ae1e 100644 --- a/app/widget/viewer/footageviewer.cpp +++ b/app/widget/viewer/footageviewer.cpp @@ -33,8 +33,10 @@ FootageViewerWidget::FootageViewerWidget(QWidget *parent) : footage_(nullptr) { video_node_ = new VideoInput(); + sequence_.AddNode(video_node_); + audio_node_ = new AudioInput(); - viewer_node_ = new ViewerOutput(); + sequence_.AddNode(audio_node_); connect(display_widget(), &ViewerDisplayWidget::DragStarted, this, &FootageViewerWidget::StartFootageDrag); @@ -55,17 +57,29 @@ void FootageViewerWidget::SetFootage(Footage *footage) ConnectViewerNode(nullptr); - NodeParam::DisconnectEdge(video_node_->output(), viewer_node_->texture_input()); - NodeParam::DisconnectEdge(audio_node_->output(), viewer_node_->samples_input()); + NodeParam::DisconnectEdge(video_node_->output(), sequence_.viewer_output()->texture_input()); + NodeParam::DisconnectEdge(audio_node_->output(), sequence_.viewer_output()->samples_input()); } footage_ = footage; if (footage_) { + // Update sequence media name + sequence_.viewer_output()->set_media_name(footage_->name()); + + // Reset parameters and then attempt to set from footage + sequence_.set_default_parameters(); + sequence_.set_parameters_from_footage({footage_}); + + // Use first of each stream VideoStreamPtr video_stream = nullptr; AudioStreamPtr audio_stream = nullptr; foreach (StreamPtr s, footage_->streams()) { + if (!s->enabled()) { + continue; + } + if (!audio_stream && s->type() == Stream::kAudio) { audio_stream = std::static_pointer_cast(s); } @@ -80,42 +94,17 @@ void FootageViewerWidget::SetFootage(Footage *footage) } } - viewer_node_->set_media_name(footage_->name()); - if (video_stream) { video_node_->SetFootage(video_stream); - viewer_node_->set_video_params(VideoParams(video_stream->width(), - video_stream->height(), - video_stream->frame_rate().flipped(), - static_cast(Config::Current()["DefaultSequencePreviewFormat"].toInt()), - video_stream->pixel_aspect_ratio(), - video_stream->interlacing(), - VideoParams::generate_auto_divider(video_stream->width(), video_stream->height()))); - NodeParam::ConnectEdge(video_node_->output(), viewer_node_->texture_input()); - } else { - int width = Config::Current()["DefaultSequenceWidth"].toInt(); - int height = Config::Current()["DefaultSequenceHeight"].toInt(); - - viewer_node_->set_video_params(VideoParams(width, - height, - Config::Current()["DefaultSequenceFrameRate"].value(), - static_cast(Config::Current()["DefaultSequencePreviewFormat"].toInt()), - Config::Current()["DefaultSequencePixelAspect"].value(), - Config::Current()["DefaultSequenceInterlacing"].value(), - VideoParams::generate_auto_divider(width, height))); + NodeParam::ConnectEdge(video_node_->output(), sequence_.viewer_output()->texture_input()); } if (audio_stream) { audio_node_->SetFootage(audio_stream); - viewer_node_->set_audio_params(AudioParams(audio_stream->sample_rate(), audio_stream->channel_layout(), SampleFormat::kInternalFormat)); - NodeParam::ConnectEdge(audio_node_->output(), viewer_node_->samples_input()); - } else { - viewer_node_->set_audio_params(AudioParams(Config::Current()["DefaultSequenceAudioFrequency"].toInt(), - Config::Current()["DefaultSequenceAudioLayout"].toULongLong(), - SampleFormat::kInternalFormat)); + NodeParam::ConnectEdge(audio_node_->output(), sequence_.viewer_output()->samples_input()); } - ConnectViewerNode(viewer_node_, footage_->project()->color_manager()); + ConnectViewerNode(sequence_.viewer_output(), footage_->project()->color_manager()); SetTimestamp(cached_timestamps_.value(footage_, 0)); } diff --git a/app/widget/viewer/footageviewer.h b/app/widget/viewer/footageviewer.h index 36f688fa9..af093eb8f 100644 --- a/app/widget/viewer/footageviewer.h +++ b/app/widget/viewer/footageviewer.h @@ -47,12 +47,12 @@ private: Footage* footage_; + Sequence sequence_; + VideoInput* video_node_; AudioInput* audio_node_; - ViewerOutput* viewer_node_; - QHash cached_timestamps_; private slots: From 7bc841904a6fe802f0bf42b6110a649458b362c8 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sat, 19 Sep 2020 12:45:40 +1000 Subject: [PATCH 22/71] viewer: display image infinitely if video length is null Allows for displaying still images in viewer without a finite length. --- app/widget/viewer/viewer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/widget/viewer/viewer.cpp b/app/widget/viewer/viewer.cpp index 4af7869b6..b3b52231a 100644 --- a/app/widget/viewer/viewer.cpp +++ b/app/widget/viewer/viewer.cpp @@ -566,7 +566,9 @@ QString ViewerWidget::GetCachedFilenameFromTime(const rational &time) bool ViewerWidget::FrameExistsAtTime(const rational &time) { - return GetConnectedNode() && time >= 0 && time < GetConnectedNode()->video_frame_cache()->GetLength(); + return GetConnectedNode() + && ((time >= 0 && time < GetConnectedNode()->video_frame_cache()->GetLength()) + || GetConnectedNode()->video_frame_cache()->GetLength().isNull()); } void ViewerWidget::SetDisplayImage(FramePtr frame, bool main_only) From 8e0c86a6fa7bc32bd2177d8b72f19f6a4f92d8e9 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sat, 19 Sep 2020 12:53:07 +1000 Subject: [PATCH 23/71] renderer: if texture is null, don't allocate a frame unless exporting --- app/render/backend/renderworker.cpp | 2 +- app/widget/viewer/viewerdisplay.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/render/backend/renderworker.cpp b/app/render/backend/renderworker.cpp index 28e8a50f5..2db075c25 100644 --- a/app/render/backend/renderworker.cpp +++ b/app/render/backend/renderworker.cpp @@ -126,7 +126,7 @@ void RenderWorker::RenderFrame(RenderTicketPtr ticket, ViewerOutput* viewer, con FramePtr frame = Frame::Create(); frame->set_timestamp(time); - if (video_force_download_resolution_ || texture.isNull()) { + if (video_force_download_resolution_) { // If we're setting the resolution ourselves or we're zeroing it out, allocate the frame now frame->set_video_params(VideoParams(video_params_.width(), video_params_.height(), diff --git a/app/widget/viewer/viewerdisplay.cpp b/app/widget/viewer/viewerdisplay.cpp index 983f422e1..25f13ac58 100644 --- a/app/widget/viewer/viewerdisplay.cpp +++ b/app/widget/viewer/viewerdisplay.cpp @@ -99,7 +99,11 @@ void ViewerDisplayWidget::SetSignalCursorColorEnabled(bool e) void ViewerDisplayWidget::SetImage(FramePtr in_buffer) { - last_loaded_buffer_ = in_buffer; + if (in_buffer && in_buffer->is_allocated()) { + last_loaded_buffer_ = in_buffer; + } else { + last_loaded_buffer_ = nullptr; + } if (last_loaded_buffer_) { makeCurrent(); From 7c38ff74e2df74f601376d69225f4491ff45baab Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 20 Sep 2020 00:38:50 +1000 Subject: [PATCH 24/71] ci: modified if syntax --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36f4fcfa8..2a5027401 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,17 +32,17 @@ jobs: runs-on: ${{ matrix.os }} steps: - - if: matrix.os == 'windows-latest' - name: Set package name shell: bash + if: matrix.os == 'windows-latest' run: | echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-Windows-x86_64)" - - if: matrix.os == 'macos-latest' - - name: Set package name - shell: bash - run: | - echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-macOS)" + - name: Set package name + shell: bash + if: matrix.os == 'macos-latest' + run: | + echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-macOS)" - uses: actions/checkout@v2 From cc8cbac5320b4b9fe885d22c340355e7141bb76b Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 20 Sep 2020 00:44:10 +1000 Subject: [PATCH 25/71] ci: fixed indentation issue --- .github/workflows/ci.yml | 257 ++++++++++++++++++++------------------- 1 file changed, 132 insertions(+), 125 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a5027401..da648748d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,11 +32,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Set package name - shell: bash - if: matrix.os == 'windows-latest' - run: | - echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-Windows-x86_64)" + - name: Set package name + shell: bash + if: matrix.os == 'windows-latest' + run: | + echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-Windows-x86_64)" - name: Set package name shell: bash @@ -50,9 +50,9 @@ jobs: run: | cmake -E make_directory ${{ runner.workspace }}/build - - if: matrix.os == 'windows-latest' - - name: Enable Developer Command Prompt - uses: ilammy/msvc-dev-cmd@v1.3.0 + - name: Enable Developer Command Prompt + uses: ilammy/msvc-dev-cmd@v1.3.0 + if: matrix.os == 'windows-latest' - name: Acquire Qt uses: jurplel/install-qt-action@v2.8.0 @@ -122,15 +122,15 @@ jobs: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/turbojpeg-$DEP_SUFFIX 7z x turbojpeg-$DEP_SUFFIX - - if: matrix.os == 'windows-latest' - - name: Acquire zlib - shell: bash - env: - DEP_SUFFIX: ${{ matrix.dep-suffix }} - EXTRACT_TOOL: ${{ matrix.extract-tool }} - run: | - curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/zlib-$DEP_SUFFIX - 7z x zlib-$DEP_SUFFIX + - name: Acquire zlib + shell: bash + env: + DEP_SUFFIX: ${{ matrix.dep-suffix }} + EXTRACT_TOOL: ${{ matrix.extract-tool }} + run: | + curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/zlib-$DEP_SUFFIX + 7z x zlib-$DEP_SUFFIX + if: matrix.os == 'windows-latest' - name: Acquire Boost shell: bash @@ -169,121 +169,128 @@ jobs: run: | ctest -C ${{ matrix.build-type }} - - if: matrix.os == 'windows-latest' - - name: Create Package - working-directory: ${{ runner.workspace }}/build - shell: cmd - run: | - mkdir olive-editor - copy app\olive-editor.exe olive-editor - copy app\olive-editor.pdb olive-editor - windeployqt olive-editor\olive-editor.exe - copy %GITHUB_WORKSPACE%\bin\*.dll olive-editor - copy %GITHUB_WORKSPACE%\out\Default\crashpad_handler.exe olive-editor + - name: Create Package + working-directory: ${{ runner.workspace }}/build + shell: cmd + run: | + mkdir olive-editor + copy app\olive-editor.exe olive-editor + copy app\olive-editor.pdb olive-editor + windeployqt olive-editor\olive-editor.exe + copy %GITHUB_WORKSPACE%\bin\*.dll olive-editor + copy %GITHUB_WORKSPACE%\out\Default\crashpad_handler.exe olive-editor + if: matrix.os == 'windows-latest' - - name: Deploy Installer - working-directory: ${{ runner.workspace }}/build - shell: cmd - run: | - copy %GITHUB_WORKSPACE%\app\packaging\windows\nsis\* . - copy %GITHUB_WORKSPACE%\LICENSE . - makensis -V4 -DX64 "-XOutFile %PKGNAME%.exe" olive.nsi + - name: Create Package + working-directory: ${{ runner.workspace }}/build + env: + BUNDLE_NAME: Olive.app + run: | + mv app/$BUNDLE_NAME . + macdeployqt $BUNDLE_NAME + curl -fLOSs --retry 3 https://github.com/arl/macdeployqtfix/raw/master/macdeployqtfix.py + python2 macdeployqtfix.py $BUNDLE_NAME/Contents/MacOS/Olive /usr/local/Cellar/qt5/5.*/ + if: matrix.os == 'macos-latest' - - name: Deploy Portable - working-directory: ${{ runner.workspace }}/build - shell: cmd - run: | - type NUL > olive-editor\portable - 7z a %PKGNAME%.zip olive-editor + - name: Deploy Installer + working-directory: ${{ runner.workspace }}/build + shell: cmd + run: | + copy %GITHUB_WORKSPACE%\app\packaging\windows\nsis\* . + copy %GITHUB_WORKSPACE%\LICENSE . + makensis -V4 -DX64 "-XOutFile %PKGNAME%.exe" olive.nsi + if: matrix.os == 'windows-latest' - - name: Upload Installer to Nightly Page - shell: bash - working-directory: ${{ runner.workspace }}/build - env: - GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} - run: | - curl -X POST \ - -F file=@$PKGNAME.exe \ - -F key="$GH_AUTH_KEY" \ - -F hash="$GITHUB_SHA" \ - -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ - -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ - https://olivevideoeditor.org/dl/push.php - if: github.event_name != 'pull_request' + - name: Deploy Portable + working-directory: ${{ runner.workspace }}/build + shell: cmd + run: | + type NUL > olive-editor\portable + 7z a %PKGNAME%.zip olive-editor + if: matrix.os == 'windows-latest' - - name: Upload Portable to Nightly Page - shell: bash - working-directory: ${{ runner.workspace }}/build - env: - GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} - run: | - curl -X POST \ - -F file=@$PKGNAME.zip \ - -F key="$GH_AUTH_KEY" \ - -F hash="$GITHUB_SHA" \ - -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ - -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ - https://olivevideoeditor.org/dl/push.php - if: github.event_name != 'pull_request' + - name: Deploy Package + working-directory: ${{ runner.workspace }}/build + run: | + zip -r $PKGNAME.zip $BUNDLE_NAME + if: matrix.os == 'macos-latest' - - name: Upload Installer Artifact to GitHub - uses: actions/upload-artifact@v2 - with: - name: ${{ env.PKGNAME }}.exe - path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.exe + - name: Upload Installer to Nightly Page + shell: bash + working-directory: ${{ runner.workspace }}/build + env: + GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} + run: | + curl -X POST \ + -F file=@$PKGNAME.exe \ + -F key="$GH_AUTH_KEY" \ + -F hash="$GITHUB_SHA" \ + -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ + -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ + https://olivevideoeditor.org/dl/push.php + if: matrix.os == 'windows-latest' && github.event_name != 'pull_request' - - name: Upload Portable Artifact to GitHub - uses: actions/upload-artifact@v2 - with: - name: ${{ env.PKGNAME }}.zip - path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.zip + - name: Upload Portable to Nightly Page + shell: bash + working-directory: ${{ runner.workspace }}/build + env: + GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} + run: | + curl -X POST \ + -F file=@$PKGNAME.zip \ + -F key="$GH_AUTH_KEY" \ + -F hash="$GITHUB_SHA" \ + -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ + -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ + https://olivevideoeditor.org/dl/push.php + if: matrix.os == 'windows-latest' && github.event_name != 'pull_request' - - name: Export Crashpad Symbols and Upload To Server - working-directory: ${{ runner.workspace }}/build - shell: cmd - env: - GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} - run: | - curl -fLSs --retry 3 https://github.com/google/breakpad/blob/master/src/tools/windows/binaries/dump_syms.exe?raw=true > dump_syms.exe - dump_syms app\olive-editor.pdb > olive-editor.sym - curl -X POST ^ - -F symfile=@olive-editor.sym ^ - -F key="%GH_AUTH_KEY%" ^ - https://olivevideoeditor.org/crashpad/symbols.php + - name: Upload Artifact to Nightly Page + shell: bash + working-directory: ${{ runner.workspace }}/build + env: + GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} + run: | + curl -X POST \ + -F file=@$PKGNAME.zip \ + -F key="$GH_AUTH_KEY" \ + -F hash="$GITHUB_SHA" \ + -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ + -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ + https://olivevideoeditor.org/dl/push.php + if: matrix.os == 'macos-latest' && github.event_name != 'pull_request' - - if: matrix.os == 'macos-latest' - - name: Create Package - working-directory: ${{ runner.workspace }}/build - env: - BUNDLE_NAME: Olive.app - run: | - mv app/$BUNDLE_NAME . - macdeployqt $BUNDLE_NAME - curl -fLOSs --retry 3 https://github.com/arl/macdeployqtfix/raw/master/macdeployqtfix.py - python2 macdeployqtfix.py $BUNDLE_NAME/Contents/MacOS/Olive /usr/local/Cellar/qt5/5.*/ - - - name: Deploy Package - working-directory: ${{ runner.workspace }}/build - run: | - zip -r $PKGNAME.zip $BUNDLE_NAME + - name: Upload Installer Artifact to GitHub + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PKGNAME }}.exe + path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.exe + if: matrix.os == 'windows-latest' - - name: Upload Artifact to Nightly Page - shell: bash - working-directory: ${{ runner.workspace }}/build - env: - GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} - run: | - curl -X POST \ - -F file=@$PKGNAME.zip \ - -F key="$GH_AUTH_KEY" \ - -F hash="$GITHUB_SHA" \ - -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ - -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ - https://olivevideoeditor.org/dl/push.php - if: github.event_name != 'pull_request' + - name: Upload Portable Artifact to GitHub + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PKGNAME }}.zip + path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.zip + if: matrix.os == 'windows-latest' - - name: Upload Artifact to GitHub - uses: actions/upload-artifact@v2 - with: - name: ${{ env.PKGNAME }}.zip - path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.zip + - name: Upload Artifact to GitHub + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PKGNAME }}.zip + path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.zip + if: matrix.os == 'macos-latest' + + - name: Export Crashpad Symbols and Upload To Server + working-directory: ${{ runner.workspace }}/build + shell: cmd + env: + GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} + run: | + curl -fLSs --retry 3 https://github.com/google/breakpad/blob/master/src/tools/windows/binaries/dump_syms.exe?raw=true > dump_syms.exe + dump_syms app\olive-editor.pdb > olive-editor.sym + curl -X POST ^ + -F symfile=@olive-editor.sym ^ + -F key="%GH_AUTH_KEY%" ^ + https://olivevideoeditor.org/crashpad/symbols.php + if: matrix.os == 'windows-latest' From 0234529b5bc84026e67c2c3c91e5b3ee0e080e15 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 20 Sep 2020 00:45:19 +1000 Subject: [PATCH 26/71] ci: fixed other indentation issue --- .github/workflows/ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da648748d..41fc54d9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,7 @@ jobs: EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/ffmpeg-$DEP_SUFFIX - 7z x ffmpeg-$DEP_SUFFIX + $EXTRACT_TOOL ffmpeg-$DEP_SUFFIX - name: Acquire OpenColorIO shell: bash @@ -75,7 +75,7 @@ jobs: EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/ocio-$DEP_SUFFIX - 7z x ocio-$DEP_SUFFIX + $EXTRACT_TOOL ocio-$DEP_SUFFIX - name: Acquire OpenEXR shell: bash @@ -84,7 +84,7 @@ jobs: EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/openexr-$DEP_SUFFIX - 7z x openexr-$DEP_SUFFIX + $EXTRACT_TOOL openexr-$DEP_SUFFIX - name: Acquire OpenImageIO shell: bash @@ -93,7 +93,7 @@ jobs: EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/oiio-$DEP_SUFFIX - 7z x oiio-$DEP_SUFFIX + $EXTRACT_TOOL oiio-$DEP_SUFFIX - name: Acquire libpng shell: bash @@ -102,7 +102,7 @@ jobs: EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/libpng-$DEP_SUFFIX - 7z x libpng-$DEP_SUFFIX + $EXTRACT_TOOL libpng-$DEP_SUFFIX - name: Acquire libtiff shell: bash @@ -111,7 +111,7 @@ jobs: EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/libtiff-$DEP_SUFFIX - 7z x libtiff-$DEP_SUFFIX + $EXTRACT_TOOL libtiff-$DEP_SUFFIX - name: Acquire turbojpeg shell: bash @@ -120,16 +120,16 @@ jobs: EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/turbojpeg-$DEP_SUFFIX - 7z x turbojpeg-$DEP_SUFFIX + $EXTRACT_TOOL turbojpeg-$DEP_SUFFIX - name: Acquire zlib shell: bash env: DEP_SUFFIX: ${{ matrix.dep-suffix }} - EXTRACT_TOOL: ${{ matrix.extract-tool }} + EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/zlib-$DEP_SUFFIX - 7z x zlib-$DEP_SUFFIX + $EXTRACT_TOOL zlib-$DEP_SUFFIX if: matrix.os == 'windows-latest' - name: Acquire Boost @@ -139,7 +139,7 @@ jobs: EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/boost-$DEP_SUFFIX - 7z x boost-$DEP_SUFFIX + $EXTRACT_TOOL boost-$DEP_SUFFIX - name: Acquire Crashpad shell: bash @@ -148,7 +148,7 @@ jobs: EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/crashpad-$DEP_SUFFIX - 7z x crashpad-$DEP_SUFFIX + $EXTRACT_TOOL crashpad-$DEP_SUFFIX - name: Configure CMake shell: bash From d1f7d52943f431bd911ced81fa214397e566a644 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 20 Sep 2020 00:53:04 +1000 Subject: [PATCH 27/71] ci: don't use ninja --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41fc54d9f..a5d7d97d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -155,7 +155,7 @@ jobs: working-directory: ${{ runner.workspace }}/build run: | PATH=$GITHUB_WORKSPACE:$PATH \ - cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -G "Ninja" + cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} - name: Build working-directory: ${{ runner.workspace }}/build @@ -294,3 +294,6 @@ jobs: -F key="%GH_AUTH_KEY%" ^ https://olivevideoeditor.org/crashpad/symbols.php if: matrix.os == 'windows-latest' + + macos: + From 8d13f0f5c0ca0434ce9b0fa29e8211f1d455d6d8 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 20 Sep 2020 00:53:49 +1000 Subject: [PATCH 28/71] ci: fixed typo --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5d7d97d2..c78ad0bc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -294,6 +294,3 @@ jobs: -F key="%GH_AUTH_KEY%" ^ https://olivevideoeditor.org/crashpad/symbols.php if: matrix.os == 'windows-latest' - - macos: - From ef867f4e3b5e0411c9ac4f945e292215051fc834 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 20 Sep 2020 00:57:40 +1000 Subject: [PATCH 29/71] ci: set openexr_root --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c78ad0bc8..038a77921 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -155,6 +155,7 @@ jobs: working-directory: ${{ runner.workspace }}/build run: | PATH=$GITHUB_WORKSPACE:$PATH \ + OPENEXR_ROOT=$GITHUB_WORKSPACE \ cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} - name: Build From 1b4cd3a2dd5364a1c7f3b5d0a44741563fcacadc Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 20 Sep 2020 01:16:54 +1000 Subject: [PATCH 30/71] ci: set ffmpeg root --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 038a77921..62ac8c11b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -156,6 +156,7 @@ jobs: run: | PATH=$GITHUB_WORKSPACE:$PATH \ OPENEXR_ROOT=$GITHUB_WORKSPACE \ + FFMPEG_ROOT=$GITHUB_WORKSPACE \ cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} - name: Build From c04eaef24a4b826aebc65cb982b2e4c107216d03 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 20 Sep 2020 01:31:37 +1000 Subject: [PATCH 31/71] ci: use ninja but only on windows --- .github/workflows/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62ac8c11b..ca4a5994c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -150,6 +150,16 @@ jobs: curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/crashpad-$DEP_SUFFIX $EXTRACT_TOOL crashpad-$DEP_SUFFIX + - name: Configure CMake + shell: bash + working-directory: ${{ runner.workspace }}/build + run: | + PATH=$GITHUB_WORKSPACE:$PATH \ + OPENEXR_ROOT=$GITHUB_WORKSPACE \ + FFMPEG_ROOT=$GITHUB_WORKSPACE \ + cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -G Ninja + if: matrix.os == 'windows-latest' + - name: Configure CMake shell: bash working-directory: ${{ runner.workspace }}/build @@ -158,6 +168,7 @@ jobs: OPENEXR_ROOT=$GITHUB_WORKSPACE \ FFMPEG_ROOT=$GITHUB_WORKSPACE \ cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} + if: matrix.os == 'macos-latest' - name: Build working-directory: ${{ runner.workspace }}/build From 0798dbb0a268320dc245e26ba027cd62e1a723e6 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 20 Sep 2020 01:46:20 +1000 Subject: [PATCH 32/71] ci: restored vcredist line that was accidentally removed in the merge --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca4a5994c..86b5e1cdd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -209,6 +209,7 @@ jobs: working-directory: ${{ runner.workspace }}/build shell: cmd run: | + curl -fLOSs https://download.microsoft.com/download/3/2/2/3224B87F-CFA0-4E70-BDA3-3DE650EFEBA5/vcredist_x64.exe copy %GITHUB_WORKSPACE%\app\packaging\windows\nsis\* . copy %GITHUB_WORKSPACE%\LICENSE . makensis -V4 -DX64 "-XOutFile %PKGNAME%.exe" olive.nsi From 9b1242e3606088453bcf57bd53ec1bc132cc05c7 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 20 Sep 2020 03:29:40 +1000 Subject: [PATCH 33/71] ci: extract to root on mac --- .github/workflows/ci.yml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86b5e1cdd..d25fba645 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,13 +18,15 @@ jobs: os: windows-latest dep-suffix: win.7z extract-tool: 7z x + cmake-gen: Ninja - build: 2 build-type: RelWithDebInfo compiler-name: Clang LLVM os-name: macOS os: macos-latest dep-suffix: mac.zip - extract-tool: unzip + extract-tool: sudo unzip -d / + cmake-gen: "Unix Makefiles" name: | ${{ matrix.os-name }} <${{ matrix.compiler-name }}, @@ -153,22 +155,11 @@ jobs: - name: Configure CMake shell: bash working-directory: ${{ runner.workspace }}/build + env: + CMAKE_GEN: ${{ matrix.cmake-gen }} run: | PATH=$GITHUB_WORKSPACE:$PATH \ - OPENEXR_ROOT=$GITHUB_WORKSPACE \ - FFMPEG_ROOT=$GITHUB_WORKSPACE \ - cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -G Ninja - if: matrix.os == 'windows-latest' - - - name: Configure CMake - shell: bash - working-directory: ${{ runner.workspace }}/build - run: | - PATH=$GITHUB_WORKSPACE:$PATH \ - OPENEXR_ROOT=$GITHUB_WORKSPACE \ - FFMPEG_ROOT=$GITHUB_WORKSPACE \ - cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} - if: matrix.os == 'macos-latest' + cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -G $CMAKE_GEN - name: Build working-directory: ${{ runner.workspace }}/build From 2094c4f9da3a55dbf271e57f794d2b6b848a1cdd Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 20 Sep 2020 03:47:11 +1000 Subject: [PATCH 34/71] ci: extract to /usr/local on mac --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d25fba645..770d3c311 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: os-name: macOS os: macos-latest dep-suffix: mac.zip - extract-tool: sudo unzip -d / + extract-tool: sudo unzip -d /usr/local -o cmake-gen: "Unix Makefiles" name: | ${{ matrix.os-name }} From a3027299996f1bd4e2f1067225ce1f749257dc3a Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 20 Sep 2020 03:49:14 +1000 Subject: [PATCH 35/71] ci: attempt escape cmake generator --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 770d3c311..5725b5c4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: os: macos-latest dep-suffix: mac.zip extract-tool: sudo unzip -d /usr/local -o - cmake-gen: "Unix Makefiles" + cmake-gen: \"Unix Makefiles\" name: | ${{ matrix.os-name }} <${{ matrix.compiler-name }}, From fc0d4528e94f0fb21ed7e8cd510cadcb767eae15 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 20 Sep 2020 03:51:27 +1000 Subject: [PATCH 36/71] ci: use quotes elsewhere --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5725b5c4a..c6ab79116 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: os: macos-latest dep-suffix: mac.zip extract-tool: sudo unzip -d /usr/local -o - cmake-gen: \"Unix Makefiles\" + cmake-gen: Unix Makefiles name: | ${{ matrix.os-name }} <${{ matrix.compiler-name }}, @@ -159,7 +159,7 @@ jobs: CMAKE_GEN: ${{ matrix.cmake-gen }} run: | PATH=$GITHUB_WORKSPACE:$PATH \ - cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -G $CMAKE_GEN + cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -G "$CMAKE_GEN" - name: Build working-directory: ${{ runner.workspace }}/build From dbd54d06d5e24f737519f5a8d38b123be2b6329b Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 20 Sep 2020 13:20:39 +1000 Subject: [PATCH 37/71] ci: set DYLD_LIBRARY_PATH --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6ab79116..d53ea339c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -190,6 +190,7 @@ jobs: env: BUNDLE_NAME: Olive.app run: | + export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib mv app/$BUNDLE_NAME . macdeployqt $BUNDLE_NAME curl -fLOSs --retry 3 https://github.com/arl/macdeployqtfix/raw/master/macdeployqtfix.py From 9e49224406e9ffbea04a685f1f7370342cf0de5d Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 00:51:31 +1000 Subject: [PATCH 38/71] crashpad: correct handler path on non-Windows systems --- app/common/crashpadinterface.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/common/crashpadinterface.cpp b/app/common/crashpadinterface.cpp index 6c55ab45e..770e8a84a 100644 --- a/app/common/crashpadinterface.cpp +++ b/app/common/crashpadinterface.cpp @@ -81,7 +81,11 @@ bool InitializeCrashpad() // FIXME: On Linux, probably should put this in a subdir so that it doesn't conflict with // anything else in /usr/bin +#ifdef Q_OS_WINDOWS base::FilePath handler(TO_BASE_STRING_TYPE(QDir(exe_dir).filePath(QStringLiteral("crashpad_handler.exe")))); +#else + base::FilePath handler(TO_BASE_STRING_TYPE(QDir(exe_dir).filePath(QStringLiteral("crashpad_handler")))); +#endif base::FilePath reports_dir(TO_BASE_STRING_TYPE(QDir(OLIVE_NAMESPACE::FileFunctions::GetTempFilePath()).filePath("reports"))); From 3ea173c9c0a755d4906b69b9d65c8cbfc631fc47 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 03:48:13 +1000 Subject: [PATCH 39/71] ci: restructured deps --- .github/workflows/ci.yml | 242 +++++++++++++++------------------------ 1 file changed, 93 insertions(+), 149 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d53ea339c..cc829695d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,44 +15,46 @@ jobs: build-type: RelWithDebInfo compiler-name: MSVC 16.x os-name: Windows + os-arch: x86_64 os: windows-latest + cmake-gen: Ninja dep-suffix: win.7z extract-tool: 7z x - cmake-gen: Ninja - build: 2 build-type: RelWithDebInfo compiler-name: Clang LLVM os-name: macOS + os-arch: x86_64 os: macos-latest + cmake-gen: Unix Makefiles dep-suffix: mac.zip extract-tool: sudo unzip -d /usr/local -o - cmake-gen: Unix Makefiles name: | ${{ matrix.os-name }} <${{ matrix.compiler-name }}, ${{ matrix.build-type }}> runs-on: ${{ matrix.os }} + env: + DOWNLOAD_TOOL: curl -fLOSs --retry 3 + steps: - - name: Set package name + - name: Checkout Source Code + uses: actions/checkout@v2 + + - name: Automatically Generate Package Name shell: bash - if: matrix.os == 'windows-latest' + env: + PLATFORM: ${{ matrix.os-name }} + ARCH: ${{ matrix.os-arch }} run: | - echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-Windows-x86_64)" + echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-$PLATFORM-$ARCH)" - - name: Set package name - shell: bash - if: matrix.os == 'macos-latest' - run: | - echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-macOS)" - - - uses: actions/checkout@v2 - - - name: Create Build Environment + - name: Create Build Folder run: | cmake -E make_directory ${{ runner.workspace }}/build - - name: Enable Developer Command Prompt + - name: Enable Developer Command Prompt (Windows) uses: ilammy/msvc-dev-cmd@v1.3.0 if: matrix.os == 'windows-latest' @@ -67,7 +69,7 @@ jobs: DEP_SUFFIX: ${{ matrix.dep-suffix }} EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | - curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/ffmpeg-$DEP_SUFFIX + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/ffmpeg-$DEP_SUFFIX $EXTRACT_TOOL ffmpeg-$DEP_SUFFIX - name: Acquire OpenColorIO @@ -76,7 +78,7 @@ jobs: DEP_SUFFIX: ${{ matrix.dep-suffix }} EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | - curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/ocio-$DEP_SUFFIX + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/ocio-$DEP_SUFFIX $EXTRACT_TOOL ocio-$DEP_SUFFIX - name: Acquire OpenEXR @@ -85,7 +87,7 @@ jobs: DEP_SUFFIX: ${{ matrix.dep-suffix }} EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | - curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/openexr-$DEP_SUFFIX + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/openexr-$DEP_SUFFIX $EXTRACT_TOOL openexr-$DEP_SUFFIX - name: Acquire OpenImageIO @@ -94,62 +96,16 @@ jobs: DEP_SUFFIX: ${{ matrix.dep-suffix }} EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | - curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/oiio-$DEP_SUFFIX + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/oiio-$DEP_SUFFIX $EXTRACT_TOOL oiio-$DEP_SUFFIX - - name: Acquire libpng - shell: bash - env: - DEP_SUFFIX: ${{ matrix.dep-suffix }} - EXTRACT_TOOL: ${{ matrix.extract-tool }} - run: | - curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/libpng-$DEP_SUFFIX - $EXTRACT_TOOL libpng-$DEP_SUFFIX - - - name: Acquire libtiff - shell: bash - env: - DEP_SUFFIX: ${{ matrix.dep-suffix }} - EXTRACT_TOOL: ${{ matrix.extract-tool }} - run: | - curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/libtiff-$DEP_SUFFIX - $EXTRACT_TOOL libtiff-$DEP_SUFFIX - - - name: Acquire turbojpeg - shell: bash - env: - DEP_SUFFIX: ${{ matrix.dep-suffix }} - EXTRACT_TOOL: ${{ matrix.extract-tool }} - run: | - curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/turbojpeg-$DEP_SUFFIX - $EXTRACT_TOOL turbojpeg-$DEP_SUFFIX - - - name: Acquire zlib - shell: bash - env: - DEP_SUFFIX: ${{ matrix.dep-suffix }} - EXTRACT_TOOL: ${{ matrix.extract-tool }} - run: | - curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/zlib-$DEP_SUFFIX - $EXTRACT_TOOL zlib-$DEP_SUFFIX - if: matrix.os == 'windows-latest' - - - name: Acquire Boost - shell: bash - env: - DEP_SUFFIX: ${{ matrix.dep-suffix }} - EXTRACT_TOOL: ${{ matrix.extract-tool }} - run: | - curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/boost-$DEP_SUFFIX - $EXTRACT_TOOL boost-$DEP_SUFFIX - - name: Acquire Crashpad shell: bash env: DEP_SUFFIX: ${{ matrix.dep-suffix }} EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | - curl -fLOSs --retry 3 http://olivevideoeditor.org/deps/crashpad-$DEP_SUFFIX + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/crashpad-$DEP_SUFFIX $EXTRACT_TOOL crashpad-$DEP_SUFFIX - name: Configure CMake @@ -175,112 +131,100 @@ jobs: - name: Create Package working-directory: ${{ runner.workspace }}/build - shell: cmd - run: | - mkdir olive-editor - copy app\olive-editor.exe olive-editor - copy app\olive-editor.pdb olive-editor - windeployqt olive-editor\olive-editor.exe - copy %GITHUB_WORKSPACE%\bin\*.dll olive-editor - copy %GITHUB_WORKSPACE%\out\Default\crashpad_handler.exe olive-editor - if: matrix.os == 'windows-latest' - - - name: Create Package - working-directory: ${{ runner.workspace }}/build + shell: bash env: - BUNDLE_NAME: Olive.app + PLATFORM: ${{ matrix.os-name }} run: | - export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib - mv app/$BUNDLE_NAME . - macdeployqt $BUNDLE_NAME - curl -fLOSs --retry 3 https://github.com/arl/macdeployqtfix/raw/master/macdeployqtfix.py - python2 macdeployqtfix.py $BUNDLE_NAME/Contents/MacOS/Olive /usr/local/Cellar/qt5/5.*/ - if: matrix.os == 'macos-latest' + if [ "$PLATFORM" == "Windows" ] + then + mkdir olive-editor + cp app/olive-editor.exe olive-editor + cp app/olive-editor.pdb olive-editor + windeployqt olive-editor/olive-editor.exe + copy $GITHUB_WORKSPACE/bin/*.dll olive-editor + copy $GITHUB_WORKSPACE/out/Default/crashpad_handler.exe olive-editor + elif [ "$PLATFORM" == "macOS" ] + then + export BUNDLE_NAME=Olive.app + mv app/$BUNDLE_NAME . + macdeployqt $BUNDLE_NAME + $DOWNLOAD_TOOL https://github.com/arl/macdeployqtfix/raw/master/macdeployqtfix.py + python2 macdeployqtfix.py $BUNDLE_NAME/Contents/MacOS/Olive /usr/local/Cellar/qt5/5.*/ + fi - - name: Deploy Installer + - name: Deploy Packages working-directory: ${{ runner.workspace }}/build - shell: cmd + shell: bash + env: + PLATFORM: ${{ matrix.os-name }} run: | - curl -fLOSs https://download.microsoft.com/download/3/2/2/3224B87F-CFA0-4E70-BDA3-3DE650EFEBA5/vcredist_x64.exe - copy %GITHUB_WORKSPACE%\app\packaging\windows\nsis\* . - copy %GITHUB_WORKSPACE%\LICENSE . - makensis -V4 -DX64 "-XOutFile %PKGNAME%.exe" olive.nsi - if: matrix.os == 'windows-latest' + if [ "$PLATFORM" == "Windows" ] + then + # Create Installer Executable + curl -fLOSs https://download.microsoft.com/download/3/2/2/3224B87F-CFA0-4E70-BDA3-3DE650EFEBA5/vcredist_x64.exe + copy $GITHUB_WORKSPACE\app\packaging\windows\nsis\* . + copy $GITHUB_WORKSPACE\LICENSE . + makensis -V4 -DX64 "-XOutFile $PKGNAME.exe" olive.nsi - - name: Deploy Portable - working-directory: ${{ runner.workspace }}/build - shell: cmd - run: | - type NUL > olive-editor\portable - 7z a %PKGNAME%.zip olive-editor - if: matrix.os == 'windows-latest' + # Create Portable ZIP + type NUL > olive-editor\portable + 7z a $PKGNAME.zip olive-editor + elif [ "$PLATFORM" == "macOS" ] + then + zip -r $PKGNAME.zip Olive.app + fi - - name: Deploy Package - working-directory: ${{ runner.workspace }}/build - run: | - zip -r $PKGNAME.zip $BUNDLE_NAME - if: matrix.os == 'macos-latest' - - - name: Upload Installer to Nightly Page + - name: Upload Packages to Nightly Page shell: bash working-directory: ${{ runner.workspace }}/build env: GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} + PLATFORM: ${{ matrix.os-name }} run: | - curl -X POST \ - -F file=@$PKGNAME.exe \ - -F key="$GH_AUTH_KEY" \ - -F hash="$GITHUB_SHA" \ - -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ - -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ - https://olivevideoeditor.org/dl/push.php - if: matrix.os == 'windows-latest' && github.event_name != 'pull_request' + if [ "$PLATFORM" == "Windows" ] + then + curl -X POST \ + -F file=@$PKGNAME.exe \ + -F key="$GH_AUTH_KEY" \ + -F hash="$GITHUB_SHA" \ + -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ + -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ + https://olivevideoeditor.org/dl/push.php - - name: Upload Portable to Nightly Page - shell: bash - working-directory: ${{ runner.workspace }}/build - env: - GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} - run: | - curl -X POST \ - -F file=@$PKGNAME.zip \ - -F key="$GH_AUTH_KEY" \ - -F hash="$GITHUB_SHA" \ - -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ - -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ - https://olivevideoeditor.org/dl/push.php - if: matrix.os == 'windows-latest' && github.event_name != 'pull_request' + curl -X POST \ + -F file=@$PKGNAME.zip \ + -F key="$GH_AUTH_KEY" \ + -F hash="$GITHUB_SHA" \ + -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ + -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ + https://olivevideoeditor.org/dl/push.php + elif [ "$PLATFORM" == "macOS" ] + then + curl -X POST \ + -F file=@$PKGNAME.zip \ + -F key="$GH_AUTH_KEY" \ + -F hash="$GITHUB_SHA" \ + -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ + -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ + https://olivevideoeditor.org/dl/push.php + fi + if: github.event_name != 'pull_request' - - name: Upload Artifact to Nightly Page - shell: bash - working-directory: ${{ runner.workspace }}/build - env: - GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} - run: | - curl -X POST \ - -F file=@$PKGNAME.zip \ - -F key="$GH_AUTH_KEY" \ - -F hash="$GITHUB_SHA" \ - -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ - -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ - https://olivevideoeditor.org/dl/push.php - if: matrix.os == 'macos-latest' && github.event_name != 'pull_request' - - - name: Upload Installer Artifact to GitHub + - name: Upload Installer Artifact to GitHub (Windows) uses: actions/upload-artifact@v2 with: name: ${{ env.PKGNAME }}.exe path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.exe if: matrix.os == 'windows-latest' - - name: Upload Portable Artifact to GitHub + - name: Upload Portable Artifact to GitHub (Windows) uses: actions/upload-artifact@v2 with: name: ${{ env.PKGNAME }}.zip path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.zip if: matrix.os == 'windows-latest' - - name: Upload Artifact to GitHub + - name: Upload Artifact to GitHub (macOS) uses: actions/upload-artifact@v2 with: name: ${{ env.PKGNAME }}.zip @@ -289,14 +233,14 @@ jobs: - name: Export Crashpad Symbols and Upload To Server working-directory: ${{ runner.workspace }}/build - shell: cmd + shell: bash env: GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} run: | curl -fLSs --retry 3 https://github.com/google/breakpad/blob/master/src/tools/windows/binaries/dump_syms.exe?raw=true > dump_syms.exe - dump_syms app\olive-editor.pdb > olive-editor.sym + dump_syms app/olive-editor.pdb > olive-editor.sym curl -X POST ^ -F symfile=@olive-editor.sym ^ - -F key="%GH_AUTH_KEY%" ^ + -F key="$GH_AUTH_KEY" ^ https://olivevideoeditor.org/crashpad/symbols.php if: matrix.os == 'windows-latest' From ff188d44b19fe2c5847ce1b176e12111745b4319 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 04:15:41 +1000 Subject: [PATCH 40/71] ci: use bash syntax on crashpad step --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc829695d..3318b60a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -238,7 +238,7 @@ jobs: GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} run: | curl -fLSs --retry 3 https://github.com/google/breakpad/blob/master/src/tools/windows/binaries/dump_syms.exe?raw=true > dump_syms.exe - dump_syms app/olive-editor.pdb > olive-editor.sym + ./dump_syms app/olive-editor.pdb > olive-editor.sym curl -X POST ^ -F symfile=@olive-editor.sym ^ -F key="$GH_AUTH_KEY" ^ From f9af69ca81965cf1ff08b1714a2c794fd04de4e4 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 04:15:52 +1000 Subject: [PATCH 41/71] mathbase: use sample indices and copy rather than zeroing out --- app/node/math/math/mathbase.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/node/math/math/mathbase.cpp b/app/node/math/math/mathbase.cpp index 4a793af93..731a750da 100644 --- a/app/node/math/math/mathbase.cpp +++ b/app/node/math/math/mathbase.cpp @@ -248,8 +248,8 @@ NodeValueTable MathNodeBase::ValueInternal(NodeValueDatabase &value, Operation o SampleBufferPtr mixed_samples = SampleBuffer::CreateAllocated(samples_a->audio_params(), max_samples); - // Mix samples that are in both buffers for (int i=0;iaudio_params().channel_count();i++) { + // Mix samples that are in both buffers for (int j=0;jdata()[i][j] = PerformAll(operation, samples_a->data()[i][j], samples_b->data()[i][j]); } @@ -259,9 +259,11 @@ NodeValueTable MathNodeBase::ValueInternal(NodeValueDatabase &value, Operation o // Fill in remainder space with 0s int remainder = max_samples - min_samples; + SampleBufferPtr larger_buffer = (max_samples == samples_a->sample_count()) ? samples_a : samples_b; + for (int i=0;iaudio_params().channel_count();i++) { - memset(mixed_samples->data()[i] + min_samples * sizeof(float), - 0, + memcpy(&mixed_samples->data()[i][min_samples], + &larger_buffer->data()[i][min_samples], remainder * sizeof(float)); } } From 82ceef20139fa9bcb869fcdde7affa173a48acbf Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 04:44:55 +1000 Subject: [PATCH 42/71] audio: don't write samples if channel count is zero --- app/audio/audiovisualwaveform.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/app/audio/audiovisualwaveform.cpp b/app/audio/audiovisualwaveform.cpp index 08c6c27b0..9cba6f755 100644 --- a/app/audio/audiovisualwaveform.cpp +++ b/app/audio/audiovisualwaveform.cpp @@ -37,6 +37,7 @@ void AudioVisualWaveform::OverwriteSamples(SampleBufferPtr samples, int sample_r { if (!channels_) { qWarning() << "Failed to write samples - channel count is zero"; + return; } int start_index = time_to_samples(start); From 7bc1aee71b62bc7b8b0aea3f07b93826387e5ce7 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 04:44:59 +1000 Subject: [PATCH 43/71] ci: updated more syntax for bash --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3318b60a8..0186f9a3c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -239,8 +239,8 @@ jobs: run: | curl -fLSs --retry 3 https://github.com/google/breakpad/blob/master/src/tools/windows/binaries/dump_syms.exe?raw=true > dump_syms.exe ./dump_syms app/olive-editor.pdb > olive-editor.sym - curl -X POST ^ - -F symfile=@olive-editor.sym ^ - -F key="$GH_AUTH_KEY" ^ + curl -X POST \ + -F symfile=@olive-editor.sym \ + -F key="$GH_AUTH_KEY" \ https://olivevideoeditor.org/crashpad/symbols.php if: matrix.os == 'windows-latest' From 16da806a032d85d286333e25f61e8fa61512cc62 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 05:00:06 +1000 Subject: [PATCH 44/71] ci: try os instead of os-name --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0186f9a3c..cc9093f2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -133,17 +133,17 @@ jobs: working-directory: ${{ runner.workspace }}/build shell: bash env: - PLATFORM: ${{ matrix.os-name }} + MATRIX_OS: ${{ matrix.os }} run: | - if [ "$PLATFORM" == "Windows" ] + if [ "$MATRIX_OS" == "windows-latest" ] then mkdir olive-editor cp app/olive-editor.exe olive-editor cp app/olive-editor.pdb olive-editor windeployqt olive-editor/olive-editor.exe - copy $GITHUB_WORKSPACE/bin/*.dll olive-editor - copy $GITHUB_WORKSPACE/out/Default/crashpad_handler.exe olive-editor - elif [ "$PLATFORM" == "macOS" ] + cp $GITHUB_WORKSPACE/bin/*.dll olive-editor + cp $GITHUB_WORKSPACE/out/Default/crashpad_handler.exe olive-editor + elif [ "$MATRIX_OS" == "macos-latest " ] then export BUNDLE_NAME=Olive.app mv app/$BUNDLE_NAME . @@ -162,12 +162,12 @@ jobs: then # Create Installer Executable curl -fLOSs https://download.microsoft.com/download/3/2/2/3224B87F-CFA0-4E70-BDA3-3DE650EFEBA5/vcredist_x64.exe - copy $GITHUB_WORKSPACE\app\packaging\windows\nsis\* . - copy $GITHUB_WORKSPACE\LICENSE . + cp $GITHUB_WORKSPACE/app/packaging/windows/nsis/* . + cp $GITHUB_WORKSPACE/LICENSE . makensis -V4 -DX64 "-XOutFile $PKGNAME.exe" olive.nsi # Create Portable ZIP - type NUL > olive-editor\portable + echo -n > olive-editor/portable 7z a $PKGNAME.zip olive-editor elif [ "$PLATFORM" == "macOS" ] then From f25c3680cbbac1e8759198adc3ba717a52f968bd Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 05:13:12 +1000 Subject: [PATCH 45/71] ci: use relative path for cp command --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc9093f2e..fee0103e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -141,8 +141,8 @@ jobs: cp app/olive-editor.exe olive-editor cp app/olive-editor.pdb olive-editor windeployqt olive-editor/olive-editor.exe - cp $GITHUB_WORKSPACE/bin/*.dll olive-editor - cp $GITHUB_WORKSPACE/out/Default/crashpad_handler.exe olive-editor + cp ../bin/*.dll olive-editor + cp ../out/Default/crashpad_handler.exe olive-editor elif [ "$MATRIX_OS" == "macos-latest " ] then export BUNDLE_NAME=Olive.app @@ -156,20 +156,20 @@ jobs: working-directory: ${{ runner.workspace }}/build shell: bash env: - PLATFORM: ${{ matrix.os-name }} + MATRIX_OS: ${{ matrix.os }} run: | - if [ "$PLATFORM" == "Windows" ] + if [ "$MATRIX_OS" == "windows-latest" ] then # Create Installer Executable curl -fLOSs https://download.microsoft.com/download/3/2/2/3224B87F-CFA0-4E70-BDA3-3DE650EFEBA5/vcredist_x64.exe - cp $GITHUB_WORKSPACE/app/packaging/windows/nsis/* . - cp $GITHUB_WORKSPACE/LICENSE . + cp ../app/packaging/windows/nsis/* . + cp ../LICENSE . makensis -V4 -DX64 "-XOutFile $PKGNAME.exe" olive.nsi # Create Portable ZIP echo -n > olive-editor/portable 7z a $PKGNAME.zip olive-editor - elif [ "$PLATFORM" == "macOS" ] + elif [ "$MATRIX_OS" == "macos-latest" ] then zip -r $PKGNAME.zip Olive.app fi @@ -179,9 +179,9 @@ jobs: working-directory: ${{ runner.workspace }}/build env: GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} - PLATFORM: ${{ matrix.os-name }} + MATRIX_OS: ${{ matrix.os }} run: | - if [ "$PLATFORM" == "Windows" ] + if [ "$MATRIX_OS" == "windows-latest" ] then curl -X POST \ -F file=@$PKGNAME.exe \ @@ -198,7 +198,7 @@ jobs: -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ https://olivevideoeditor.org/dl/push.php - elif [ "$PLATFORM" == "macOS" ] + elif [ "$MATRIX_OS" == "macos-latest" ] then curl -X POST \ -F file=@$PKGNAME.zip \ From 038f54ae18487e2421e4b85048db053596281ce2 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 05:28:41 +1000 Subject: [PATCH 46/71] ci: use cygpath to retrieve path from env --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fee0103e2..bf790662a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -141,8 +141,8 @@ jobs: cp app/olive-editor.exe olive-editor cp app/olive-editor.pdb olive-editor windeployqt olive-editor/olive-editor.exe - cp ../bin/*.dll olive-editor - cp ../out/Default/crashpad_handler.exe olive-editor + cp $(cygpath $GITHUB_WORKSPACE)/bin/*.dll olive-editor + cp $(cygpath $GITHUB_WORKSPACE)/out/Default/crashpad_handler.exe olive-editor elif [ "$MATRIX_OS" == "macos-latest " ] then export BUNDLE_NAME=Olive.app @@ -162,8 +162,8 @@ jobs: then # Create Installer Executable curl -fLOSs https://download.microsoft.com/download/3/2/2/3224B87F-CFA0-4E70-BDA3-3DE650EFEBA5/vcredist_x64.exe - cp ../app/packaging/windows/nsis/* . - cp ../LICENSE . + cp $(cygpath $GITHUB_WORKSPACE)/app/packaging/windows/nsis/* . + cp $(cygpath $GITHUB_WORKSPACE)/LICENSE . makensis -V4 -DX64 "-XOutFile $PKGNAME.exe" olive.nsi # Create Portable ZIP From ea36185a52b4eb06ddd7d106fbcdd4ad6d815fad Mon Sep 17 00:00:00 2001 From: Simran Date: Mon, 21 Sep 2020 00:55:34 +0200 Subject: [PATCH 47/71]
for backtrace, HTML comment for explanation --- .github/ISSUE_TEMPLATE/01-crash_issue.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/01-crash_issue.md b/.github/ISSUE_TEMPLATE/01-crash_issue.md index 0b68b7202..da0786f8e 100644 --- a/.github/ISSUE_TEMPLATE/01-crash_issue.md +++ b/.github/ISSUE_TEMPLATE/01-crash_issue.md @@ -6,14 +6,26 @@ labels: "Crash, Triage" assignees: '' --- -**Commit Hash (8 character string of letters/numbers in title bar)** +**Commit Hash** + **Platform** + **Summary** + **Steps to Reproduce** -**Backtrace** +1. +2. +3. + +
Backtrace

+
+Paste backtrace here
+
+
**Additional Information** + From 15ecf755fcd1f8b6bdc2bab252ebf135e7237016 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 10:55:55 +1000 Subject: [PATCH 48/71] ci: remove extraneous space --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf790662a..07ebcbdd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -143,7 +143,7 @@ jobs: windeployqt olive-editor/olive-editor.exe cp $(cygpath $GITHUB_WORKSPACE)/bin/*.dll olive-editor cp $(cygpath $GITHUB_WORKSPACE)/out/Default/crashpad_handler.exe olive-editor - elif [ "$MATRIX_OS" == "macos-latest " ] + elif [ "$MATRIX_OS" == "macos-latest" ] then export BUNDLE_NAME=Olive.app mv app/$BUNDLE_NAME . From 01cab2131785e65e8ba4d2ac28e56597c16ace7d Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 11:56:41 +1000 Subject: [PATCH 49/71] cmake: set minimum deployment target --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c0f423c5..82cb7d22f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,8 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC ON) +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13") + set(OLIVE_DEFINITIONS -DAPPVERSION="${PROJECT_VERSION}" -DQT_DEPRECATED_WARNINGS) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") From bb5669c305429edf6159f78a34e9948a31f25adf Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 11:56:53 +1000 Subject: [PATCH 50/71] ci: fix ocio lib path --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07ebcbdd7..c5bd259ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -147,6 +147,10 @@ jobs: then export BUNDLE_NAME=Olive.app mv app/$BUNDLE_NAME . + + # HACK: OCIO doesn't link it's library properly so we need to manually correct + install_name_tool -change libOpenColorIO.1.dylib /usr/local/lib/libOpenColorIO.1.dylib $BUNDLE_NAME/Contents/MacOS/Olive + macdeployqt $BUNDLE_NAME $DOWNLOAD_TOOL https://github.com/arl/macdeployqtfix/raw/master/macdeployqtfix.py python2 macdeployqtfix.py $BUNDLE_NAME/Contents/MacOS/Olive /usr/local/Cellar/qt5/5.*/ From 7bdaf78af859538c3aff72392334565b68b7071a Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 12:21:17 +1000 Subject: [PATCH 51/71] oiio: assume it's not an image sequence if the dimensions aren't equal --- app/codec/oiio/oiiodecoder.cpp | 29 +++++++++++++++++++++++++++-- app/codec/oiio/oiiodecoder.h | 2 ++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/app/codec/oiio/oiiodecoder.cpp b/app/codec/oiio/oiiodecoder.cpp index 395284c44..bfaf46960 100644 --- a/app/codec/oiio/oiiodecoder.cpp +++ b/app/codec/oiio/oiiodecoder.cpp @@ -68,11 +68,17 @@ bool OIIODecoder::Probe(Footage *f, const QAtomicInt *cancelled) // Heuristically determine whether this file is part of an image sequence or not if (GetImageSequenceDigitCount(f->filename()) > 0) { + QSize dim(in->spec().width, in->spec().height); + int64_t ind = GetImageSequenceIndex(f->filename()); // Check if files around exist around it with that follow a sequence - if (QFileInfo::exists(TransformImageSequenceFileName(f->filename(), ind - 1)) - || QFileInfo::exists(TransformImageSequenceFileName(f->filename(), ind + 1))) { + QString previous_img_fn = TransformImageSequenceFileName(f->filename(), ind - 1); + QString next_img_fn = TransformImageSequenceFileName(f->filename(), ind + 1); + + // GetImageDimensions will return a 0,0 size if the file doesn't exist, so it's safe to check + // both existence and matching size with this + if (GetImageDimensions(previous_img_fn) == dim || GetImageDimensions(next_img_fn) == dim) { // We need user feedback here and since UI must occur in the UI thread (and we could be in any thread), we defer // to the Core which will definitely be in the UI thread and block here until we get an answer from the user QMetaObject::invokeMethod(Core::instance(), @@ -316,6 +322,25 @@ bool OIIODecoder::FileTypeIsSupported(const QString& fn) return true; } +QSize OIIODecoder::GetImageDimensions(const QString &fn) +{ + QSize sz; + auto in = OIIO::ImageInput::open(fn.toStdString()); + + if (in) { + sz.setWidth(in->spec().width); + sz.setHeight(in->spec().height); + + in->close(); + +#if OIIO_VERSION < 10903 + OIIO::ImageInput::destroy(in); +#endif + } + + return sz; +} + bool OIIODecoder::OpenImageHandler(const QString &fn) { image_ = OIIO::ImageInput::open(fn.toStdString()); diff --git a/app/codec/oiio/oiiodecoder.h b/app/codec/oiio/oiiodecoder.h index ff278fa63..979923be2 100644 --- a/app/codec/oiio/oiiodecoder.h +++ b/app/codec/oiio/oiiodecoder.h @@ -68,6 +68,8 @@ private: static bool FileTypeIsSupported(const QString& fn); + static QSize GetImageDimensions(const QString& fn); + bool OpenImageHandler(const QString& fn); void CloseImageHandle(); From 9a46fc58911e87de86b52e34f9571d5fe656db16 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 12:28:47 +1000 Subject: [PATCH 52/71] cache: invalidate AFTER iterating map Fixes #1183 --- app/render/framehashcache.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/render/framehashcache.cpp b/app/render/framehashcache.cpp index b65234dc5..387baa12e 100644 --- a/app/render/framehashcache.cpp +++ b/app/render/framehashcache.cpp @@ -358,12 +358,17 @@ void FrameHashCache::HashDeleted(const QString& s, const QByteArray &hash) return; } + TimeRangeList ranges_to_invalidate; QMap::const_iterator i; for (i=time_hash_map_.constBegin(); i!=time_hash_map_.constEnd(); i++) { if (i.value() == hash) { - Invalidate(TimeRange(i.key(), i.key() + timebase_)); + ranges_to_invalidate.InsertTimeRange(TimeRange(i.key(), i.key() + timebase_)); } } + + foreach (const TimeRange& range, ranges_to_invalidate) { + Invalidate(range); + } } void FrameHashCache::ProjectInvalidated(Project *p) From 8f5688b0fdda931ca79e51185d787a1c044e84ac Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 13:02:32 +1000 Subject: [PATCH 53/71] ci: corrected old ocio lib path --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5bd259ef..46b236843 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -149,7 +149,7 @@ jobs: mv app/$BUNDLE_NAME . # HACK: OCIO doesn't link it's library properly so we need to manually correct - install_name_tool -change libOpenColorIO.1.dylib /usr/local/lib/libOpenColorIO.1.dylib $BUNDLE_NAME/Contents/MacOS/Olive + install_name_tool -change /usr/lib/libOpenColorIO.1.dylib /usr/local/lib/libOpenColorIO.1.dylib $BUNDLE_NAME/Contents/MacOS/Olive macdeployqt $BUNDLE_NAME $DOWNLOAD_TOOL https://github.com/arl/macdeployqtfix/raw/master/macdeployqtfix.py From e4b6d72b59b3cf0dfe6a027cfc26e6af91e65b38 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 13:48:00 +1000 Subject: [PATCH 54/71] use rpath instead of absolute path --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46b236843..5d8c1a4b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -149,7 +149,7 @@ jobs: mv app/$BUNDLE_NAME . # HACK: OCIO doesn't link it's library properly so we need to manually correct - install_name_tool -change /usr/lib/libOpenColorIO.1.dylib /usr/local/lib/libOpenColorIO.1.dylib $BUNDLE_NAME/Contents/MacOS/Olive + install_name_tool -change libOpenColorIO.1.dylib @rpath/libOpenColorIO.1.dylib $BUNDLE_NAME/Contents/MacOS/Olive macdeployqt $BUNDLE_NAME $DOWNLOAD_TOOL https://github.com/arl/macdeployqtfix/raw/master/macdeployqtfix.py From 90f28b6853b85766403ef165bbb3009a06593281 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 15:28:08 +1000 Subject: [PATCH 55/71] updated readme for new release/actions workflow --- README.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9b95c2b60..9291d1b77 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,17 @@ -# Olive Video Editor [![Build Status](https://travis-ci.org/olive-editor/olive.svg?branch=master)](https://travis-ci.org/olive-editor/olive) [![Build Status](https://ci.appveyor.com/api/projects/status/5s4jabxayg51rv95?svg=true)](https://ci.appveyor.com/project/itsmattkc/olive) +# Olive Video Editor [![Build status](https://github.com/olive-editor/olive/workflows/CI/badge.svg?branch=master)](https://github.com/olive-editor/olive/actions?query=branch%3Amaster) Olive is a free non-linear video editor for Windows, macOS, and Linux. -![screen](https://www.olivevideoeditor.org/img/screenshot.jpg) +![screen](https://olivevideoeditor.org/img/020-2.png) -**Discover more:** [Website](https://www.olivevideoeditor.org/) | [Twitter](https://twitter.com/oliveteam) | [Discord](https://discord.gg/4Ae9KZn) | [Patreon](https://www.patreon.com/olivevideoeditor) - -## Getting Started with Olive: - -Binaries of Olive are available at: https://olivevideoeditor.org/download.php - -Some tutorials can be seen on the GitHub Wiki: https://github.com/olive-editor/olive/wiki/Overview-Guide +**Discover more:** [Website](https://www.olivevideoeditor.org/) | [Binaries](https://olivevideoeditor.org/download.php) | [Twitter](https://twitter.com/oliveteam) | [Discord](https://discord.gg/4Ae9KZn) | [Patreon](https://www.patreon.com/olivevideoeditor) | [Tutorials](https://github.com/olive-editor/olive/wiki/Overview-Guide) **NOTE: Olive is alpha software and is considered highly unstable. While we highly appreciate users testing and providing usage information, please use at your own risk.** +## Binaries + +[Nightly binaries are available on the website.](https://olivevideoeditor.org/download.php) + ## Support Olive: Please consider supporting Olive: From 871bc08c1214f87feec78ebc5d60657410c11abf Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 21 Sep 2020 17:28:28 +1000 Subject: [PATCH 56/71] Revert "renderer: if texture is null, don't allocate a frame unless exporting" This reverts commit 8e0c86a6fa7bc32bd2177d8b72f19f6a4f92d8e9. Fixes #1209 --- app/render/backend/renderworker.cpp | 2 +- app/widget/viewer/viewerdisplay.cpp | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/render/backend/renderworker.cpp b/app/render/backend/renderworker.cpp index 2db075c25..28e8a50f5 100644 --- a/app/render/backend/renderworker.cpp +++ b/app/render/backend/renderworker.cpp @@ -126,7 +126,7 @@ void RenderWorker::RenderFrame(RenderTicketPtr ticket, ViewerOutput* viewer, con FramePtr frame = Frame::Create(); frame->set_timestamp(time); - if (video_force_download_resolution_) { + if (video_force_download_resolution_ || texture.isNull()) { // If we're setting the resolution ourselves or we're zeroing it out, allocate the frame now frame->set_video_params(VideoParams(video_params_.width(), video_params_.height(), diff --git a/app/widget/viewer/viewerdisplay.cpp b/app/widget/viewer/viewerdisplay.cpp index 25f13ac58..983f422e1 100644 --- a/app/widget/viewer/viewerdisplay.cpp +++ b/app/widget/viewer/viewerdisplay.cpp @@ -99,11 +99,7 @@ void ViewerDisplayWidget::SetSignalCursorColorEnabled(bool e) void ViewerDisplayWidget::SetImage(FramePtr in_buffer) { - if (in_buffer && in_buffer->is_allocated()) { - last_loaded_buffer_ = in_buffer; - } else { - last_loaded_buffer_ = nullptr; - } + last_loaded_buffer_ = in_buffer; if (last_loaded_buffer_) { makeCurrent(); From 82d12a58ca09214317875cc2e61d8e4addb31638 Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Tue, 22 Sep 2020 02:08:53 +0200 Subject: [PATCH 57/71] Extra spacing, unify commit hash text --- .github/ISSUE_TEMPLATE/00-olive_unsupported.md | 1 - .github/ISSUE_TEMPLATE/01-crash_issue.md | 4 +--- .github/ISSUE_TEMPLATE/50-build_issue.md | 6 ++++-- .github/ISSUE_TEMPLATE/50-cache_issue.md | 6 ++++-- .github/ISSUE_TEMPLATE/50-codec_issue.md | 6 ++++-- .github/ISSUE_TEMPLATE/50-color_issue.md | 6 ++++-- .github/ISSUE_TEMPLATE/50-editing_issue.md | 6 ++++-- .github/ISSUE_TEMPLATE/50-export_issue.md | 6 ++++-- .github/ISSUE_TEMPLATE/50-node_issue.md | 6 ++++-- .github/ISSUE_TEMPLATE/50-playback_issue.md | 6 ++++-- .github/ISSUE_TEMPLATE/50-project_issue.md | 6 ++++-- .github/ISSUE_TEMPLATE/50-renderer_issue.md | 6 ++++-- .github/ISSUE_TEMPLATE/50-ui_issue.md | 6 ++++-- 13 files changed, 45 insertions(+), 26 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/00-olive_unsupported.md b/.github/ISSUE_TEMPLATE/00-olive_unsupported.md index 700c5c1cb..88e715ff8 100644 --- a/.github/ISSUE_TEMPLATE/00-olive_unsupported.md +++ b/.github/ISSUE_TEMPLATE/00-olive_unsupported.md @@ -5,7 +5,6 @@ title: "[UNSUPPORTED]" labels: "Legacy (Unsupported)" assignees: '' --- - # Olive 0.1 is unsupported Unfortunately no one is supporting Olive 0.1 at this time. Any reports pertaining to it will be diff --git a/.github/ISSUE_TEMPLATE/01-crash_issue.md b/.github/ISSUE_TEMPLATE/01-crash_issue.md index da0786f8e..87e916dee 100644 --- a/.github/ISSUE_TEMPLATE/01-crash_issue.md +++ b/.github/ISSUE_TEMPLATE/01-crash_issue.md @@ -4,7 +4,6 @@ about: Report a fatal crash that resulted in Olive unexpectedly closing. title: "[CRASH]" labels: "Crash, Triage" assignees: '' - --- **Commit Hash** @@ -23,9 +22,8 @@ assignees: ''
Backtrace

 
-Paste backtrace here
+
 
 
**Additional Information** - diff --git a/.github/ISSUE_TEMPLATE/50-build_issue.md b/.github/ISSUE_TEMPLATE/50-build_issue.md index 8d93ad06d..155c7c750 100644 --- a/.github/ISSUE_TEMPLATE/50-build_issue.md +++ b/.github/ISSUE_TEMPLATE/50-build_issue.md @@ -4,12 +4,14 @@ about: Report an issue related to compiling or packaging (including continuous i title: "[BUILD]" labels: "Building/Packaging, Triage" assignees: '' - --- -**Commit Hash (8 character string of letters/numbers in title bar)** +**Commit Hash** + **Platform** + **Summary** + **Additional Information / Output** diff --git a/.github/ISSUE_TEMPLATE/50-cache_issue.md b/.github/ISSUE_TEMPLATE/50-cache_issue.md index 0d088aa8c..f346d8245 100644 --- a/.github/ISSUE_TEMPLATE/50-cache_issue.md +++ b/.github/ISSUE_TEMPLATE/50-cache_issue.md @@ -4,12 +4,14 @@ about: Report an issue related to the disk cache system, including failure to c title: "[CACHE]" labels: "Disk Cache, Triage" assignees: '' - --- -**Commit Hash (8 character string of letters/numbers in title bar)** +**Commit Hash** + **Platform** + **Summary** + **Additional Information / Output** diff --git a/.github/ISSUE_TEMPLATE/50-codec_issue.md b/.github/ISSUE_TEMPLATE/50-codec_issue.md index 04082833f..09fc991ac 100644 --- a/.github/ISSUE_TEMPLATE/50-codec_issue.md +++ b/.github/ISSUE_TEMPLATE/50-codec_issue.md @@ -4,12 +4,14 @@ about: Report an issue related to codec handling, including importing footage or title: "[CODEC]" labels: "Codec, Triage" assignees: '' - --- -**Commit Hash (8 character string of letters/numbers in title bar)** +**Commit Hash** + **Platform** + **Summary** + **Additional Information / Output** diff --git a/.github/ISSUE_TEMPLATE/50-color_issue.md b/.github/ISSUE_TEMPLATE/50-color_issue.md index 99889a56b..99e4c803c 100644 --- a/.github/ISSUE_TEMPLATE/50-color_issue.md +++ b/.github/ISSUE_TEMPLATE/50-color_issue.md @@ -4,12 +4,14 @@ about: Report an issue related to the management of pixels and color, including title: "[COLOR]" labels: "Color Management, Triage" assignees: '' - --- -**Commit Hash (8 character string of letters/numbers in title bar)** +**Commit Hash** + **Platform** + **Summary** + **Additional Information / Output** diff --git a/.github/ISSUE_TEMPLATE/50-editing_issue.md b/.github/ISSUE_TEMPLATE/50-editing_issue.md index 0465e88a5..88d2f16c1 100644 --- a/.github/ISSUE_TEMPLATE/50-editing_issue.md +++ b/.github/ISSUE_TEMPLATE/50-editing_issue.md @@ -4,12 +4,14 @@ about: Report an issue related to the overall editing experience, including usa title: "[EDIT]" labels: "Timeline/Editing, Triage" assignees: '' - --- -**Commit Hash (8 character string of letters/numbers in title bar)** +**Commit Hash** + **Platform** + **Summary** + **Additional Information / Output** diff --git a/.github/ISSUE_TEMPLATE/50-export_issue.md b/.github/ISSUE_TEMPLATE/50-export_issue.md index 7ccef22fc..4e6e1f3a2 100644 --- a/.github/ISSUE_TEMPLATE/50-export_issue.md +++ b/.github/ISSUE_TEMPLATE/50-export_issue.md @@ -4,12 +4,14 @@ about: Report an issue related to exporting videos from Olive, including errors title: "[EXPORT]" labels: "Export, Triage" assignees: '' - --- -**Commit Hash (8 character string of letters/numbers in title bar)** +**Commit Hash** + **Platform** + **Summary** + **Additional Information / Output** diff --git a/.github/ISSUE_TEMPLATE/50-node_issue.md b/.github/ISSUE_TEMPLATE/50-node_issue.md index 4d15ecebe..ec31c8989 100644 --- a/.github/ISSUE_TEMPLATE/50-node_issue.md +++ b/.github/ISSUE_TEMPLATE/50-node_issue.md @@ -4,12 +4,14 @@ about: Report an issue related to the node-based compositing system, including title: "[NODES]" labels: "Nodes/Compositing, Triage" assignees: '' - --- -**Commit Hash (8 character string of letters/numbers in title bar)** +**Commit Hash** + **Platform** + **Summary** + **Additional Information / Output** diff --git a/.github/ISSUE_TEMPLATE/50-playback_issue.md b/.github/ISSUE_TEMPLATE/50-playback_issue.md index 5e35446f5..32a3cc13b 100644 --- a/.github/ISSUE_TEMPLATE/50-playback_issue.md +++ b/.github/ISSUE_TEMPLATE/50-playback_issue.md @@ -4,12 +4,14 @@ about: Report an issue related to the playback of video or audio, including lag title: "[PLAYBACK]" labels: "Playback, Triage" assignees: '' - --- -**Commit Hash (8 character string of letters/numbers in title bar)** +**Commit Hash** + **Platform** + **Summary** + **Additional Information / Output** diff --git a/.github/ISSUE_TEMPLATE/50-project_issue.md b/.github/ISSUE_TEMPLATE/50-project_issue.md index fa65f393e..ff9175354 100644 --- a/.github/ISSUE_TEMPLATE/50-project_issue.md +++ b/.github/ISSUE_TEMPLATE/50-project_issue.md @@ -4,12 +4,14 @@ about: Report an issue related to project management, including working with an title: "[PROJECT]" labels: "Project, Triage" assignees: '' - --- -**Commit Hash (8 character string of letters/numbers in title bar)** +**Commit Hash** + **Platform** + **Summary** + **Additional Information / Output** diff --git a/.github/ISSUE_TEMPLATE/50-renderer_issue.md b/.github/ISSUE_TEMPLATE/50-renderer_issue.md index f97a22079..e77316402 100644 --- a/.github/ISSUE_TEMPLATE/50-renderer_issue.md +++ b/.github/ISSUE_TEMPLATE/50-renderer_issue.md @@ -4,12 +4,14 @@ about: Report an issue related to rendering, including corrupted frames, incorr title: "[RENDER]" labels: "Renderer, Triage" assignees: '' - --- -**Commit Hash (8 character string of letters/numbers in title bar)** +**Commit Hash** + **Platform** + **Summary** + **Additional Information / Output** diff --git a/.github/ISSUE_TEMPLATE/50-ui_issue.md b/.github/ISSUE_TEMPLATE/50-ui_issue.md index a0cfa3c02..f746024de 100644 --- a/.github/ISSUE_TEMPLATE/50-ui_issue.md +++ b/.github/ISSUE_TEMPLATE/50-ui_issue.md @@ -4,12 +4,14 @@ about: Report an issue related to general user interface usability, including b title: "[UI]" labels: "User Interface, Triage" assignees: '' - --- -**Commit Hash (8 character string of letters/numbers in title bar)** +**Commit Hash** + **Platform** + **Summary** + **Additional Information / Output** From cd47676043e45ab8a11e442f84efcfd630690219 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Tue, 22 Sep 2020 16:27:03 +1000 Subject: [PATCH 58/71] crashpad: updated crash handler --- .github/workflows/ci.yml | 3 + app/CMakeLists.txt | 88 +++++---- app/common/CMakeLists.txt | 5 +- app/common/crashhandler.cpp | 150 --------------- app/common/crashpadinterface.cpp | 81 ++++---- app/common/crashpadinterface.h | 1 - .../{crashhandler.h => crashpadutils.h} | 26 ++- app/dialog/crashhandler/crashhandler.cpp | 181 ++++++++++++++---- app/dialog/crashhandler/crashhandler.h | 40 +++- app/dialog/crashhandler/crashhandlermain.cpp | 4 +- cmake/FindGoogleCrashpad.cmake | 4 + 11 files changed, 298 insertions(+), 285 deletions(-) delete mode 100644 app/common/crashhandler.cpp rename app/common/{crashhandler.h => crashpadutils.h} (50%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d8c1a4b4..b4756b7f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -139,10 +139,13 @@ jobs: then mkdir olive-editor cp app/olive-editor.exe olive-editor + cp app/olive-crashhandler.exe olive-editor cp app/olive-editor.pdb olive-editor + windeployqt olive-editor/olive-crashhandler.exe windeployqt olive-editor/olive-editor.exe cp $(cygpath $GITHUB_WORKSPACE)/bin/*.dll olive-editor cp $(cygpath $GITHUB_WORKSPACE)/out/Default/crashpad_handler.exe olive-editor + cp $(cygpath $GITHUB_WORKSPACE)/minidump_stackwalk/* olive-editor elif [ "$MATRIX_OS" == "macos-latest" ] then export BUNDLE_NAME=Olive.app diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 714a5e01d..b0bfd881f 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -183,6 +183,54 @@ if (GoogleCrashpad_FOUND) PRIVATE ${CRASHPAD_LIBRARIES} ) + + set(OLIVE_CRASH_TARGET "olive-crashhandler") + + set(OLIVE_CRASH_SOURCES + dialog/crashhandler/crashhandler.h + dialog/crashhandler/crashhandler.cpp + dialog/crashhandler/crashhandlermain.cpp + ) + + if (WIN32) + add_executable( + ${OLIVE_CRASH_TARGET} + WIN32 + ${OLIVE_CRASH_SOURCES} + ) + else() + add_executable( + ${OLIVE_CRASH_TARGET} + ${OLIVE_CRASH_SOURCES} + ) + endif() + + target_include_directories( + ${OLIVE_CRASH_TARGET} + PRIVATE + ${CRASHPAD_INCLUDE_DIRS} + ) + + target_link_libraries( + ${OLIVE_CRASH_TARGET} + PRIVATE + Qt5::Core + Qt5::Gui + Qt5::Widgets + Qt5::Network + ${CRASHPAD_LIBRARIES} + ) + + if(UNIX AND NOT APPLE) + install(TARGETS ${OLIVE_TARGET} ${OLIVE_CRASH_TARGET} RUNTIME DESTINATION bin) + endif() + + if(APPLE) + # Move crash handler program inside Mac app bundle + add_custom_command(TARGET ${OLIVE_CRASH_TARGET} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${OLIVE_CRASH_TARGET} $ + ) + endif() endif() # Set compiler definitions @@ -207,43 +255,3 @@ if(DOXYGEN_FOUND) set(DOXYGEN_EXTRACT_PRIVATE "YES") doxygen_add_docs(docs ALL ${OLIVE_SOURCES}) endif() - -set(OLIVE_CRASH_TARGET "olive-crashhandler") - -set(OLIVE_CRASH_SOURCES - dialog/crashhandler/crashhandler.h - dialog/crashhandler/crashhandler.cpp - dialog/crashhandler/crashhandlermain.cpp -) - -if (WIN32) - add_executable( - ${OLIVE_CRASH_TARGET} - WIN32 - ${OLIVE_CRASH_SOURCES} - ) -else() - add_executable( - ${OLIVE_CRASH_TARGET} - ${OLIVE_CRASH_SOURCES} - ) -endif() - -target_link_libraries( - ${OLIVE_CRASH_TARGET} - PRIVATE - Qt5::Core - Qt5::Gui - Qt5::Widgets -) - -if(UNIX AND NOT APPLE) - install(TARGETS ${OLIVE_TARGET} ${OLIVE_CRASH_TARGET} RUNTIME DESTINATION bin) -endif() - -if(APPLE) - # Move crash handler program inside Mac app bundle - add_custom_command(TARGET ${OLIVE_CRASH_TARGET} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${OLIVE_CRASH_TARGET} $ - ) -endif() diff --git a/app/common/CMakeLists.txt b/app/common/CMakeLists.txt index ee07f43c4..99521453c 100644 --- a/app/common/CMakeLists.txt +++ b/app/common/CMakeLists.txt @@ -23,10 +23,9 @@ set(OLIVE_SOURCES common/clamp.h common/commandlineparser.h common/commandlineparser.cpp - common/crashhandler.h - common/crashhandler.cpp - common/crashpadinterface.cpp common/crashpadinterface.h + common/crashpadinterface.cpp + common/crashpadutils.h common/debug.h common/debug.cpp common/define.h diff --git a/app/common/crashhandler.cpp b/app/common/crashhandler.cpp deleted file mode 100644 index 469e45233..000000000 --- a/app/common/crashhandler.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/*** - - Olive - Non-Linear Video Editor - Copyright (C) 2019 Olive Team - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -***/ - -#include "crashhandler.h" - -#include -#include -#include -#include -#include -#include -#include - -#if defined(Q_OS_WINDOWS) -#include -#include -#include -#include -#elif defined(Q_OS_MAC) || defined(Q_OS_LINUX) -#include -#endif - -#include "common/filefunctions.h" - -OLIVE_NAMESPACE_ENTER - -void crash_handler(int sig) -{ - QString log_path = QDir(FileFunctions::GetTempFilePath()).filePath(QStringLiteral("olive_crash")); - QFile output(log_path); - - output.open(QFile::WriteOnly); - QTextStream ostream(&output); - -#ifdef GITHASH - ostream << "Version: " << GITHASH << "\n"; -#endif - ostream << "Signal: " << sig << "\n\n"; - -#if defined(Q_OS_WINDOWS) - // Use Windows stackwalk API - HANDLE process = GetCurrentProcess(); - HANDLE thread = GetCurrentThread(); - - CONTEXT context; - memset(&context, 0, sizeof(CONTEXT)); - context.ContextFlags = CONTEXT_FULL; - RtlCaptureContext(&context); - - SymInitialize(process, NULL, TRUE); - - DWORD image; - STACKFRAME64 stackframe; - ZeroMemory(&stackframe, sizeof(STACKFRAME64)); - -#ifdef _M_IX86 - image = IMAGE_FILE_MACHINE_I386; - stackframe.AddrPC.Offset = context.Eip; - stackframe.AddrPC.Mode = AddrModeFlat; - stackframe.AddrFrame.Offset = context.Ebp; - stackframe.AddrFrame.Mode = AddrModeFlat; - stackframe.AddrStack.Offset = context.Esp; - stackframe.AddrStack.Mode = AddrModeFlat; -#elif _M_X64 - image = IMAGE_FILE_MACHINE_AMD64; - stackframe.AddrPC.Offset = context.Rip; - stackframe.AddrPC.Mode = AddrModeFlat; - stackframe.AddrFrame.Offset = context.Rsp; - stackframe.AddrFrame.Mode = AddrModeFlat; - stackframe.AddrStack.Offset = context.Rsp; - stackframe.AddrStack.Mode = AddrModeFlat; -#elif _M_IA64 - image = IMAGE_FILE_MACHINE_IA64; - stackframe.AddrPC.Offset = context.StIIP; - stackframe.AddrPC.Mode = AddrModeFlat; - stackframe.AddrFrame.Offset = context.IntSp; - stackframe.AddrFrame.Mode = AddrModeFlat; - stackframe.AddrBStore.Offset = context.RsBSP; - stackframe.AddrBStore.Mode = AddrModeFlat; - stackframe.AddrStack.Offset = context.IntSp; - stackframe.AddrStack.Mode = AddrModeFlat; -#endif - - for (int i = 0; i < 50; i++) { - - BOOL result = StackWalk64( - image, process, thread, - &stackframe, &context, NULL, - SymFunctionTableAccess64, SymGetModuleBase64, NULL); - - if (!result) { break; } - - char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(TCHAR)]; - PSYMBOL_INFO symbol = (PSYMBOL_INFO)buffer; - symbol->SizeOfStruct = sizeof(SYMBOL_INFO); - symbol->MaxNameLen = MAX_SYM_NAME; - - DWORD64 displacement = 0; - - ostream << "[" << i << "] "; - - if (SymFromAddr(process, stackframe.AddrPC.Offset, &displacement, symbol)) { - ostream << symbol->Name; - //printf("[%i] %s\n", i, symbol->Name); - } else { - ostream << "???"; - //printf("[%i] ???\n", i); - } - - ostream << "\n"; - } - - SymCleanup(process); -#elif defined(Q_OS_MAC) || defined(Q_OS_LINUX) - void *array[10]; - size_t size; - - // get void*'s for all entries on the stack - size = backtrace(array, 10); - - // print out all the frames to stderr - backtrace_symbols_fd(array, size, output.handle()); -#endif - - output.close(); - - QString crash_handler_exe = QDir(qApp->applicationDirPath()).filePath(QStringLiteral("olive-crashhandler")); - QProcess::startDetached(crash_handler_exe, {log_path}); - - exit(1); -} - -OLIVE_NAMESPACE_EXIT diff --git a/app/common/crashpadinterface.cpp b/app/common/crashpadinterface.cpp index 770e8a84a..393cba4c6 100644 --- a/app/common/crashpadinterface.cpp +++ b/app/common/crashpadinterface.cpp @@ -23,75 +23,67 @@ #ifdef USE_CRASHPAD #include +#include #include #include #include +#include +#include "crashpadutils.h" #include "filefunctions.h" -#ifdef Q_OS_WINDOWS +#ifdef OS_WIN #include #endif -// Copied from base::FilePath to match its macro -#if defined(OS_POSIX) -// On most platforms, native pathnames are char arrays, and the encoding -// may or may not be specified. On Mac OS X, native pathnames are encoded -// in UTF-8. -#define TO_BASE_STRING_TYPE(x) x.toStdString() -#elif defined(OS_WIN) -// On Windows, for Unicode-aware applications, native pathnames are wchar_t -// arrays encoded in UTF-16. -#define TO_BASE_STRING_TYPE(x) x.toStdWString() -#endif // OS_WIN - crashpad::CrashpadClient *client; -bool ShowCrashConfirmation() +QString GenerateReportPath() { - QString msg = QCoreApplication::translate("CrashReport", - "We're sorry, Olive has crashed. " - "Would you like to send an error report to " - "help developers fix this issue?\n\n" - "Crash reports are anonymous and only send " - "non-specific details about your computer and" - "how the crash occurred."); - - return (QMessageBox::critical(nullptr, - QString(), - msg, - QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes); + return QDir(OLIVE_NAMESPACE::FileFunctions::GetTempFilePath()).filePath(QStringLiteral("reports")); } -#ifdef Q_OS_WINDOWS +base::FilePath GenerateReportPathForCrashpad() +{ + return base::FilePath(QSTRING_TO_BASE_STRING(GenerateReportPath())); +} + +#if defined(OS_WIN) LONG WINAPI Win32ExceptionHandler(_EXCEPTION_POINTERS *ExceptionInfo) { - if (ShowCrashConfirmation()) { - client->DumpAndCrash(ExceptionInfo); - } + QString crash_handler_exe = QDir(qApp->applicationDirPath()).filePath(QStringLiteral("olive-crashhandler")); + QProcess::startDetached(crash_handler_exe, {GenerateReportPath(), QString::number(QDateTime::currentSecsSinceEpoch())}); + + client->DumpAndCrash(ExceptionInfo); return EXCEPTION_CONTINUE_SEARCH; } +#elif defined(OS_LINUX) +bool LinuxExceptionHandler(int, siginfo_t*, ucontext_t*) +{ + QString crash_handler_exe = QDir(qApp->applicationDirPath()).filePath(QStringLiteral("olive-crashhandler")); + QProcess::startDetached(crash_handler_exe, {GenerateReportPath(), QString::number(QDateTime::currentSecsSinceEpoch())}); + + // Returning false signals to Crashpad to proceed with its own exception handling + return false; +} #endif bool InitializeCrashpad() { QString exe_dir = QCoreApplication::applicationDirPath(); +#ifdef OS_WIN + base::FilePath handler(QSTRING_TO_BASE_STRING(QDir(exe_dir).filePath(QStringLiteral("crashpad_handler.exe")))); +#else // FIXME: On Linux, probably should put this in a subdir so that it doesn't conflict with // anything else in /usr/bin - -#ifdef Q_OS_WINDOWS - base::FilePath handler(TO_BASE_STRING_TYPE(QDir(exe_dir).filePath(QStringLiteral("crashpad_handler.exe")))); -#else - base::FilePath handler(TO_BASE_STRING_TYPE(QDir(exe_dir).filePath(QStringLiteral("crashpad_handler")))); + base::FilePath handler(QSTRING_TO_BASE_STRING(QDir(exe_dir).filePath(QStringLiteral("crashpad_handler")))); #endif - base::FilePath reports_dir(TO_BASE_STRING_TYPE(QDir(OLIVE_NAMESPACE::FileFunctions::GetTempFilePath()).filePath("reports"))); + base::FilePath reports_dir = GenerateReportPathForCrashpad(); - base::FilePath metrics_dir(TO_BASE_STRING_TYPE(QDir(OLIVE_NAMESPACE::FileFunctions::GetTempFilePath()).filePath("metrics"))); - - std::string url = "https://olivevideoeditor.org/crashpad/report.php"; + base::FilePath metrics_dir(QSTRING_TO_BASE_STRING(QDir(OLIVE_NAMESPACE::FileFunctions::GetTempFilePath()).filePath(QStringLiteral("metrics")))); // Metadata that will be posted to the server with the crash report map std::map annotations; @@ -105,19 +97,22 @@ bool InitializeCrashpad() std::unique_ptr database = crashpad::CrashReportDatabase::Initialize(reports_dir); if (database == NULL) return false; - // Enable automated crash uploads + // Disable automated crash uploads crashpad::Settings *settings = database->GetSettings(); if (settings == NULL) return false; - settings->SetUploadsEnabled(true); + settings->SetUploadsEnabled(false); // Start crash handler client = new crashpad::CrashpadClient(); bool status = client->StartHandler(handler, reports_dir, metrics_dir, - url, annotations, arguments, true, true); + "https://olivevideoeditor.org/crashpad/report.php", + annotations, arguments, true, true); // Override Crashpad exception filter with our own -#ifdef Q_OS_WINDOWS +#if defined(OS_WIN) SetUnhandledExceptionFilter(Win32ExceptionHandler); +#elif defined(OS_LINUX) + crashpad::CrashpadClient::SetFirstChanceExceptionHandler(LinuxExceptionHandler); #endif return status; diff --git a/app/common/crashpadinterface.h b/app/common/crashpadinterface.h index 26bd17b65..2388ece96 100644 --- a/app/common/crashpadinterface.h +++ b/app/common/crashpadinterface.h @@ -23,7 +23,6 @@ #ifdef USE_CRASHPAD -#include #include #include diff --git a/app/common/crashhandler.h b/app/common/crashpadutils.h similarity index 50% rename from app/common/crashhandler.h rename to app/common/crashpadutils.h index 10ed30627..a2a36e49d 100644 --- a/app/common/crashhandler.h +++ b/app/common/crashpadutils.h @@ -18,15 +18,23 @@ ***/ -#ifndef CRASHHANDLER_H -#define CRASHHANDLER_H +#ifndef CRASHPADUTILS_H +#define CRASHPADUTILS_H -#include "common/define.h" +#include -OLIVE_NAMESPACE_ENTER +// Copied from base::FilePath to match its macro +#if defined(OS_POSIX) +// On most platforms, native pathnames are char arrays, and the encoding +// may or may not be specified. On Mac OS X, native pathnames are encoded +// in UTF-8. +#define QSTRING_TO_BASE_STRING(x) x.toStdString() +#define BASE_STRING_TO_QSTRING(x) QString::fromStdString(x) +#elif defined(OS_WIN) +// On Windows, for Unicode-aware applications, native pathnames are wchar_t +// arrays encoded in UTF-16. +#define QSTRING_TO_BASE_STRING(x) x.toStdWString() +#define BASE_STRING_TO_QSTRING(x) QString::fromStdWString(x) +#endif // OS_WIN -void crash_handler(int sig); - -OLIVE_NAMESPACE_EXIT - -#endif // CRASHHANDLER_H +#endif // CRASHPADUTILS_H diff --git a/app/dialog/crashhandler/crashhandler.cpp b/app/dialog/crashhandler/crashhandler.cpp index 7645eb5f9..e6120a5d9 100644 --- a/app/dialog/crashhandler/crashhandler.cpp +++ b/app/dialog/crashhandler/crashhandler.cpp @@ -20,66 +20,181 @@ #include "crashhandler.h" +#include +#include #include +#include #include -#include +#include +#include +#include +#include #include -#include +#include +#include #include +#include "common/crashpadutils.h" + OLIVE_NAMESPACE_ENTER -CrashHandlerDialog::CrashHandlerDialog(const char *log_file) +CrashHandlerDialog::CrashHandlerDialog(const char *report_dir, const char* crash_time) { setWindowTitle(tr("Olive")); + crash_time_ = QString(crash_time).toULongLong(); + report_dir_ = report_dir; QVBoxLayout* layout = new QVBoxLayout(this); - layout->addWidget(new QLabel(tr("We're sorry, Olive has crashed. Please send the following log to the developers to " - "help resolve this."))); + layout->addWidget(new QLabel(tr("We're sorry, Olive has crashed. Please help us fix it by " + "sending an error report."))); - QTextEdit* edit = new QTextEdit(); - edit->setReadOnly(true); - layout->addWidget(edit); + summary_edit_ = new QTextEdit(); + summary_edit_->setPlaceholderText(tr("Describe what you were doing in as much detail as " + "possible. If you can, provide steps to reproduce this crash.")); - edit->append(QStringLiteral("Build Environment: %1 (%2)").arg(QSysInfo::buildCpuArchitecture(), QSysInfo::buildAbi())); - edit->append(QStringLiteral("Run Environment: %1").arg(QSysInfo::currentCpuArchitecture())); - edit->append(QStringLiteral("Kernel: %1 %2").arg(QSysInfo::kernelType(), QSysInfo::kernelVersion())); - edit->append(QStringLiteral("System: %1 (%2 %3)").arg(QSysInfo::prettyProductName(), QSysInfo::productType(), QSysInfo::productVersion())); - edit->append(QString()); + layout->addWidget(summary_edit_); - QDialogButtonBox* buttons = new QDialogButtonBox(); + layout->addWidget(new QLabel(tr("Crash Report:"))); - // FIXME: Implement auto-reporting - //buttons->addButton(tr("Send Error Report"), QDialogButtonBox::AcceptRole); - //buttons->addButton(tr("Don't Send"), QDialogButtonBox::RejectRole); - buttons->addButton(QDialogButtonBox::Ok); + crash_report_ = new QTextEdit(); + crash_report_->setReadOnly(true); + crash_report_->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont)); + layout->addWidget(crash_report_); - connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept); - connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject); - layout->addWidget(buttons); + QHBoxLayout* btn_layout = new QHBoxLayout(); + btn_layout->setMargin(0); + btn_layout->addStretch(); - QFile log(log_file); - if (log.open(QFile::ReadOnly | QFile::Text)) { - edit->append(log.readAll()); + send_report_btn_ = new QPushButton(tr("Send Error Report")); + connect(send_report_btn_, &QPushButton::clicked, this, &CrashHandlerDialog::SendErrorReport); + btn_layout->addWidget(send_report_btn_); - QMetaObject::invokeMethod(edit->verticalScrollBar(), - "setValue", - Qt::QueuedConnection, - Q_ARG(int, 0)); + dont_send_btn_ = new QPushButton(tr("Don't Send")); + connect(dont_send_btn_, &QPushButton::clicked, this, &CrashHandlerDialog::reject); + btn_layout->addWidget(dont_send_btn_); - log.close(); + layout->addLayout(btn_layout); + + crash_report_->setEnabled(false); + send_report_btn_->setEnabled(false); + + crash_report_->setText(tr("Waiting for crash report to be generated...")); + + AttemptToFindReport(); +} + +void CrashHandlerDialog::SetGUIObjectsEnabled(bool e) +{ + summary_edit_->setEnabled(e); + crash_report_->setEnabled(e); + send_report_btn_->setEnabled(e); + dont_send_btn_->setEnabled(e); +} + +void CrashHandlerDialog::GenerateReport() +{ + QProcess* p = new QProcess(); + + connect(p, QOverload::of(&QProcess::finished), + this, &CrashHandlerDialog::ReadProcessFinished); + connect(p, &QProcess::readyReadStandardOutput, this, &CrashHandlerDialog::ReadProcessHasData); + + QString stackwalk_filename; + +#if defined(OS_WIN) + stackwalk_filename = QStringLiteral("minidump_stackwalk.exe"); +#else + stackwalk_filename = QStringLiteral("minidump_stackwalk"); +#endif + + QString stackwalk_bin = QDir(qApp->applicationDirPath()).filePath(stackwalk_filename); + p->start(stackwalk_bin, {report_filename_}); + crash_report_->setText(QStringLiteral("Trying to run: %1").arg(stackwalk_bin)); +} + +void CrashHandlerDialog::ReplyFinished(QNetworkReply* reply) +{ + if (reply->error() == QNetworkReply::NoError) { + // Close dialog + QDialog::accept(); + } else { + QMessageBox::critical(this, tr("Upload Failed"), + tr("Failed to send error report. Please try again later."), + QMessageBox::Ok); + SetGUIObjectsEnabled(true); } } -void CrashHandlerDialog::accept() +void CrashHandlerDialog::AttemptToFindReport() { - QDialog::accept(); + // Retrieve reports from Crashpad database + std::unique_ptr database = crashpad::CrashReportDatabase::Initialize(base::FilePath(QSTRING_TO_BASE_STRING(QString(report_dir_)))); + std::vector reports; + database->GetCompletedReports(&reports); + + // Find report that was made after the crash time + foreach (const crashpad::CrashReportDatabase::Report& report, reports) { + if (report.creation_time >= crash_time_) { + report_filename_ = BASE_STRING_TO_QSTRING(report.file_path.value()); + break; + } + } + + // If we found it, use it, otherwise wait a second and try again + if (report_filename_.isEmpty()) { + // Couldn't find report, try again in one second + QTimer::singleShot(500, this, &CrashHandlerDialog::AttemptToFindReport); + } else { + GenerateReport(); + } } -void CrashHandlerDialog::reject() +void CrashHandlerDialog::ReadProcessHasData() { - QDialog::reject(); + report_data_.append(static_cast(sender())->readAllStandardOutput()); +} + +void CrashHandlerDialog::ReadProcessFinished() +{ + SetGUIObjectsEnabled(true); + crash_report_->setText(report_data_); + delete sender(); +} + +void CrashHandlerDialog::SendErrorReport() +{ + SetGUIObjectsEnabled(false); + + QNetworkAccessManager* manager = new QNetworkAccessManager(); + connect(manager, &QNetworkAccessManager::finished, this, &CrashHandlerDialog::ReplyFinished); + + QNetworkRequest request; + request.setSslConfiguration(QSslConfiguration::defaultConfiguration()); + request.setUrl(QStringLiteral("https://olivevideoeditor.org/crashpad/report.php")); + + // Create HTTP form + QHttpMultiPart* multipart = new QHttpMultiPart(QHttpMultiPart::FormDataType); + + // Create description section + QHttpPart desc_part; + desc_part.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("text/plain")); + desc_part.setHeader(QNetworkRequest::ContentDispositionHeader, QStringLiteral("form-data; name=\"description\"")); + desc_part.setBody(summary_edit_->toPlainText().toUtf8()); + multipart->append(desc_part); + + // Create file section + QHttpPart file_part; + file_part.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/octet-stream")); + file_part.setHeader(QNetworkRequest::ContentDispositionHeader, QStringLiteral("form-data; name=\"upload_file_minidump\"; filename=\"%1\"") + .arg(QFileInfo(report_filename_).fileName())); + QFile* file = new QFile(report_filename_); + file->open(QFile::ReadOnly); + file_part.setBodyDevice(file); + file->setParent(multipart); // Delete file with multipart + multipart->append(file_part); + + manager->post(request, multipart); } OLIVE_NAMESPACE_EXIT diff --git a/app/dialog/crashhandler/crashhandler.h b/app/dialog/crashhandler/crashhandler.h index 485f1d543..7ec91669b 100644 --- a/app/dialog/crashhandler/crashhandler.h +++ b/app/dialog/crashhandler/crashhandler.h @@ -21,7 +21,12 @@ #ifndef CRASHHANDLERDIALOG_H #define CRASHHANDLERDIALOG_H +#include #include +#include +#include +#include +#include #include "common/define.h" @@ -31,12 +36,39 @@ class CrashHandlerDialog : public QDialog { Q_OBJECT public: - CrashHandlerDialog(const char* log_file); + CrashHandlerDialog(const char* report_dir, const char* crash_time); -public slots: - virtual void accept() override; +private: + void SetGUIObjectsEnabled(bool e); - virtual void reject() override; + void GenerateReport(); + + QTextEdit* summary_edit_; + + QTextEdit* crash_report_; + + QPushButton* send_report_btn_; + + QPushButton* dont_send_btn_; + + QString report_filename_; + + time_t crash_time_; + + QString report_dir_; + + QByteArray report_data_; + +private slots: + void ReplyFinished(QNetworkReply *reply); + + void AttemptToFindReport(); + + void ReadProcessHasData(); + + void ReadProcessFinished(); + + void SendErrorReport(); }; diff --git a/app/dialog/crashhandler/crashhandlermain.cpp b/app/dialog/crashhandler/crashhandlermain.cpp index 88032fff4..d0fe76368 100644 --- a/app/dialog/crashhandler/crashhandlermain.cpp +++ b/app/dialog/crashhandler/crashhandlermain.cpp @@ -24,13 +24,13 @@ int main(int argc, char *argv[]) { - if (argc < 2) { + if (argc < 3) { return 1; } QApplication a(argc, argv); - OLIVE_NAMESPACE::CrashHandlerDialog chd(argv[1]); + OLIVE_NAMESPACE::CrashHandlerDialog chd(argv[1], argv[2]); chd.open(); return a.exec(); diff --git a/cmake/FindGoogleCrashpad.cmake b/cmake/FindGoogleCrashpad.cmake index 60ef6b849..17474a407 100644 --- a/cmake/FindGoogleCrashpad.cmake +++ b/cmake/FindGoogleCrashpad.cmake @@ -79,6 +79,10 @@ foreach (COMPONENT ${_crashpad_components}) list(APPEND CRASHPAD_LIBRARIES ${CRASHPAD_${UPPERCOMPONENT}_LIB}) endforeach() +if (UNIX AND NOT APPLE) + list(APPEND CRASHPAD_LIBRARIES ${CMAKE_DL_LIBS} Threads::Threads) +endif() + find_package_handle_standard_args(GoogleCrashpad REQUIRED_VARS CRASHPAD_LIBRARIES From d69e478a62d6f020c2300a257ed123ca5b1aff6b Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Wed, 23 Sep 2020 01:44:11 +1000 Subject: [PATCH 59/71] paramview: ensure item time target is set upon creation Fixes #1213 --- app/widget/nodeparamview/nodeparamview.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/widget/nodeparamview/nodeparamview.cpp b/app/widget/nodeparamview/nodeparamview.cpp index 51b332fe6..34fea246d 100644 --- a/app/widget/nodeparamview/nodeparamview.cpp +++ b/app/widget/nodeparamview/nodeparamview.cpp @@ -136,6 +136,9 @@ void NodeParamView::SelectNodes(const QList &nodes) connect(item, &NodeParamViewItem::InputDoubleClicked, this, &NodeParamView::InputDoubleClicked); connect(item, &NodeParamViewItem::RequestSelectNode, this, &NodeParamView::RequestSelectNode); + // Set time target + item->SetTimeTarget(GetTimeTarget()); + items_.insert(n, item); } From 76d73b17aa47175cf25ba3c118dcd4867125c0c5 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Wed, 23 Sep 2020 02:29:38 +1000 Subject: [PATCH 60/71] block: made speed a percentage --- app/node/block/block.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/app/node/block/block.cpp b/app/node/block/block.cpp index 86daeca9d..85df9aa3b 100644 --- a/app/node/block/block.cpp +++ b/app/node/block/block.cpp @@ -51,6 +51,7 @@ Block::Block() : speed_input_ = new NodeInput("speed_in", NodeParam::kFloat); speed_input_->set_standard_value(1.0); + speed_input_->set_property(QStringLiteral("view"), QStringLiteral("percent")); AddInput(speed_input_); // A block's length must be greater than 0 From d196689c2d42882a41ae92304fe27720a78cff81 Mon Sep 17 00:00:00 2001 From: Simran Date: Tue, 22 Sep 2020 23:58:44 +0200 Subject: [PATCH 61/71] Improve cmake crashpad/breakpad discovery, compilation & installation under Unix (#1184) * Clean up Crashpad library discovery code * Find and install Breakpad binary * Copy crashpad_handler and minidum_stackwalk POST_BUILD (macOS only) * Install crashpad_handler and minidum_stackwalk for AppImage --- app/CMakeLists.txt | 15 ++++-- cmake/FindGoogleCrashpad.cmake | 98 ++++++++++++++++++++-------------- 2 files changed, 69 insertions(+), 44 deletions(-) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index b0bfd881f..1e35af257 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -176,13 +176,13 @@ if (GoogleCrashpad_FOUND) ${OLIVE_TARGET} PRIVATE ${CRASHPAD_INCLUDE_DIRS} - ) + ) target_link_libraries( ${OLIVE_TARGET} PRIVATE ${CRASHPAD_LIBRARIES} - ) + ) set(OLIVE_CRASH_TARGET "olive-crashhandler") @@ -221,14 +221,21 @@ if (GoogleCrashpad_FOUND) ${CRASHPAD_LIBRARIES} ) + set(CRASHPAD_HANDLER "crashpad_handler${CMAKE_EXECUTABLE_SUFFIX}") + set(MINIDUMP_STACKWALK "minidump_stackwalk${CMAKE_EXECUTABLE_SUFFIX}") + if(UNIX AND NOT APPLE) install(TARGETS ${OLIVE_TARGET} ${OLIVE_CRASH_TARGET} RUNTIME DESTINATION bin) + install(PROGRAMS ${CRASHPAD_LIBRARY_DIRS}/${CRASHPAD_HANDLER} DESTINATION bin) + install(PROGRAMS ${BREAKPAD_BIN_DIR}/${MINIDUMP_STACKWALK} DESTINATION bin) endif() if(APPLE) - # Move crash handler program inside Mac app bundle + # Move crash handler executables inside Mac app bundle add_custom_command(TARGET ${OLIVE_CRASH_TARGET} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${OLIVE_CRASH_TARGET} $ + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${OLIVE_CRASH_TARGET} $ + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CRASHPAD_LIBRARY_DIRS}/${CRASHPAD_HANDLER} $ + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${BREAKPAD_BIN_DIR}/${MINIDUMP_STACKWALK} $ ) endif() endif() diff --git a/cmake/FindGoogleCrashpad.cmake b/cmake/FindGoogleCrashpad.cmake index 17474a407..0e56c35ec 100644 --- a/cmake/FindGoogleCrashpad.cmake +++ b/cmake/FindGoogleCrashpad.cmake @@ -18,73 +18,91 @@ include(FindPackageHandleStandardArgs) # Try to find include files find_path(CRASHPAD_CLIENT_INCLUDE_DIR - client/crashpad_client.h - HINTS - "${CRASHPAD_LOCATION}" - "$ENV{CRASHPAD_LOCATION}" - "${CRASHPAD_BASE_DIR}" + client/crashpad_client.h + HINTS + "${CRASHPAD_LOCATION}" + "$ENV{CRASHPAD_LOCATION}" + "${CRASHPAD_BASE_DIR}" ) list(APPEND CRASHPAD_INCLUDE_DIRS ${CRASHPAD_CLIENT_INCLUDE_DIR}) find_path(CRASHPAD_BASE_INCLUDE_DIR - base/files/file_path.h - HINTS - "${CRASHPAD_LOCATION}" - "$ENV{CRASHPAD_LOCATION}" - "${CRASHPAD_BASE_DIR}" - PATH_SUFFIXES - "third_party/mini_chromium/mini_chromium" + base/files/file_path.h + HINTS + "${CRASHPAD_LOCATION}" + "$ENV{CRASHPAD_LOCATION}" + "${CRASHPAD_BASE_DIR}" + PATH_SUFFIXES + "third_party/mini_chromium/mini_chromium" ) list(APPEND CRASHPAD_INCLUDE_DIRS ${CRASHPAD_BASE_INCLUDE_DIR}) # Try to find build files if (WIN32) find_path(CRASHPAD_LIBRARY_DIRS - obj/client/client.lib - HINTS - "${CRASHPAD_LOCATION}" - "$ENV{CRASHPAD_LOCATION}" - "${CRASHPAD_BASE_DIR}" - PATH_SUFFIXES - "out/Default" + obj/client/client.lib + HINTS + "${CRASHPAD_LOCATION}" + "$ENV{CRASHPAD_LOCATION}" + "${CRASHPAD_BASE_DIR}" + PATH_SUFFIXES + "out/Default" ) elseif(UNIX) # Assuming macOS works this way, don't actually know find_path(CRASHPAD_LIBRARY_DIRS - obj/client/libclient.a - HINTS - "${CRASHPAD_LOCATION}" - "$ENV{CRASHPAD_LOCATION}" - "${CRASHPAD_BASE_DIR}" - PATH_SUFFIXES - "out/Default" + obj/client/libclient.a + HINTS + "${CRASHPAD_LOCATION}" + "$ENV{CRASHPAD_LOCATION}" + "${CRASHPAD_BASE_DIR}" + PATH_SUFFIXES + "out/Default" ) endif() # Find the libraries we need set (_crashpad_components - client/client - util/util - third_party/mini_chromium/mini_chromium/base/base) + client + util + third_party/mini_chromium/mini_chromium/base + compat) foreach (COMPONENT ${_crashpad_components}) - string(REGEX MATCH "^(.*[\\\/])" SUBDIR ${COMPONENT}) - string(REGEX MATCH "([^\/]+$)" SHORT_COMPONENT ${COMPONENT}) - string(TOUPPER ${SHORT_COMPONENT} UPPERCOMPONENT) + get_filename_component(SHORT_COMPONENT ${COMPONENT} NAME) + string(TOUPPER ${SHORT_COMPONENT} UPPER_COMPONENT) - find_library(CRASHPAD_${UPPERCOMPONENT}_LIB - ${SHORT_COMPONENT} - HINTS "${CRASHPAD_LIBRARY_DIRS}/obj/${SUBDIR}" + find_library(CRASHPAD_${UPPER_COMPONENT}_LIB + ${SHORT_COMPONENT} + HINTS + "${CRASHPAD_LIBRARY_DIRS}/obj/${COMPONENT}" ) - list(APPEND CRASHPAD_LIBRARIES ${CRASHPAD_${UPPERCOMPONENT}_LIB}) + list(APPEND CRASHPAD_LIBRARIES ${CRASHPAD_${UPPER_COMPONENT}_LIB}) endforeach() if (UNIX AND NOT APPLE) - list(APPEND CRASHPAD_LIBRARIES ${CMAKE_DL_LIBS} Threads::Threads) + list(APPEND CRASHPAD_LIBRARIES + ${CMAKE_DL_LIBS} # Crashpad compat lib needs libdl.so (-ldl) + Threads::Threads # Link against libpthread.so (-lpthread) + ) +endif() + +# Find Breakpad's minidump_stackwalk +if (UNIX) + find_path(BREAKPAD_BIN_DIR + minidump_stackwalk + HINTS + "${BREAKPAD_LOCATION}" + "$ENV{BREAKPAD_LOCATION}" + "${BREAKPAD_BASE_DIR}" + PATH_SUFFIXES + breakpad/bin + ) endif() find_package_handle_standard_args(GoogleCrashpad - REQUIRED_VARS - CRASHPAD_LIBRARIES - CRASHPAD_INCLUDE_DIRS + REQUIRED_VARS + CRASHPAD_LIBRARIES + CRASHPAD_INCLUDE_DIRS + BREAKPAD_BIN_DIR ) From 65be374a7007a5383abb13e98aa09e1c05b47aef Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Wed, 23 Sep 2020 00:34:26 +0200 Subject: [PATCH 62/71] Split Windows and macOS into separate jobs --- .github/workflows/ci.yml | 299 +++++++++++++++++++++++++-------------- 1 file changed, 195 insertions(+), 104 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4756b7f3..0205a0c79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,9 @@ on: branches: - master +env: + DOWNLOAD_TOOL: curl -fLOSs --retry 3 + jobs: windows: strategy: @@ -20,24 +23,12 @@ jobs: cmake-gen: Ninja dep-suffix: win.7z extract-tool: 7z x - - build: 2 - build-type: RelWithDebInfo - compiler-name: Clang LLVM - os-name: macOS - os-arch: x86_64 - os: macos-latest - cmake-gen: Unix Makefiles - dep-suffix: mac.zip - extract-tool: sudo unzip -d /usr/local -o name: | ${{ matrix.os-name }} <${{ matrix.compiler-name }}, ${{ matrix.build-type }}> runs-on: ${{ matrix.os }} - env: - DOWNLOAD_TOOL: curl -fLOSs --retry 3 - steps: - name: Checkout Source Code uses: actions/checkout@v2 @@ -56,7 +47,6 @@ jobs: - name: Enable Developer Command Prompt (Windows) uses: ilammy/msvc-dev-cmd@v1.3.0 - if: matrix.os == 'windows-latest' - name: Acquire Qt uses: jurplel/install-qt-action@v2.8.0 @@ -132,111 +122,65 @@ jobs: - name: Create Package working-directory: ${{ runner.workspace }}/build shell: bash - env: - MATRIX_OS: ${{ matrix.os }} run: | - if [ "$MATRIX_OS" == "windows-latest" ] - then - mkdir olive-editor - cp app/olive-editor.exe olive-editor - cp app/olive-crashhandler.exe olive-editor - cp app/olive-editor.pdb olive-editor - windeployqt olive-editor/olive-crashhandler.exe - windeployqt olive-editor/olive-editor.exe - cp $(cygpath $GITHUB_WORKSPACE)/bin/*.dll olive-editor - cp $(cygpath $GITHUB_WORKSPACE)/out/Default/crashpad_handler.exe olive-editor - cp $(cygpath $GITHUB_WORKSPACE)/minidump_stackwalk/* olive-editor - elif [ "$MATRIX_OS" == "macos-latest" ] - then - export BUNDLE_NAME=Olive.app - mv app/$BUNDLE_NAME . - - # HACK: OCIO doesn't link it's library properly so we need to manually correct - install_name_tool -change libOpenColorIO.1.dylib @rpath/libOpenColorIO.1.dylib $BUNDLE_NAME/Contents/MacOS/Olive - - macdeployqt $BUNDLE_NAME - $DOWNLOAD_TOOL https://github.com/arl/macdeployqtfix/raw/master/macdeployqtfix.py - python2 macdeployqtfix.py $BUNDLE_NAME/Contents/MacOS/Olive /usr/local/Cellar/qt5/5.*/ - fi + mkdir olive-editor + cp app/olive-editor.exe olive-editor + cp app/olive-crashhandler.exe olive-editor + cp app/olive-editor.pdb olive-editor + windeployqt olive-editor/olive-crashhandler.exe + windeployqt olive-editor/olive-editor.exe + cp $(cygpath $GITHUB_WORKSPACE)/bin/*.dll olive-editor + cp $(cygpath $GITHUB_WORKSPACE)/out/Default/crashpad_handler.exe olive-editor + cp $(cygpath $GITHUB_WORKSPACE)/minidump_stackwalk/* olive-editor - name: Deploy Packages working-directory: ${{ runner.workspace }}/build shell: bash - env: - MATRIX_OS: ${{ matrix.os }} run: | - if [ "$MATRIX_OS" == "windows-latest" ] - then - # Create Installer Executable - curl -fLOSs https://download.microsoft.com/download/3/2/2/3224B87F-CFA0-4E70-BDA3-3DE650EFEBA5/vcredist_x64.exe - cp $(cygpath $GITHUB_WORKSPACE)/app/packaging/windows/nsis/* . - cp $(cygpath $GITHUB_WORKSPACE)/LICENSE . - makensis -V4 -DX64 "-XOutFile $PKGNAME.exe" olive.nsi + # Create Installer Executable + $DOWNLOAD_TOOL https://download.microsoft.com/download/3/2/2/3224B87F-CFA0-4E70-BDA3-3DE650EFEBA5/vcredist_x64.exe + cp $(cygpath $GITHUB_WORKSPACE)/app/packaging/windows/nsis/* . + cp $(cygpath $GITHUB_WORKSPACE)/LICENSE . + makensis -V4 -DX64 "-XOutFile $PKGNAME.exe" olive.nsi - # Create Portable ZIP - echo -n > olive-editor/portable - 7z a $PKGNAME.zip olive-editor - elif [ "$MATRIX_OS" == "macos-latest" ] - then - zip -r $PKGNAME.zip Olive.app - fi + # Create Portable ZIP + echo -n > olive-editor/portable + 7z a $PKGNAME.zip olive-editor + + - name: Upload Installer Artifact to GitHub + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PKGNAME }}.exe + path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.exe + + - name: Upload Portable Artifact to GitHub + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PKGNAME }}.zip + path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.zip - name: Upload Packages to Nightly Page shell: bash working-directory: ${{ runner.workspace }}/build env: GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} - MATRIX_OS: ${{ matrix.os }} + if: github.event_name == 'push' run: | - if [ "$MATRIX_OS" == "windows-latest" ] - then - curl -X POST \ - -F file=@$PKGNAME.exe \ - -F key="$GH_AUTH_KEY" \ - -F hash="$GITHUB_SHA" \ - -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ - -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ - https://olivevideoeditor.org/dl/push.php + curl -X POST \ + -F file=@$PKGNAME.exe \ + -F key="$GH_AUTH_KEY" \ + -F hash="$GITHUB_SHA" \ + -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ + -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ + https://olivevideoeditor.org/dl/push.php - curl -X POST \ - -F file=@$PKGNAME.zip \ - -F key="$GH_AUTH_KEY" \ - -F hash="$GITHUB_SHA" \ - -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ - -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ - https://olivevideoeditor.org/dl/push.php - elif [ "$MATRIX_OS" == "macos-latest" ] - then - curl -X POST \ - -F file=@$PKGNAME.zip \ - -F key="$GH_AUTH_KEY" \ - -F hash="$GITHUB_SHA" \ - -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ - -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ - https://olivevideoeditor.org/dl/push.php - fi - if: github.event_name != 'pull_request' - - - name: Upload Installer Artifact to GitHub (Windows) - uses: actions/upload-artifact@v2 - with: - name: ${{ env.PKGNAME }}.exe - path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.exe - if: matrix.os == 'windows-latest' - - - name: Upload Portable Artifact to GitHub (Windows) - uses: actions/upload-artifact@v2 - with: - name: ${{ env.PKGNAME }}.zip - path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.zip - if: matrix.os == 'windows-latest' - - - name: Upload Artifact to GitHub (macOS) - uses: actions/upload-artifact@v2 - with: - name: ${{ env.PKGNAME }}.zip - path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.zip - if: matrix.os == 'macos-latest' + curl -X POST \ + -F file=@$PKGNAME.zip \ + -F key="$GH_AUTH_KEY" \ + -F hash="$GITHUB_SHA" \ + -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ + -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ + https://olivevideoeditor.org/dl/push.php - name: Export Crashpad Symbols and Upload To Server working-directory: ${{ runner.workspace }}/build @@ -250,4 +194,151 @@ jobs: -F symfile=@olive-editor.sym \ -F key="$GH_AUTH_KEY" \ https://olivevideoeditor.org/crashpad/symbols.php - if: matrix.os == 'windows-latest' + + macos: + strategy: + matrix: + build: [1] + include: + - build: 1 + build-type: RelWithDebInfo + compiler-name: Clang LLVM + os-name: macOS + os-arch: x86_64 + os: macos-latest + cmake-gen: Unix Makefiles + dep-suffix: mac.zip + extract-tool: sudo unzip -d /usr/local -o + name: | + ${{ matrix.os-name }} + <${{ matrix.compiler-name }}, + ${{ matrix.build-type }}> + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout Source Code + uses: actions/checkout@v2 + + - name: Automatically Generate Package Name + shell: bash + env: + PLATFORM: ${{ matrix.os-name }} + ARCH: ${{ matrix.os-arch }} + run: | + echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-$PLATFORM-$ARCH)" + + - name: Create Build Folder + run: | + cmake -E make_directory ${{ runner.workspace }}/build + + - name: Acquire Qt + uses: jurplel/install-qt-action@v2.8.0 + with: + version: 5.15.1 + + - name: Acquire FFmpeg + shell: bash + env: + DEP_SUFFIX: ${{ matrix.dep-suffix }} + EXTRACT_TOOL: ${{ matrix.extract-tool }} + run: | + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/ffmpeg-$DEP_SUFFIX + $EXTRACT_TOOL ffmpeg-$DEP_SUFFIX + + - name: Acquire OpenColorIO + shell: bash + env: + DEP_SUFFIX: ${{ matrix.dep-suffix }} + EXTRACT_TOOL: ${{ matrix.extract-tool }} + run: | + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/ocio-$DEP_SUFFIX + $EXTRACT_TOOL ocio-$DEP_SUFFIX + + - name: Acquire OpenEXR + shell: bash + env: + DEP_SUFFIX: ${{ matrix.dep-suffix }} + EXTRACT_TOOL: ${{ matrix.extract-tool }} + run: | + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/openexr-$DEP_SUFFIX + $EXTRACT_TOOL openexr-$DEP_SUFFIX + + - name: Acquire OpenImageIO + shell: bash + env: + DEP_SUFFIX: ${{ matrix.dep-suffix }} + EXTRACT_TOOL: ${{ matrix.extract-tool }} + run: | + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/oiio-$DEP_SUFFIX + $EXTRACT_TOOL oiio-$DEP_SUFFIX + + - name: Acquire Crashpad + shell: bash + env: + DEP_SUFFIX: ${{ matrix.dep-suffix }} + EXTRACT_TOOL: ${{ matrix.extract-tool }} + run: | + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/crashpad-$DEP_SUFFIX + $EXTRACT_TOOL crashpad-$DEP_SUFFIX + + - name: Configure CMake + shell: bash + working-directory: ${{ runner.workspace }}/build + env: + CMAKE_GEN: ${{ matrix.cmake-gen }} + run: | + PATH=$GITHUB_WORKSPACE:$PATH \ + cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -G "$CMAKE_GEN" + + - name: Build + working-directory: ${{ runner.workspace }}/build + shell: bash + run: | + cmake --build . + + - name: Test + working-directory: ${{ runner.workspace }}/build + shell: bash + run: | + ctest -C ${{ matrix.build-type }} + + - name: Create Package + working-directory: ${{ runner.workspace }}/build + shell: bash + run: | + export BUNDLE_NAME=Olive.app + mv app/$BUNDLE_NAME . + + # HACK: OCIO doesn't link it's library properly so we need to manually correct + install_name_tool -change libOpenColorIO.1.dylib @rpath/libOpenColorIO.1.dylib $BUNDLE_NAME/Contents/MacOS/Olive + + macdeployqt $BUNDLE_NAME + $DOWNLOAD_TOOL https://github.com/arl/macdeployqtfix/raw/master/macdeployqtfix.py + python2 macdeployqtfix.py $BUNDLE_NAME/Contents/MacOS/Olive /usr/local/Cellar/qt5/5.*/ + + - name: Deploy Packages + working-directory: ${{ runner.workspace }}/build + shell: bash + run: | + zip -r $PKGNAME.zip Olive.app + + - name: Upload Packages to Nightly Page + shell: bash + working-directory: ${{ runner.workspace }}/build + env: + GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} + if: github.event_name == 'push' + run: | + curl -X POST \ + -F file=@$PKGNAME.zip \ + -F key="$GH_AUTH_KEY" \ + -F hash="$GITHUB_SHA" \ + -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ + -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ + https://olivevideoeditor.org/dl/push.php + + - name: Upload Artifact to GitHub + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PKGNAME }}.zip + path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.zip From 68f40101f5f5e3bf32e08e5f69c254c13bb09c1b Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Wed, 23 Sep 2020 00:47:13 +0200 Subject: [PATCH 63/71] No need for DEP_SUFFIX, EXTRACT_TOOL & CMAKE_GEN env vars --- .github/workflows/ci.yml | 96 ++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 64 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0205a0c79..5aed075ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,12 +21,13 @@ jobs: os-arch: x86_64 os: windows-latest cmake-gen: Ninja - dep-suffix: win.7z - extract-tool: 7z x + env: + EXTRACT_TOOL: 7z x name: | ${{ matrix.os-name }} <${{ matrix.compiler-name }}, - ${{ matrix.build-type }}> + ${{ matrix.build-type }}, + ${{ matrix.cmake-gen }}> runs-on: ${{ matrix.os }} steps: @@ -39,7 +40,7 @@ jobs: PLATFORM: ${{ matrix.os-name }} ARCH: ${{ matrix.os-arch }} run: | - echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-$PLATFORM-$ARCH)" + echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-${PLATFORM}-${ARCH})" - name: Create Build Folder run: | @@ -55,57 +56,40 @@ jobs: - name: Acquire FFmpeg shell: bash - env: - DEP_SUFFIX: ${{ matrix.dep-suffix }} - EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | - $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/ffmpeg-$DEP_SUFFIX - $EXTRACT_TOOL ffmpeg-$DEP_SUFFIX + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/ffmpeg-win.7z + $EXTRACT_TOOL ffmpeg-win.7z - name: Acquire OpenColorIO shell: bash - env: - DEP_SUFFIX: ${{ matrix.dep-suffix }} - EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | - $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/ocio-$DEP_SUFFIX - $EXTRACT_TOOL ocio-$DEP_SUFFIX + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/ocio-win.7z + $EXTRACT_TOOL ocio-win.7z - name: Acquire OpenEXR shell: bash - env: - DEP_SUFFIX: ${{ matrix.dep-suffix }} - EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | - $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/openexr-$DEP_SUFFIX - $EXTRACT_TOOL openexr-$DEP_SUFFIX + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/openexr-win.7z + $EXTRACT_TOOL openexr-win.7z - name: Acquire OpenImageIO shell: bash - env: - DEP_SUFFIX: ${{ matrix.dep-suffix }} - EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | - $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/oiio-$DEP_SUFFIX - $EXTRACT_TOOL oiio-$DEP_SUFFIX + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/oiio-win.7z + $EXTRACT_TOOL oiio-win.7z - name: Acquire Crashpad shell: bash - env: - DEP_SUFFIX: ${{ matrix.dep-suffix }} - EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | - $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/crashpad-$DEP_SUFFIX - $EXTRACT_TOOL crashpad-$DEP_SUFFIX + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/crashpad-win.7z + $EXTRACT_TOOL crashpad-win.7z - name: Configure CMake shell: bash working-directory: ${{ runner.workspace }}/build - env: - CMAKE_GEN: ${{ matrix.cmake-gen }} run: | PATH=$GITHUB_WORKSPACE:$PATH \ - cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -G "$CMAKE_GEN" + cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -G "${{ matrix.cmake-gen }}" - name: Build working-directory: ${{ runner.workspace }}/build @@ -207,12 +191,13 @@ jobs: os-arch: x86_64 os: macos-latest cmake-gen: Unix Makefiles - dep-suffix: mac.zip - extract-tool: sudo unzip -d /usr/local -o + env: + EXTRACT_TOOL: sudo unzip -d /usr/local -o name: | ${{ matrix.os-name }} <${{ matrix.compiler-name }}, - ${{ matrix.build-type }}> + ${{ matrix.build-type }}, + ${{ matrix.cmake-gen }}> runs-on: ${{ matrix.os }} steps: @@ -225,7 +210,7 @@ jobs: PLATFORM: ${{ matrix.os-name }} ARCH: ${{ matrix.os-arch }} run: | - echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-$PLATFORM-$ARCH)" + echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-${PLATFORM}-${ARCH})" - name: Create Build Folder run: | @@ -238,57 +223,40 @@ jobs: - name: Acquire FFmpeg shell: bash - env: - DEP_SUFFIX: ${{ matrix.dep-suffix }} - EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | - $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/ffmpeg-$DEP_SUFFIX - $EXTRACT_TOOL ffmpeg-$DEP_SUFFIX + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/ffmpeg-mac.zip + $EXTRACT_TOOL ffmpeg-mac.zip - name: Acquire OpenColorIO shell: bash - env: - DEP_SUFFIX: ${{ matrix.dep-suffix }} - EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | - $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/ocio-$DEP_SUFFIX - $EXTRACT_TOOL ocio-$DEP_SUFFIX + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/ocio-mac.zip + $EXTRACT_TOOL ocio-mac.zip - name: Acquire OpenEXR shell: bash - env: - DEP_SUFFIX: ${{ matrix.dep-suffix }} - EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | - $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/openexr-$DEP_SUFFIX - $EXTRACT_TOOL openexr-$DEP_SUFFIX + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/openexr-mac.zip + $EXTRACT_TOOL openexr-mac.zip - name: Acquire OpenImageIO shell: bash - env: - DEP_SUFFIX: ${{ matrix.dep-suffix }} - EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | - $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/oiio-$DEP_SUFFIX - $EXTRACT_TOOL oiio-$DEP_SUFFIX + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/oiio-mac.zip + $EXTRACT_TOOL oiio-mac.zip - name: Acquire Crashpad shell: bash - env: - DEP_SUFFIX: ${{ matrix.dep-suffix }} - EXTRACT_TOOL: ${{ matrix.extract-tool }} run: | - $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/crashpad-$DEP_SUFFIX - $EXTRACT_TOOL crashpad-$DEP_SUFFIX + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/crashpad-mac.zip + $EXTRACT_TOOL crashpad-mac.zip - name: Configure CMake shell: bash working-directory: ${{ runner.workspace }}/build - env: - CMAKE_GEN: ${{ matrix.cmake-gen }} run: | PATH=$GITHUB_WORKSPACE:$PATH \ - cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -G "$CMAKE_GEN" + cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -G "${{ matrix.cmake-gen }}" - name: Build working-directory: ${{ runner.workspace }}/build From 31674e0a3160a6f934b677eb1cea860ee09494ca Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Wed, 23 Sep 2020 00:47:34 +0200 Subject: [PATCH 64/71] Fix indention --- .github/workflows/ci.yml | 254 +++++++++++++++++++-------------------- 1 file changed, 127 insertions(+), 127 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5aed075ca..4ab6ce30f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,153 +31,153 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Checkout Source Code - uses: actions/checkout@v2 + - name: Checkout Source Code + uses: actions/checkout@v2 - - name: Automatically Generate Package Name - shell: bash - env: - PLATFORM: ${{ matrix.os-name }} - ARCH: ${{ matrix.os-arch }} - run: | - echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-${PLATFORM}-${ARCH})" + - name: Automatically Generate Package Name + shell: bash + env: + PLATFORM: ${{ matrix.os-name }} + ARCH: ${{ matrix.os-arch }} + run: | + echo "::set-env name=PKGNAME::$(echo Olive-${GITHUB_SHA::8}-${PLATFORM}-${ARCH})" - - name: Create Build Folder - run: | - cmake -E make_directory ${{ runner.workspace }}/build + - name: Create Build Folder + run: | + cmake -E make_directory ${{ runner.workspace }}/build - - name: Enable Developer Command Prompt (Windows) - uses: ilammy/msvc-dev-cmd@v1.3.0 + - name: Enable Developer Command Prompt (Windows) + uses: ilammy/msvc-dev-cmd@v1.3.0 - - name: Acquire Qt - uses: jurplel/install-qt-action@v2.8.0 - with: - version: 5.15.1 + - name: Acquire Qt + uses: jurplel/install-qt-action@v2.8.0 + with: + version: 5.15.1 - - name: Acquire FFmpeg - shell: bash - run: | - $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/ffmpeg-win.7z - $EXTRACT_TOOL ffmpeg-win.7z + - name: Acquire FFmpeg + shell: bash + run: | + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/ffmpeg-win.7z + $EXTRACT_TOOL ffmpeg-win.7z - - name: Acquire OpenColorIO - shell: bash - run: | - $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/ocio-win.7z - $EXTRACT_TOOL ocio-win.7z + - name: Acquire OpenColorIO + shell: bash + run: | + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/ocio-win.7z + $EXTRACT_TOOL ocio-win.7z - - name: Acquire OpenEXR - shell: bash - run: | - $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/openexr-win.7z - $EXTRACT_TOOL openexr-win.7z + - name: Acquire OpenEXR + shell: bash + run: | + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/openexr-win.7z + $EXTRACT_TOOL openexr-win.7z - - name: Acquire OpenImageIO - shell: bash - run: | - $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/oiio-win.7z - $EXTRACT_TOOL oiio-win.7z + - name: Acquire OpenImageIO + shell: bash + run: | + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/oiio-win.7z + $EXTRACT_TOOL oiio-win.7z - - name: Acquire Crashpad - shell: bash - run: | - $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/crashpad-win.7z - $EXTRACT_TOOL crashpad-win.7z + - name: Acquire Crashpad + shell: bash + run: | + $DOWNLOAD_TOOL http://olivevideoeditor.org/deps/crashpad-win.7z + $EXTRACT_TOOL crashpad-win.7z - - name: Configure CMake - shell: bash - working-directory: ${{ runner.workspace }}/build - run: | - PATH=$GITHUB_WORKSPACE:$PATH \ - cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -G "${{ matrix.cmake-gen }}" + - name: Configure CMake + shell: bash + working-directory: ${{ runner.workspace }}/build + run: | + PATH=$GITHUB_WORKSPACE:$PATH \ + cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -G "${{ matrix.cmake-gen }}" - - name: Build - working-directory: ${{ runner.workspace }}/build - shell: bash - run: | - cmake --build . + - name: Build + working-directory: ${{ runner.workspace }}/build + shell: bash + run: | + cmake --build . - - name: Test - working-directory: ${{ runner.workspace }}/build - shell: bash - run: | - ctest -C ${{ matrix.build-type }} + - name: Test + working-directory: ${{ runner.workspace }}/build + shell: bash + run: | + ctest -C ${{ matrix.build-type }} - - name: Create Package - working-directory: ${{ runner.workspace }}/build - shell: bash - run: | - mkdir olive-editor - cp app/olive-editor.exe olive-editor - cp app/olive-crashhandler.exe olive-editor - cp app/olive-editor.pdb olive-editor - windeployqt olive-editor/olive-crashhandler.exe - windeployqt olive-editor/olive-editor.exe - cp $(cygpath $GITHUB_WORKSPACE)/bin/*.dll olive-editor - cp $(cygpath $GITHUB_WORKSPACE)/out/Default/crashpad_handler.exe olive-editor - cp $(cygpath $GITHUB_WORKSPACE)/minidump_stackwalk/* olive-editor + - name: Create Package + working-directory: ${{ runner.workspace }}/build + shell: bash + run: | + mkdir olive-editor + cp app/olive-editor.exe olive-editor + cp app/olive-crashhandler.exe olive-editor + cp app/olive-editor.pdb olive-editor + windeployqt olive-editor/olive-crashhandler.exe + windeployqt olive-editor/olive-editor.exe + cp $(cygpath $GITHUB_WORKSPACE)/bin/*.dll olive-editor + cp $(cygpath $GITHUB_WORKSPACE)/out/Default/crashpad_handler.exe olive-editor + cp $(cygpath $GITHUB_WORKSPACE)/minidump_stackwalk/* olive-editor - - name: Deploy Packages - working-directory: ${{ runner.workspace }}/build - shell: bash - run: | - # Create Installer Executable - $DOWNLOAD_TOOL https://download.microsoft.com/download/3/2/2/3224B87F-CFA0-4E70-BDA3-3DE650EFEBA5/vcredist_x64.exe - cp $(cygpath $GITHUB_WORKSPACE)/app/packaging/windows/nsis/* . - cp $(cygpath $GITHUB_WORKSPACE)/LICENSE . - makensis -V4 -DX64 "-XOutFile $PKGNAME.exe" olive.nsi + - name: Deploy Packages + working-directory: ${{ runner.workspace }}/build + shell: bash + run: | + # Create Installer Executable + $DOWNLOAD_TOOL https://download.microsoft.com/download/3/2/2/3224B87F-CFA0-4E70-BDA3-3DE650EFEBA5/vcredist_x64.exe + cp $(cygpath $GITHUB_WORKSPACE)/app/packaging/windows/nsis/* . + cp $(cygpath $GITHUB_WORKSPACE)/LICENSE . + makensis -V4 -DX64 "-XOutFile $PKGNAME.exe" olive.nsi - # Create Portable ZIP - echo -n > olive-editor/portable - 7z a $PKGNAME.zip olive-editor + # Create Portable ZIP + echo -n > olive-editor/portable + 7z a $PKGNAME.zip olive-editor - - name: Upload Installer Artifact to GitHub - uses: actions/upload-artifact@v2 - with: - name: ${{ env.PKGNAME }}.exe - path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.exe + - name: Upload Installer Artifact to GitHub + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PKGNAME }}.exe + path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.exe - - name: Upload Portable Artifact to GitHub - uses: actions/upload-artifact@v2 - with: - name: ${{ env.PKGNAME }}.zip - path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.zip + - name: Upload Portable Artifact to GitHub + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PKGNAME }}.zip + path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.zip - - name: Upload Packages to Nightly Page - shell: bash - working-directory: ${{ runner.workspace }}/build - env: - GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} - if: github.event_name == 'push' - run: | - curl -X POST \ - -F file=@$PKGNAME.exe \ - -F key="$GH_AUTH_KEY" \ - -F hash="$GITHUB_SHA" \ - -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ - -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ - https://olivevideoeditor.org/dl/push.php + - name: Upload Packages to Nightly Page + shell: bash + working-directory: ${{ runner.workspace }}/build + env: + GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} + if: github.event_name == 'push' + run: | + curl -X POST \ + -F file=@$PKGNAME.exe \ + -F key="$GH_AUTH_KEY" \ + -F hash="$GITHUB_SHA" \ + -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ + -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ + https://olivevideoeditor.org/dl/push.php - curl -X POST \ - -F file=@$PKGNAME.zip \ - -F key="$GH_AUTH_KEY" \ - -F hash="$GITHUB_SHA" \ - -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ - -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ - https://olivevideoeditor.org/dl/push.php + curl -X POST \ + -F file=@$PKGNAME.zip \ + -F key="$GH_AUTH_KEY" \ + -F hash="$GITHUB_SHA" \ + -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ + -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ + https://olivevideoeditor.org/dl/push.php - - name: Export Crashpad Symbols and Upload To Server - working-directory: ${{ runner.workspace }}/build - shell: bash - env: - GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} - run: | - curl -fLSs --retry 3 https://github.com/google/breakpad/blob/master/src/tools/windows/binaries/dump_syms.exe?raw=true > dump_syms.exe - ./dump_syms app/olive-editor.pdb > olive-editor.sym - curl -X POST \ - -F symfile=@olive-editor.sym \ - -F key="$GH_AUTH_KEY" \ - https://olivevideoeditor.org/crashpad/symbols.php + - name: Export Crashpad Symbols and Upload To Server + working-directory: ${{ runner.workspace }}/build + shell: bash + env: + GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} + run: | + curl -fLSs --retry 3 https://github.com/google/breakpad/blob/master/src/tools/windows/binaries/dump_syms.exe?raw=true > dump_syms.exe + ./dump_syms app/olive-editor.pdb > olive-editor.sym + curl -X POST \ + -F symfile=@olive-editor.sym \ + -F key="$GH_AUTH_KEY" \ + https://olivevideoeditor.org/crashpad/symbols.php macos: strategy: From 5614c293f394535ccc7885cf8b10b1283816672b Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Wed, 23 Sep 2020 00:53:53 +0200 Subject: [PATCH 65/71] Add Docker-based Linux (CentOS 7) CI --- .github/workflows/ci.yml | 80 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ab6ce30f..3a31ffbe3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,86 @@ env: DOWNLOAD_TOOL: curl -fLOSs --retry 3 jobs: + linux: + strategy: + fail-fast: false + matrix: + build: [1, 2] + include: + - build: 1 + build-type: RelWithDebInfo + cc-compiler: gcc + cxx-compiler: g++ + compiler-name: GCC 9.3.1 + cmake-gen: Ninja + os-name: Linux (CentOS 7) + vfx-cy: 2021 + ci-common-version: 2 + - build: 2 + build-type: RelWithDebInfo + cc-compiler: clang + cxx-compiler: clang++ + compiler-name: Clang 10.0.0 + cmake-gen: Ninja + os-name: Linux (CentOS 7) + vfx-cy: 2021 + ci-common-version: 2 + name: | + ${{ matrix.os-name }} + <${{ matrix.compiler-name }}, + ${{ matrix.build-type }}, + ${{ matrix.cmake-gen }}, + VFX CY${{ matrix.vfx-cy }}, + CI Common Version ${{ matrix.ci-common-version }}> + runs-on: ubuntu-latest + container: + image: olivevideoeditor/ci-olive:${{ matrix.vfx-cy }}.${{ matrix.ci-common-version }} + + steps: + - uses: actions/checkout@v2 + with: + repository: olive-editor/olive + + - name: Configure + run: | + mkdir build + cd build + cmake .. -G "${{ matrix.cmake-gen }}" \ + -DCMAKE_BUILD_TYPE="${{ matrix.build-type }}" \ + -DCMAKE_C_COMPILER="${{ matrix.cc-compiler }}" \ + -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" + + - name: Build + working-directory: build + run: | + cmake --build . + + - name: Install + working-directory: build + run: | + cmake --install app --prefix appdir/usr + + - name: Bundle + id: bundle + working-directory: build + env: + ARCH: x86_64 + run: | + export VERSION=${GITHUB_SHA::8} + /usr/local/linuxdeployqt-x86_64.AppImage \ + appdir/usr/share/applications/org.olivevideoeditor.Olive.desktop \ + -appimage \ + --appimage-extract-and-run + filename=$(echo Olive*.AppImage) + mv "${filename}" "${filename/x86_64/Linux-x86_64}" + echo "::set-output name=artifact::${filename/x86_64/Linux-x86_64-${{ matrix.cc-compiler }}}" + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.bundle.outputs.artifact }} + path: build/Olive*.AppImage + windows: strategy: matrix: From 5b6e6e70ee1bba92aad390eab9c6ebcc26a54925 Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Wed, 23 Sep 2020 00:55:31 +0200 Subject: [PATCH 66/71] Upload to GitHub first in case remote server not reachable --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a31ffbe3..e55a9cdf5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -370,6 +370,12 @@ jobs: run: | zip -r $PKGNAME.zip Olive.app + - name: Upload Artifact to GitHub + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PKGNAME }}.zip + path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.zip + - name: Upload Packages to Nightly Page shell: bash working-directory: ${{ runner.workspace }}/build @@ -384,9 +390,3 @@ jobs: -F time="$(git -C $GITHUB_WORKSPACE show -s --format=%ct)" \ -F comment="$(git -C $GITHUB_WORKSPACE show -s --format=%B)" \ https://olivevideoeditor.org/dl/push.php - - - name: Upload Artifact to GitHub - uses: actions/upload-artifact@v2 - with: - name: ${{ env.PKGNAME }}.zip - path: ${{ runner.workspace }}/build/${{ env.PKGNAME }}.zip From b1cfe5789472bed99ea9459d04bbbb8b76cc91dc Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Wed, 23 Sep 2020 01:19:52 +0200 Subject: [PATCH 67/71] Unify step names, add ctest --- .github/workflows/ci.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e55a9cdf5..0f3ff881d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,11 +45,10 @@ jobs: image: olivevideoeditor/ci-olive:${{ matrix.vfx-cy }}.${{ matrix.ci-common-version }} steps: - - uses: actions/checkout@v2 - with: - repository: olive-editor/olive + - name: Checkout Source Code + uses: actions/checkout@v2 - - name: Configure + - name: Configure CMake run: | mkdir build cd build @@ -63,30 +62,34 @@ jobs: run: | cmake --build . - - name: Install + - name: Test working-directory: build run: | - cmake --install app --prefix appdir/usr + ctest -C ${{ matrix.build-type }} - - name: Bundle - id: bundle + - name: Create Package + id: package working-directory: build env: ARCH: x86_64 run: | - export VERSION=${GITHUB_SHA::8} + cmake --install app --prefix appdir/usr + VERSION=${GITHUB_SHA::8} + export VERSION /usr/local/linuxdeployqt-x86_64.AppImage \ appdir/usr/share/applications/org.olivevideoeditor.Olive.desktop \ -appimage \ --appimage-extract-and-run filename=$(echo Olive*.AppImage) - mv "${filename}" "${filename/x86_64/Linux-x86_64}" + pkgname="${filename/x86_64/Linux-x86_64}" + mv "${filename}" "${pkgname}" + echo "::set-output name=pkgname::${pkgname}" echo "::set-output name=artifact::${filename/x86_64/Linux-x86_64-${{ matrix.cc-compiler }}}" - - name: Upload artifact + - name: Upload Artifact to GitHub uses: actions/upload-artifact@v2 with: - name: ${{ steps.bundle.outputs.artifact }} + name: ${{ steps.package.outputs.artifact }} path: build/Olive*.AppImage windows: From 341278f3d7e34220bb4410f8f95a3faa4a83f3af Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Wed, 23 Sep 2020 01:26:39 +0200 Subject: [PATCH 68/71] Add nightly upload for Linux (GCC build only) --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f3ff881d..0041f5fd0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,6 +92,21 @@ jobs: name: ${{ steps.package.outputs.artifact }} path: build/Olive*.AppImage + - name: Upload Packages to Nightly Page + working-directory: build + env: + GH_AUTH_KEY: ${{ secrets.GH_AUTH_KEY }} + PKGNAME: ${{ steps.package.outputs.pkgname }} + if: github.event_name == 'push' && matrix.cc-compiler == 'gcc' + run: | + curl -X POST \ + -F file="@$PKGNAME" \ + -F key="$GH_AUTH_KEY" \ + -F hash="$GITHUB_SHA" \ + -F time="$(git show -s --format=%ct)" \ + -F comment="$(git show -s --format=%B)" \ + https://olivevideoeditor.org/dl/push.php + windows: strategy: matrix: From f0019be680e22f15ad71e3082c089596c19f3a59 Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Wed, 23 Sep 2020 01:26:59 +0200 Subject: [PATCH 69/71] Force LF line endings for .sh and .desktop --- .gitattributes | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index 73d0f2945..70661ac67 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,5 +2,7 @@ * text=auto # Enforce LF line endings on source files -*.h text eol=lf -*.cpp text eol=lf +*.h text eol=lf +*.cpp text eol=lf +*.sh text eol=lf +*.desktop text eol=lf From 9fadd9905f081a5b378e039fc6400f60a123b39a Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Wed, 23 Sep 2020 01:55:47 +0200 Subject: [PATCH 70/71] Add Linux Docker image source files --- docker/ci-common/Dockerfile | 71 +++++++++ docker/ci-crashpad/Dockerfile | 37 +++++ docker/ci-ffmpeg/Dockerfile | 57 +++++++ docker/ci-olive/Dockerfile | 52 ++++++ docker/scripts/2/versions_common.sh | 9 ++ docker/scripts/2021/versions_base.sh | 13 ++ docker/scripts/base/install_cmake.sh | 11 ++ docker/scripts/build_crashpad.sh | 82 ++++++++++ docker/scripts/build_ffmpeg.sh | 158 +++++++++++++++++++ docker/scripts/common/before_build.sh | 10 ++ docker/scripts/common/copy_new_files.sh | 11 ++ docker/scripts/common/install_yumpackages.sh | 74 +++++++++ 12 files changed, 585 insertions(+) create mode 100644 docker/ci-common/Dockerfile create mode 100644 docker/ci-crashpad/Dockerfile create mode 100644 docker/ci-ffmpeg/Dockerfile create mode 100644 docker/ci-olive/Dockerfile create mode 100644 docker/scripts/2/versions_common.sh create mode 100644 docker/scripts/2021/versions_base.sh create mode 100644 docker/scripts/base/install_cmake.sh create mode 100644 docker/scripts/build_crashpad.sh create mode 100644 docker/scripts/build_ffmpeg.sh create mode 100644 docker/scripts/common/before_build.sh create mode 100644 docker/scripts/common/copy_new_files.sh create mode 100644 docker/scripts/common/install_yumpackages.sh diff --git a/docker/ci-common/Dockerfile b/docker/ci-common/Dockerfile new file mode 100644 index 000000000..ce97cc8c6 --- /dev/null +++ b/docker/ci-common/Dockerfile @@ -0,0 +1,71 @@ +# Copyright (C) 2020 Olive Team +# SPDX-License-Identifier: GPL-3.0-or-later + +# Build image (default): +# docker build -t olivevideoeditor/ci-common:2 -f ci-common/Dockerfile . + +ARG OLIVE_ORG=olivevideoeditor +ARG ASWF_PKG_ORG=aswftesting +ARG CI_COMMON_VERSION=2 +ARG DTS_VERSION=9 +ARG CMAKE_VERSION=3.17.3 + +FROM ${ASWF_PKG_ORG}/ci-package-clang:${CI_COMMON_VERSION} as ci-package-clang +FROM ${ASWF_PKG_ORG}/ci-package-ninja:${CI_COMMON_VERSION} as ci-package-ninja + +FROM centos:7 as ci-common + +ARG OLIVE_ORG +ARG CI_COMMON_VERSION +ARG DTS_VERSION +ARG CMAKE_VERSION + +LABEL maintainer="olivevideoeditor@gmail.com" + +LABEL org.opencontainers.image.name="$OLIVE_ORG/ci-common" +LABEL org.opencontainers.image.description="CentOS CI Shared Image" +LABEL org.opencontainers.image.url="http://olivevideoeditor.org" +LABEL org.opencontainers.image.source="https://github.com/olive-editor/olive" +LABEL org.opencontainers.image.vendor="Olive Team" +LABEL org.opencontainers.image.version="1.0" + +USER root + +COPY scripts/${CI_COMMON_VERSION}/versions_common.sh \ + scripts/common/install_yumpackages.sh \ + scripts/common/before_build.sh \ + scripts/common/copy_new_files.sh \ + /tmp/ + +RUN source /tmp/versions_common.sh && \ + /tmp/install_yumpackages.sh + +RUN mkdir /opt/olive +WORKDIR /opt/olive + +ENV OLIVE_ORG=${OLIVE_ORG} \ + CI_COMMON_VERSION=${CI_COMMON_VERSION} \ + DTS_VERSION=${DTS_VERSION} \ + CMAKE_VERSION=${CMAKE_VERSION} \ + LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:/opt/rh/httpd24/root/usr/lib64:/opt/rh/devtoolset-${DTS_VERSION}/root/usr/lib64:/opt/rh/devtoolset-${DTS_VERSION}/root/usr/lib:${LD_LIBRARY_PATH} \ + PATH=/opt/rh/rh-git218/root/usr/bin:/usr/local/bin:/opt/rh/devtoolset-${DTS_VERSION}/root/usr/bin:/opt/app-root/src/bin:/opt/rh/devtoolset-${DTS_VERSION}/root/usr/bin/:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin + +#COPY scripts/common/install_sonar.sh \ +# scripts/common/install_ccache.sh \ +# /tmp/ + +COPY --from=ci-package-clang /. /usr/local/ +COPY --from=ci-package-ninja /. /usr/local/ + +#COPY scripts/common/setup_aswfuser.sh /tmp +#RUN /tmp/setup_aswfuser.sh + +COPY scripts/base/install_cmake.sh \ + /tmp/ + +RUN export DOWNLOADS_DIR=/tmp/downloads && \ + mkdir /tmp/downloads && \ +# source /tmp/versions_base.sh && \ + /tmp/install_cmake.sh && \ +# /tmp/patchup.sh && \ + rm -rf /tmp/downloads diff --git a/docker/ci-crashpad/Dockerfile b/docker/ci-crashpad/Dockerfile new file mode 100644 index 000000000..ad7edbe24 --- /dev/null +++ b/docker/ci-crashpad/Dockerfile @@ -0,0 +1,37 @@ +# Copyright (C) 2020 Olive Team +# SPDX-License-Identifier: GPL-3.0-or-later + +# Build image (default): +# docker build -t olivevideoeditor/ci-package-crashpad -f ci-crashpad/Dockerfile . + +ARG OLIVE_ORG=olivevideoeditor +ARG CI_COMMON_VERSION=2 + +FROM ${OLIVE_ORG}/ci-common:${CI_COMMON_VERSION} as ci-crashpad + +ARG OLIVE_ORG +ARG CI_COMMON_VERSION + +LABEL maintainer="olivevideoeditor@gmail.com" + +LABEL org.opencontainers.image.name="$OLIVE_ORG/ci-crashpad" +LABEL org.opencontainers.image.description="CentOS Crashpad Build Image" +LABEL org.opencontainers.image.url="http://olivevideoeditor.org" +LABEL org.opencontainers.image.source="https://github.com/olive-editor/olive" +LABEL org.opencontainers.image.vendor="Olive Team" +LABEL org.opencontainers.image.version="1.0" + +COPY scripts/build_crashpad.sh \ + /tmp/ + +ENV OLIVE_ORG=${OLIVE_ORG} \ + CI_COMMON_VERSION=${CI_COMMON_VERSION} \ + OLIVE_INSTALL_PREFIX=/usr/local + +RUN /tmp/before_build.sh && \ + /tmp/build_crashpad.sh && \ + /tmp/copy_new_files.sh + +FROM scratch as ci-package-crashpad + +COPY --from=ci-crashpad /package / diff --git a/docker/ci-ffmpeg/Dockerfile b/docker/ci-ffmpeg/Dockerfile new file mode 100644 index 000000000..6333ba164 --- /dev/null +++ b/docker/ci-ffmpeg/Dockerfile @@ -0,0 +1,57 @@ +# Copyright (C) 2020 Olive Team +# SPDX-License-Identifier: GPL-3.0-or-later + +# Build image (default): +# docker build -t olivevideoeditor/ci-package-ffmpeg:4.2.4 -f ci-ffmpeg/Dockerfile . + +ARG OLIVE_ORG=olivevideoeditor +ARG CI_COMMON_VERSION=2 +ARG FFMPEG_VERSION=4.2.4 +ARG NASM_VERSION=2.15.03 +ARG YASM_VERSION=1.3.0 +ARG LAME_VERSION=3.100 +ARG OPUS_VERSION=1.3.1 +# TODO: Make version of x264, x265 and libvpx selectable? +ARG NUM_JOBS=2 + +FROM ${OLIVE_ORG}/ci-common:${CI_COMMON_VERSION} as ci-ffmpeg + +ARG OLIVE_ORG +ARG CI_COMMON_VERSION +ARG FFMPEG_VERSION +ARG NASM_VERSION +ARG YASM_VERSION +ARG LAME_VERSION +ARG OPUS_VERSION +# TODO: Make version of x264, x265 and libvpx selectable? +ARG NUM_JOBS=2 + +LABEL maintainer="olivevideoeditor@gmail.com" + +LABEL org.opencontainers.image.name="$OLIVE_ORG/ci-ffmpeg" +LABEL org.opencontainers.image.description="CentOS FFmpeg Build Image" +LABEL org.opencontainers.image.url="http://olivevideoeditor.org" +LABEL org.opencontainers.image.source="https://github.com/olive-editor/olive" +LABEL org.opencontainers.image.vendor="Olive Team" +LABEL org.opencontainers.image.version="1.0" + +COPY scripts/build_ffmpeg.sh \ + /tmp/ + +ENV OLIVE_ORG=${OLIVE_ORG} \ + CI_COMMON_VERSION=${CI_COMMON_VERSION} \ + FFMPEG_VERSION=${FFMPEG_VERSION} \ + NASM_VERSION=${NASM_VERSION} \ + YASM_VERSION=${YASM_VERSION} \ + LAME_VERSION=${LAME_VERSION} \ + OPUS_VERSION=${OPUS_VERSION} \ + NUM_JOBS=${NUM_JOBS} \ + OLIVE_INSTALL_PREFIX=/usr/local + +RUN /tmp/before_build.sh && \ + /tmp/build_ffmpeg.sh && \ + /tmp/copy_new_files.sh + +FROM scratch as ci-package-ffmpeg + +COPY --from=ci-ffmpeg /package/. / diff --git a/docker/ci-olive/Dockerfile b/docker/ci-olive/Dockerfile new file mode 100644 index 000000000..386aa98f8 --- /dev/null +++ b/docker/ci-olive/Dockerfile @@ -0,0 +1,52 @@ +# Copyright (C) 2020 Olive Team +# SPDX-License-Identifier: GPL-3.0-or-later + +# Build image (default): +# docker build -t olivevideoeditor/ci-olive:2021.2 -f ci-olive/Dockerfile . + +ARG OLIVE_ORG=olivevideoeditor +ARG ASWF_PKG_ORG=aswftesting +ARG CI_COMMON_VERSION=2 +ARG VFXPLATFORM_VERSION=2021 +ARG FFMPEG_VERSION=4.2.4 + +FROM ${ASWF_PKG_ORG}/ci-package-qt:${VFXPLATFORM_VERSION} as ci-package-qt +FROM ${ASWF_PKG_ORG}/ci-package-python:${VFXPLATFORM_VERSION} as ci-package-python +FROM ${ASWF_PKG_ORG}/ci-package-boost:${VFXPLATFORM_VERSION} as ci-package-boost +FROM ${ASWF_PKG_ORG}/ci-package-openexr:${VFXPLATFORM_VERSION} as ci-package-openexr +FROM ${ASWF_PKG_ORG}/ci-package-oiio:${VFXPLATFORM_VERSION} as ci-package-oiio +FROM ${ASWF_PKG_ORG}/ci-package-ocio:${VFXPLATFORM_VERSION} as ci-package-ocio +FROM ${OLIVE_ORG}/ci-package-ffmpeg:${FFMPEG_VERSION} as ci-package-ffmpeg +FROM ${OLIVE_ORG}/ci-package-crashpad:latest as ci-package-crashpad + +FROM ${OLIVE_ORG}/ci-common:${CI_COMMON_VERSION} as ci-olive + +ARG OLIVE_ORG +ARG VFXPLATFORM_VERSION +ARG PYTHON_VERSION=3.7 + +LABEL maintainer="olivevideoeditor@gmail.com" + +LABEL org.opencontainers.image.name="olivevideoeditor/ci-olive" +LABEL org.opencontainers.image.description="CentOS CI Olive Build Image" +LABEL org.opencontainers.image.url="http://olivevideoeditor.org" +LABEL org.opencontainers.image.source="https://github.com/olive-editor/olive" +LABEL org.opencontainers.image.vendor="Olive Team" +LABEL org.opencontainers.image.version="1.0" + +ENV PYTHONPATH=/usr/local/lib/python${PYTHON_VERSION}/site-packages:${PYTHONPATH} \ + CRASHPAD_LOCATION=/usr/local/crashpad \ + VFXPLATFORM_VERSION=${VFXPLATFORM_VERSION} + +COPY --from=ci-package-qt /. /usr/local/ +COPY --from=ci-package-python /. /usr/local/ +COPY --from=ci-package-boost /. /usr/local/ +COPY --from=ci-package-openexr /. /usr/local/ +COPY --from=ci-package-oiio /. /usr/local/ +COPY --from=ci-package-ocio /. /usr/local/ +COPY --from=ci-package-ffmpeg /. /usr/local/ +COPY --from=ci-package-crashpad /. /usr/local/ + +RUN curl --location "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" \ + -o "/usr/local/linuxdeployqt-x86_64.AppImage" && \ + chmod a+x "/usr/local/linuxdeployqt-x86_64.AppImage" diff --git a/docker/scripts/2/versions_common.sh b/docker/scripts/2/versions_common.sh new file mode 100644 index 000000000..834ac6960 --- /dev/null +++ b/docker/scripts/2/versions_common.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set -ex + +export DTS_VERSION=9 +export CLANG_VERSION=10.0.0 +export NINJA_VERSION=1.10.0 diff --git a/docker/scripts/2021/versions_base.sh b/docker/scripts/2021/versions_base.sh new file mode 100644 index 000000000..a56e53747 --- /dev/null +++ b/docker/scripts/2021/versions_base.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set -ex + +export BOOST_VERSION=1.70.0 +export CMAKE_VERSION=3.17.3 +export NUMPY_VERSION=1.16 +export PYSIDE_VERSION=5.12.6 +export PYTHON_VERSION_FULL=3.7.3 +export PYTHON_VERSION=3.7 +export QT_VERSION=5.12.8 diff --git a/docker/scripts/base/install_cmake.sh b/docker/scripts/base/install_cmake.sh new file mode 100644 index 000000000..2aeeb9f0e --- /dev/null +++ b/docker/scripts/base/install_cmake.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set -ex + +if [ ! -f "$DOWNLOADS_DIR/cmake-${CMAKE_VERSION}-Linux-x86_64.sh" ]; then + curl --location "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh" -o "$DOWNLOADS_DIR/cmake-${CMAKE_VERSION}-Linux-x86_64.sh" +fi + +sh "$DOWNLOADS_DIR/cmake-${CMAKE_VERSION}-Linux-x86_64.sh" --skip-license --prefix=/usr/local --exclude-subdir diff --git a/docker/scripts/build_crashpad.sh b/docker/scripts/build_crashpad.sh new file mode 100644 index 000000000..eece43c00 --- /dev/null +++ b/docker/scripts/build_crashpad.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +# Copyright (C) 2020 Olive Team +# SPDX-License-Identifier: GPL-3.0-or-later + +set -ex + +# Get Google's build tools +git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git + +# HACK: Compile our own gn. The one included in depot_tools requires GLIBC_2.18, +# but CentOS 7 only ships with GLIBC_2.17. +git clone https://gn.googlesource.com/gn +# NOTE: Don't clone with --depth 1, this will make build/gen.py fail! +cd gn +python build/gen.py +ninja -C out +cd .. +# Put the path to our own gn build first +PATH="$(pwd)/gn/out:$(pwd)/depot_tools:$PATH" +export PATH + +# Build Crashpad with Clang (default) +# Toolchain can be controlled with env vars CC, CXX and AR +mkdir crashpad +cd crashpad +fetch crashpad +cd crashpad +# TODO: Do we want to set any special args here? For example: +# gn gen --args="target_cpu=\"x64\" is_debug=true" out/Default +gn gen out/Default +ninja -C out/Default + +# Include list +echo 'out/Default/crashpad_handler' > /tmp/crashpad_include_list.txt +find . \( -type f -o -type l \) \ + -name "*.h" -o \ + -name "*.o" -o \ + -name "*.a" | cut -c3- >> /tmp/crashpad_include_list.txt + +# Exclude list +echo '**/.git/** +compat/android/** +compat/ios/** +compat/mac/** +compat/non_elf/** +compat/win/** +handler/mac/** +handler/win/** +infra/** +minidump/test/** +out/Default/**_test* +snapshot/fuchsia/** +snapshot/ios/** +snapshot/mac/** +snapshot/win/** +test/** +third_party/fuchsia/** +third_party/gyp/gyp/test/** +third_party/mini_chromium/mini_chromium/base/fuchsia/** +third_party/mini_chromium/mini_chromium/testing/** +tools/mac/** +util/fuchsia/** +util/ios/** +util/mac/** +util/win/**' > /tmp/crashpad_exclude_list.txt + +rsync -av \ + --files-from=/tmp/crashpad_include_list.txt \ + --exclude-from=/tmp/crashpad_exclude_list.txt \ + --prune-empty-dirs \ + . "${OLIVE_INSTALL_PREFIX}/crashpad" + +cd ../.. + +# Build Breakpad for minidump_stackwalk +mkdir breakpad +cd breakpad +fetch breakpad +cd src +./configure --prefix="${OLIVE_INSTALL_PREFIX}/breakpad" +make +make install -j$(nproc) diff --git a/docker/scripts/build_ffmpeg.sh b/docker/scripts/build_ffmpeg.sh new file mode 100644 index 000000000..1f2c36a91 --- /dev/null +++ b/docker/scripts/build_ffmpeg.sh @@ -0,0 +1,158 @@ +#!/usr/bin/env bash +# Copyright (C) 2020 Olive Team +# SPDX-License-Identifier: GPL-3.0-or-later + +# Largely copied from https://trac.ffmpeg.org/wiki/CompilationGuide/Centos +# +# Uses { command } & pattern for parallelism https://gist.github.com/thenadz/6c0584d42fb007582fbc +# +# TOOD: Use advanced options such as LTO? e.g. https://code.videolan.org/videolan/x264/-/blob/master/configure +# TODO: Enable debug symbols? (Or is it opt-out?) +# TODO: Add more ffmpeg libraries? See https://raw.githubusercontent.com/jrottenberg/ffmpeg/master/docker-images/4.2/centos7/Dockerfile + +set -ex + +# Set up recent NASM +{ + curl -fLsS -o nasm.tar.xz "https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.xz" + tar xf nasm.tar.xz + rm -f nasm.tar.xz + cd nasm* + ./autogen.sh + ./configure \ + --prefix="${OLIVE_INSTALL_PREFIX}" + make -j${NUM_JOBS} + make install + cd .. + rm -rf nasm* +} & + +# Set up recent YASM +{ + curl -fLsS -o yasm.tar.gz "http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz" + tar xf yasm.tar.gz + rm -f yasm.tar.gz + cd yasm* + ./configure \ + --prefix="${OLIVE_INSTALL_PREFIX}" + make -j${NUM_JOBS} + make install + cd .. + rm -rf yasm* +} & + +# join jobs, some libs depend on NASM/YASM +wait + +# Set up libx264 +{ + git clone --depth 1 "https://code.videolan.org/videolan/x264.git" + cd x264 + ./configure \ + --prefix="${OLIVE_INSTALL_PREFIX}" \ + --enable-shared \ + --enable-pic \ + --disable-cli + make -j${NUM_JOBS} + make install + cd .. + rm -rf x264 +} & + +# Set up libx265 +{ + # BitBucket dropped support for Mercurial repos + #hg clone https://bitbucket.org/multicoreware/x265 + git clone --depth 1 "https://bitbucket.org/multicoreware/x265_git.git" x265 + cd x265/build/linux + cmake \ + -G "Unix Makefiles" \ + -DCMAKE_INSTALL_PREFIX="${OLIVE_INSTALL_PREFIX}" \ + ../../source + make -j${NUM_JOBS} + make install + cd ../../.. + rm -rf x265 +} & + +# Set up libmp3lame +{ + curl -fLsS -o lame.tar.gz "https://downloads.sourceforge.net/project/lame/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz" + tar xf lame.tar.gz + rm -f lame.tar.gz + cd lame* + ./configure \ + --prefix="${OLIVE_INSTALL_PREFIX}" \ + --enable-shared \ + --enable-nasm \ + --disable-frontend + make -j${NUM_JOBS} + make install + cd .. + rm -rf lame* +} & + +# Set up libopus +{ + curl -fLsS -o opus.tar.gz "https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz" + tar xf opus.tar.gz + rm -f opus.tar.gz + cd opus* + ./configure \ + --prefix="${OLIVE_INSTALL_PREFIX}" \ + --enable-shared + make -j${NUM_JOBS} + make install + cd .. + rm -rf opus* +} & + +# Set up libvpx +{ + git clone --depth 1 "https://chromium.googlesource.com/webm/libvpx.git" + cd libvpx + ./configure \ + --prefix="${OLIVE_INSTALL_PREFIX}" \ + --enable-shared \ + --enable-pic \ + --enable-vp9-highbitdepth \ + --as=yasm \ + --disable-examples \ + --disable-unit-tests \ + --disable-docs \ + --disable-install-bins + make -j${NUM_JOBS} + make install + cd .. + rm -rf libvpx +} & + +# join all jobs +wait + +curl -fLsS -o ffmpeg.tar.xz "https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.xz" +tar xf ffmpeg.tar.xz +cd ffmpeg* + +# TODO: --enable-debug? +PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" ./configure \ + --disable-doc \ + --disable-ffplay \ + --enable-gpl \ + --enable-version3 \ + --enable-shared \ + --enable-libfreetype \ + --enable-libmp3lame \ + --enable-libopus \ + --enable-libvpx \ + --enable-libx264 \ + --enable-libx265 \ + --prefix="${OLIVE_INSTALL_PREFIX}" \ + --extra-libs=-lpthread \ + --extra-libs=-lm \ + --extra-cflags="-I${OLIVE_INSTALL_PREFIX}/include" \ + --extra-ldflags="-L${OLIVE_INSTALL_PREFIX}/lib" +make -j${NUM_JOBS} +make install +cd .. +rm -rf ffmpeg* diff --git a/docker/scripts/common/before_build.sh b/docker/scripts/common/before_build.sh new file mode 100644 index 000000000..fb7383c89 --- /dev/null +++ b/docker/scripts/common/before_build.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set -ex + +rm -rf /package + +cd "${OLIVE_INSTALL_PREFIX}" +find . -type f -o -type l | cut -c3- > /tmp/previous-prefix-files.txt diff --git a/docker/scripts/common/copy_new_files.sh b/docker/scripts/common/copy_new_files.sh new file mode 100644 index 000000000..8c1009b4d --- /dev/null +++ b/docker/scripts/common/copy_new_files.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set -ex + +mkdir -p /package + +cd "${OLIVE_INSTALL_PREFIX}" +find . -type l -o -type f | cut -c3- > /tmp/new-prefix-files.txt +rsync -av --files-from=/tmp/new-prefix-files.txt --exclude-from=/tmp/previous-prefix-files.txt . /package/ diff --git a/docker/scripts/common/install_yumpackages.sh b/docker/scripts/common/install_yumpackages.sh new file mode 100644 index 000000000..f5003675c --- /dev/null +++ b/docker/scripts/common/install_yumpackages.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash +# Copyright (C) 2019 Olive Team +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later + +set -ex + +# TODO: Check if this causes any problems. ASWF doesn't run a yum update. +yum update -y + +# TODO: Add deps of deps which are explicitly listed in aswf-docker? +yum install --setopt=tsflags=nodocs -y \ + bzip2-devel \ + cups-libs \ + freetype-devel \ + giflib-devel \ + gstreamer1 gstreamer1-devel \ + gstreamer1-plugins-bad-free gstreamer1-plugins-bad-free-devel \ + libicu-devel \ + libmng-devel \ + LibRaw-devel \ + libwebp-devel \ + libXcomposite libXcomposite-devel \ + libXcursor libXcursor-devel \ + libxkbcommon libxkbcommon-devel \ + libxkbcommon-x11-devel \ + libXScrnSaver libXScrnSaver-devel \ + mesa-libGL-devel \ + openjpeg2-devel \ + pciutils-devel \ + pulseaudio-libs pulseaudio-libs-devel \ + python3-tkinter \ + zlib-devel + +# This is needed for Xvfb to function properly. +dbus-uuidgen > /etc/machine-id + +yum -y groupinstall "Development Tools" + +# TODO: Below code installs the obsolete devtoolset-6. +# Unclear which devtoolset it will be for VFX platform CY2021: +# https://groups.google.com/forum/#!topic/vfx-platform-discuss/_-_CPw1fD3c + +yum install -y --setopt=tsflags=nodocs centos-release-scl-rh yum-utils + +if [[ $DTS_VERSION == 6 ]]; then + # Use the centos vault as the original devtoolset-6 is not part of CentOS-7 anymore + sed -i 's/7/7.6.1810/g; s|^#\s*\(baseurl=http://\)mirror|\1vault|g; /mirrorlist/d' /etc/yum.repos.d/CentOS-SCLo-*.repo +fi + +yum install -y --setopt=tsflags=nodocs \ + "devtoolset-$DTS_VERSION-toolchain" + +yum install -y epel-release + +# Additional package that are not found initially +yum install -y \ + rh-git218 \ +# lame-devel +# libcaca-devel \ +# libdb4-devel \ +# libdc1394-devel \ +# p7zip \ +# yasm-devel \ +# zvbi-devel + +# TODO: Does clearing the cache have any negative side effects? +yum clean all + +# HACK: Qt5GuiConfigExtras.cmake expects libGL.so in /usr/local/lib64 but it gets installed to /usr/lib64 +ln -s /usr/lib64/libGL.so /usr/local/lib64/ +# Alternatively, we could edit /usr/local/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake +# - _qt5gui_find_extra_libs(OPENGL "/usr/local/lib64/libGL.so" "" "") +# + _qt5gui_find_extra_libs(OPENGL "/usr/lib64/libGL.so" "" "") From 921be8f08d82e2fd626e3afa5d454f096401b720 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Wed, 23 Sep 2020 11:38:36 +1000 Subject: [PATCH 71/71] ci: updated windows breakpad path --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0041f5fd0..8d3e873c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -213,7 +213,7 @@ jobs: windeployqt olive-editor/olive-editor.exe cp $(cygpath $GITHUB_WORKSPACE)/bin/*.dll olive-editor cp $(cygpath $GITHUB_WORKSPACE)/out/Default/crashpad_handler.exe olive-editor - cp $(cygpath $GITHUB_WORKSPACE)/minidump_stackwalk/* olive-editor + cp $(cygpath $GITHUB_WORKSPACE)/breakpad/bin/* olive-editor - name: Deploy Packages working-directory: ${{ runner.workspace }}/build