From 0c1ee5d3e6085493f095d254a0afbd946a9b0b1b Mon Sep 17 00:00:00 2001 From: Mathieu Westphal Date: Sat, 6 May 2023 08:27:32 +0200 Subject: [PATCH] Update docker images and add a EGL CI (#784) * Add an egl build * fixup egl * Use another docker image * Adding egl dep * install meson * rename * update mesa * missing tool * missing * remove useless * wayland * ii * iii * upload * Just update ! * Add vtk patch * update docker image * remove * Fixup assimp * Increasing threshold for one test * fixup external * fixup * fixup clang * fixups * fixup again * Adding upload * update images * Add doc * commit * commit2 --- .../0001-Fix-librt-link.patch | 25 ++++++++++ .github/actions/assimp-install-dep/action.yml | 7 +++ .../0001-fix-missing-limits-include.patch | 50 +++++++++++++++++++ .github/actions/vtk-install-dep/action.yml | 19 ++++++- .github/workflows/ci.yml | 28 ++++++++--- .tsan.supp | 4 ++ application/testing/CMakeLists.txt | 2 +- 7 files changed, 126 insertions(+), 9 deletions(-) create mode 100644 .github/actions/assimp-install-dep/0001-Fix-librt-link.patch create mode 100644 .github/actions/vtk-install-dep/0001-fix-missing-limits-include.patch diff --git a/.github/actions/assimp-install-dep/0001-Fix-librt-link.patch b/.github/actions/assimp-install-dep/0001-Fix-librt-link.patch new file mode 100644 index 0000000000..b3becad483 --- /dev/null +++ b/.github/actions/assimp-install-dep/0001-Fix-librt-link.patch @@ -0,0 +1,25 @@ +From 7339dda7aba5e32be553fe252c9d4f322cd9bdfe Mon Sep 17 00:00:00 2001 +From: Mathieu Westphal +Date: Thu, 4 May 2023 19:57:47 +0200 +Subject: [PATCH] Fix librt link + +--- + code/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt +index b87bc665f..9230548ea 100644 +--- a/code/CMakeLists.txt ++++ b/code/CMakeLists.txt +@@ -1327,7 +1327,7 @@ ENDIF() + + # Add RT-extension library for glTF importer with Open3DGC-compression. + IF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC) +- TARGET_LINK_LIBRARIES(assimp ${RT_LIBRARY}) ++ TARGET_LINK_LIBRARIES(assimp rt) + ENDIF () + + +-- +2.40.1 + diff --git a/.github/actions/assimp-install-dep/action.yml b/.github/actions/assimp-install-dep/action.yml index 3a2e5e2509..41855e7926 100644 --- a/.github/actions/assimp-install-dep/action.yml +++ b/.github/actions/assimp-install-dep/action.yml @@ -19,6 +19,13 @@ runs: path: './dependencies/assimp' ref: v5.2.5 + # https://github.com/assimp/assimp/pull/5087 + - name: Patch Assimp librt + if: steps.cache-assimp.outputs.cache-hit != 'true' + working-directory: ${{github.workspace}}/dependencies/assimp + shell: bash + run: patch -p1 < $GITHUB_ACTION_PATH/0001-Fix-librt-link.patch + - name: Setup ASSIMP if: steps.cache-assimp.outputs.cache-hit != 'true' working-directory: ${{github.workspace}}/dependencies diff --git a/.github/actions/vtk-install-dep/0001-fix-missing-limits-include.patch b/.github/actions/vtk-install-dep/0001-fix-missing-limits-include.patch new file mode 100644 index 0000000000..3cc0508614 --- /dev/null +++ b/.github/actions/vtk-install-dep/0001-fix-missing-limits-include.patch @@ -0,0 +1,50 @@ +From c30cbb45765c6f5369040a6fa2f80d8aed5687b4 Mon Sep 17 00:00:00 2001 +From: Mathieu Westphal +Date: Thu, 4 May 2023 08:26:04 +0200 +Subject: [PATCH] fix missing limits include + +--- + Common/Core/vtkGenericDataArrayLookupHelper.h | 1 + + Common/DataModel/vtkPiecewiseFunction.cxx | 1 + + Rendering/Core/vtkColorTransferFunction.cxx | 1 + + 3 files changed, 3 insertions(+) + +diff --git a/Common/Core/vtkGenericDataArrayLookupHelper.h b/Common/Core/vtkGenericDataArrayLookupHelper.h +index f278e27c0f..06995f4780 100644 +--- a/Common/Core/vtkGenericDataArrayLookupHelper.h ++++ b/Common/Core/vtkGenericDataArrayLookupHelper.h +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + namespace detail + { +diff --git a/Common/DataModel/vtkPiecewiseFunction.cxx b/Common/DataModel/vtkPiecewiseFunction.cxx +index c75935fd19..dfc6b04f76 100644 +--- a/Common/DataModel/vtkPiecewiseFunction.cxx ++++ b/Common/DataModel/vtkPiecewiseFunction.cxx +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + vtkStandardNewMacro(vtkPiecewiseFunction); + +diff --git a/Rendering/Core/vtkColorTransferFunction.cxx b/Rendering/Core/vtkColorTransferFunction.cxx +index 40504e5398..e1e0f25187 100644 +--- a/Rendering/Core/vtkColorTransferFunction.cxx ++++ b/Rendering/Core/vtkColorTransferFunction.cxx +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + vtkStandardNewMacro(vtkColorTransferFunction); + +-- +2.40.1 + diff --git a/.github/actions/vtk-install-dep/action.yml b/.github/actions/vtk-install-dep/action.yml index a47de56a6a..17827b6a8a 100644 --- a/.github/actions/vtk-install-dep/action.yml +++ b/.github/actions/vtk-install-dep/action.yml @@ -13,6 +13,11 @@ inputs: description: 'Label to control raytracing' required: false default: 'no-raytracing' + egl_label: + description: 'Label to control egl' + required: false + default: 'no-egl' + runs: using: "composite" steps: @@ -38,7 +43,7 @@ runs: uses: actions/cache@v3 with: path: dependencies/vtk_install - key: vtk-${{env.VTK_SHA_OR_TAG}}-${{runner.os}}-${{inputs.raytracing_label}}-1 + key: vtk-${{env.VTK_SHA_OR_TAG}}-${{runner.os}}-${{inputs.raytracing_label}}-${{inputs.egl_label}}-1 - name: Setup VTK if: steps.cache-vtk.outputs.cache-hit != 'true' @@ -59,6 +64,14 @@ runs: path: './dependencies/vtk' ref: ${{env.VTK_SHA_OR_TAG}} + - name: Patch VTK 9.0 limits include + if: | + steps.cache-vtk.outputs.cache-hit != 'true' && + inputs.vtk_version == 'v9.0.0' + working-directory: ${{github.workspace}}/dependencies/vtk + shell: bash + run: patch -p1 < $GITHUB_ACTION_PATH/0001-fix-missing-limits-include.patch + - name: Patch VTK 9.0 source macos if: | steps.cache-vtk.outputs.cache-hit != 'true' && @@ -83,12 +96,13 @@ runs: -DCMAKE_PREFIX_PATH:PATH=$(pwd)/../install/ -DVTKOSPRAY_ENABLE_DENOISER=ON -DVTK_BUILD_TESTING=OFF + -DVTK_DEBUG_LEAKS=ON + -DVTK_DEFAULT_RENDER_WINDOW_HEADLESS=${{ inputs.egl_label == 'egl' && 'ON' || 'OFF' }} -DVTK_ENABLE_LOGGING=OFF -DVTK_ENABLE_WRAPPING=OFF -DVTK_GROUP_ENABLE_Rendering=DEFAULT -DVTK_GROUP_ENABLE_StandAlone=DEFAULT -DVTK_LEGACY_REMOVE=ON - -DVTK_DEBUG_LEAKS=ON -DVTK_MODULE_ENABLE_VTK_CommonSystem=YES -DVTK_MODULE_ENABLE_VTK_FiltersGeneral=YES -DVTK_MODULE_ENABLE_VTK_FiltersGeometry=YES @@ -112,6 +126,7 @@ runs: -DVTK_MODULE_ENABLE_VTK_RenderingRayTracing=${{ inputs.raytracing_label == 'raytracing' && 'YES' || 'DEFAULT' }} -DVTK_MODULE_ENABLE_VTK_RenderingVolumeOpenGL2=YES -DVTK_MODULE_ENABLE_VTK_TestingCore=YES + -DVTK_OPENGL_HAS_EGL=${{ inputs.egl_label == 'egl' && 'ON' || 'OFF' }} -DVTK_VERSIONED_INSTALL=OFF ${{ inputs.vtk_version != 'v9.0.0' && '-DVTK_ENABLE_REMOTE_MODULES=OFF -DVTK_SMP_IMPLEMENTATION_TYPE=STDThread' || null }} ${{ runner.os == 'macOS' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15' || null }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 354794552b..30b8235261 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,7 @@ jobs: include: - raytracing_label: raytracing - bundle_label: no-bundle + - egl_label: no-egl - vtk_version: v9.0.0 raytracing_label: no-raytracing - os: windows @@ -39,6 +40,10 @@ jobs: vtk_version: commit raytracing_label: no-raytracing bundle_label: bundle + - build_type: headless + os: ubuntu + vtk_version: commit + egl_label: egl runs-on: ${{matrix.os}}-latest container: ${{ matrix.os == 'ubuntu' && 'ghcr.io/f3d-app/f3d-ci' || null }} @@ -82,6 +87,7 @@ jobs: vtk_version: ${{matrix.vtk_version}} vtk_sha_file: ./source/.github/actions/vtk_commit_sha raytracing_label: ${{matrix.raytracing_label}} + egl_label: ${{matrix.egl_label}} - name: Install F3D dependencies uses: ./source/.github/actions/f3d-dependencies @@ -100,7 +106,8 @@ jobs: if: | runner.os == 'Linux' && ( matrix.vtk_version == 'v9.0.0' || - matrix.vtk_version == 'v9.1.0' ) + matrix.vtk_version == 'v9.1.0' + ) working-directory: ${{github.workspace}}/dependencies/ shell: bash run: echo "LD_LIBRARY_PATH=$(pwd)/install/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV @@ -131,7 +138,7 @@ jobs: -DF3D_LINUX_GENERATE_MAN=ON -DF3D_LINUX_INSTALL_DEFAULT_CONFIGURATION_FILE_IN_PREFIX=ON -DF3D_MACOS_BUNDLE=${{ matrix.bundle_label == 'bundle' && 'ON' || 'OFF' }} - -DF3D_MODULE_EXTERNAL_RENDERING=ON + -DF3D_MODULE_EXTERNAL_RENDERING=${{ matrix.egl_label == 'egl' && 'OFF' || 'ON' }} -DF3D_MODULE_RAYTRACING=${{ matrix.raytracing_label == 'raytracing' && 'ON' || 'OFF' }} -DF3D_PLUGINS_STATIC_BUILD=${{ matrix.bundle_label == 'bundle' && 'ON' || 'OFF' }} -DF3D_PLUGIN_BUILD_ALEMBIC=ON @@ -152,7 +159,9 @@ jobs: run: cmake --build . --parallel 2 --config Release - name: Run Xvfb ubuntu - if: runner.os == 'Linux' + if: | + runner.os == 'Linux' && + matrix.egl_label != 'egl' run: Xvfb $DISPLAY -screen 0 1280x1024x24 & - name: Install Mesa Windows @@ -365,7 +374,7 @@ jobs: - name: Generate XML Coverage working-directory: ${{github.workspace}}/source run: | - lcov --base-directory . --directory . -c -o coverage.info --gcov-tool /usr/bin/gcov-8 + lcov --base-directory . --directory . -c -o coverage.info --gcov-tool /usr/bin/gcov lcov --remove coverage.info "*/dependencies/*" -o coverage.info lcov --remove coverage.info "*/cxxopts.hpp" -o coverage.info lcov --remove coverage.info "*/json.hpp" -o coverage.info @@ -396,8 +405,8 @@ jobs: env: DISPLAY: :0 - CC: clang-10 - CXX: clang++-10 + CC: clang + CXX: clang++ steps: @@ -470,3 +479,10 @@ jobs: export LSAN_OPTIONS=suppressions=$(pwd)/../source/.lsan.supp:use_tls=0 export TSAN_OPTIONS=suppressions=$(pwd)/../source/.tsan.supp ctest -C Release -j 2 --output-on-failure || ctest -C Release -j 1 --rerun-failed -VV + + - name: Upload Tests Artifact + if: failure() + uses: actions/upload-artifact@v3 + with: + path: ./build/Testing/Temporary + name: f3d-tests-artifact-sanitizer-${{matrix.santype}} diff --git a/.tsan.supp b/.tsan.supp index deff11d870..5353b712e8 100644 --- a/.tsan.supp +++ b/.tsan.supp @@ -1,2 +1,6 @@ # False positive with Qt test race:libQt5Core +race:libQt5XcbQpa + +# Issue in mesa sw_rast +race:swrast_dri diff --git a/application/testing/CMakeLists.txt b/application/testing/CMakeLists.txt index b9abf89f0f..733fcef23c 100644 --- a/application/testing/CMakeLists.txt +++ b/application/testing/CMakeLists.txt @@ -288,7 +288,7 @@ if(VTK_VERSION VERSION_GREATER_EQUAL 9.2.20221220) f3d_test(NAME TestHDRI8Bit DATA suzanne.ply ARGS --hdri=${CMAKE_SOURCE_DIR}/testing/data/logo.tif HDRI) f3d_test(NAME TestHDRIOrient DATA suzanne.stl ARGS --up=+Z --hdri=${CMAKE_SOURCE_DIR}/testing/data/palermo_park_1k.hdr HDRI) f3d_test(NAME TestHDRIToneMapping DATA suzanne.ply ARGS -t --hdri=${CMAKE_SOURCE_DIR}/testing/data/palermo_park_1k.hdr HDRI) - f3d_test(NAME TestInteractionHDRIMove DATA suzanne.ply ARGS --hdri=${CMAKE_SOURCE_DIR}/testing/data/palermo_park_1k.hdr HDRI INTERACTION) #Shift+MouseRight; + f3d_test(NAME TestInteractionHDRIMove DATA suzanne.ply ARGS --hdri=${CMAKE_SOURCE_DIR}/testing/data/palermo_park_1k.hdr HDRI INTERACTION THRESHOLD 60) #Shift+MouseRight; f3d_test(NAME TestInteractionHDRIBlur DATA suzanne.ply ARGS --hdri=${CMAKE_SOURCE_DIR}/testing/data/palermo_park_1k.hdr INTERACTION HDRI DEFAULT_LIGHTS) #U f3d_test(NAME TestInteractionHDRIReload DATA suzanne.ply ARGS --hdri=${CMAKE_SOURCE_DIR}/testing/data/palermo_park_1k.hdr INTERACTION HDRI DEFAULT_LIGHTS) #Up f3d_test(NAME TestInteractionHDRIChange DATA multi ARGS --hdri=${CMAKE_SOURCE_DIR}/testing/data/palermo_park_1k.hdr INTERACTION HDRI DEFAULT_LIGHTS) #Right