From 48e90f8734e3d09d9b461d2232914a429240a381 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 26 Nov 2024 11:19:45 -0500 Subject: [PATCH 01/13] WIP: Better OpenGL --- .gitignore | 1 + action.yml | 10 +++----- windows/install_opengl.ps1 | 51 -------------------------------------- windows/install_opengl.sh | 8 ++++++ 4 files changed, 12 insertions(+), 58 deletions(-) create mode 100644 .gitignore delete mode 100644 windows/install_opengl.ps1 create mode 100755 windows/install_opengl.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/action.yml b/action.yml index b5b04bd..4b97d5a 100644 --- a/action.yml +++ b/action.yml @@ -55,14 +55,10 @@ runs: mesa-utils \ x11-utils - - name: Install Windows GL Dependencies + - name: Install OpenGL on Windows if: runner.os == 'Windows' - shell: cmd - run: | - Set-StrictMode -Version Latest - $ErrorActionPreference = "Stop" - $PSDefaultParameterValues['*:ErrorAction']='Stop' - powershell ${{ github.action_path }}/windows/install_opengl.ps1 + shell: bash + run: bash ${{ github.action_path }}/windows/install_opengl.sh - name: Configure headless display on Linux if: runner.os == 'Linux' diff --git a/windows/install_opengl.ps1 b/windows/install_opengl.ps1 deleted file mode 100644 index 84b5521..0000000 --- a/windows/install_opengl.ps1 +++ /dev/null @@ -1,51 +0,0 @@ -# Sample script to install Python and pip under Windows -# Authors: Olivier Grisel, Jonathan Helmus and Kyle Kastner -# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ - -# Adapted from VisPy - -$MESA_GL_URL = "https://github.com/vispy/demo-data/raw/main/mesa/" - -# Mesa DLLs found linked from: -# http://qt-project.org/wiki/Cross-compiling-Mesa-for-Windows -# to: -# http://sourceforge.net/projects/msys2/files/REPOS/MINGW/x86_64/mingw-w64-x86_64-mesa-10.2.4-1-any.pkg.tar.xz/download - -function DownloadMesaOpenGL ($architecture) { - [Net.ServicePointManager]::SecurityProtocol = 'Tls, Tls11, Tls12' - $webclient = New-Object System.Net.WebClient - # Download and retry up to 3 times in case of network transient errors. - $url = $MESA_GL_URL + "opengl32_mingw_" + $architecture + ".dll" - if ($architecture -eq "32") { - $filepath = "C:\Windows\SysWOW64\opengl32.dll" - } else { - $filepath = "C:\Windows\system32\opengl32.dll" - } - takeown /F $filepath /A - icacls $filepath /grant "${env:ComputerName}\${env:UserName}:F" - Remove-item -LiteralPath $filepath - Write-Host "Downloading" $url - $retry_attempts = 2 - for($i=0; $i -lt $retry_attempts; $i++){ - try { - $webclient.DownloadFile($url, $filepath) - break - } - Catch [Exception]{ - Start-Sleep 1 - } - } - if (Test-Path $filepath) { - Write-Host "File saved at" $filepath - } else { - # Retry once to get the error message if any at the last try - $webclient.DownloadFile($url, $filepath) - } -} - - -function main () { - DownloadMesaOpenGL "64" -} - -main diff --git a/windows/install_opengl.sh b/windows/install_opengl.sh new file mode 100755 index 0000000..ed32214 --- /dev/null +++ b/windows/install_opengl.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -exo pipefail + +wget https://github.com/pal1000/mesa-dist-win/releases/download/24.2.7/mesa3d-24.2.7-release-msvc.7z +7z x mesa3d-24.2.7-release-msvc.7z +sudo mv mesa3d-24.2.7-release-msvc/x64/* /C/Windows/System32/ +takeown /f "C:\Windows\System32\opengl32.dll" +icacls "C:\Windows\System32\opengl32.dll" /grant "$USERNAME:F" From 7d0198470f3f92502786bf3aebad98375db0044d Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 26 Nov 2024 11:21:00 -0500 Subject: [PATCH 02/13] TST: Ping From cb96a6b6a24017de1582ebe727f59453e490d50e Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 26 Nov 2024 11:22:55 -0500 Subject: [PATCH 03/13] FIX: More --- .github/workflows/local.yml | 21 +++++++++++---------- action.yml | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/local.yml b/.github/workflows/local.yml index 9c267f5..6934853 100644 --- a/.github/workflows/local.yml +++ b/.github/workflows/local.yml @@ -16,17 +16,18 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-14, macos-13, ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, windows-2019, windows-2022] + #os: [macos-14, macos-13, ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, windows-2019, windows-2022] + os: [windows-2019, windows-2022] qt: [""] - include: - - os: ubuntu-20.04 - qt: "pyqt5" - - os: ubuntu-24.04 - qt: "pyqt6" - - os: windows-latest - qt: "pyqt6" - - os: ubuntu-latest - qt: "pyside6" + #include: + #- os: ubuntu-20.04 + # qt: "pyqt5" + #- os: ubuntu-24.04 + # qt: "pyqt6" + #- os: windows-latest + # qt: "pyqt6" + #- os: ubuntu-latest + # qt: "pyside6" runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 diff --git a/action.yml b/action.yml index 4b97d5a..6f70831 100644 --- a/action.yml +++ b/action.yml @@ -58,7 +58,7 @@ runs: - name: Install OpenGL on Windows if: runner.os == 'Windows' shell: bash - run: bash ${{ github.action_path }}/windows/install_opengl.sh + run: bash $(cygpath -u ${{ github.action_path }})/windows/install_opengl.sh - name: Configure headless display on Linux if: runner.os == 'Linux' From 3a4f4ad2d54a51c396a275fff2a177f83803846a Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 26 Nov 2024 11:25:09 -0500 Subject: [PATCH 04/13] FIX --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 6f70831..bc89842 100644 --- a/action.yml +++ b/action.yml @@ -57,8 +57,8 @@ runs: - name: Install OpenGL on Windows if: runner.os == 'Windows' - shell: bash - run: bash $(cygpath -u ${{ github.action_path }})/windows/install_opengl.sh + shell: cmd + run: bash ${{ github.action_path }}\windows\install_opengl.sh - name: Configure headless display on Linux if: runner.os == 'Linux' From fee860bf44eae764bb1a0da9c79f84d39b348bf2 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 26 Nov 2024 11:26:11 -0500 Subject: [PATCH 05/13] FIX: curl --- windows/install_opengl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/install_opengl.sh b/windows/install_opengl.sh index ed32214..f1a21b6 100755 --- a/windows/install_opengl.sh +++ b/windows/install_opengl.sh @@ -1,7 +1,7 @@ #!/bin/bash set -exo pipefail -wget https://github.com/pal1000/mesa-dist-win/releases/download/24.2.7/mesa3d-24.2.7-release-msvc.7z +curl -O https://github.com/pal1000/mesa-dist-win/releases/download/24.2.7/mesa3d-24.2.7-release-msvc.7z 7z x mesa3d-24.2.7-release-msvc.7z sudo mv mesa3d-24.2.7-release-msvc/x64/* /C/Windows/System32/ takeown /f "C:\Windows\System32\opengl32.dll" From a3c4720c178d9ef9e6774c6a8cf03b8dcc066de3 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 26 Nov 2024 11:27:24 -0500 Subject: [PATCH 06/13] FIX: Redirect --- windows/install_opengl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/install_opengl.sh b/windows/install_opengl.sh index f1a21b6..cfbdb95 100755 --- a/windows/install_opengl.sh +++ b/windows/install_opengl.sh @@ -1,7 +1,7 @@ #!/bin/bash set -exo pipefail -curl -O https://github.com/pal1000/mesa-dist-win/releases/download/24.2.7/mesa3d-24.2.7-release-msvc.7z +curl -LO https://github.com/pal1000/mesa-dist-win/releases/download/24.2.7/mesa3d-24.2.7-release-msvc.7z 7z x mesa3d-24.2.7-release-msvc.7z sudo mv mesa3d-24.2.7-release-msvc/x64/* /C/Windows/System32/ takeown /f "C:\Windows\System32\opengl32.dll" From f0024fa69eb6de321ba039a17b13aebc67a3b777 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 26 Nov 2024 12:33:52 -0500 Subject: [PATCH 07/13] FIX: More --- windows/install_opengl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/install_opengl.sh b/windows/install_opengl.sh index cfbdb95..c457116 100755 --- a/windows/install_opengl.sh +++ b/windows/install_opengl.sh @@ -3,6 +3,6 @@ set -exo pipefail curl -LO https://github.com/pal1000/mesa-dist-win/releases/download/24.2.7/mesa3d-24.2.7-release-msvc.7z 7z x mesa3d-24.2.7-release-msvc.7z -sudo mv mesa3d-24.2.7-release-msvc/x64/* /C/Windows/System32/ +mv -v mesa3d-24.2.7-release-msvc/x64/* /C/Windows/System32/ takeown /f "C:\Windows\System32\opengl32.dll" icacls "C:\Windows\System32\opengl32.dll" /grant "$USERNAME:F" From 3fdc3caa3cbe3763eb1eba2a835a9499e920978a Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 26 Nov 2024 12:36:43 -0500 Subject: [PATCH 08/13] FIX: Path --- windows/install_opengl.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/windows/install_opengl.sh b/windows/install_opengl.sh index c457116..7132a49 100755 --- a/windows/install_opengl.sh +++ b/windows/install_opengl.sh @@ -1,8 +1,11 @@ #!/bin/bash set -exo pipefail - -curl -LO https://github.com/pal1000/mesa-dist-win/releases/download/24.2.7/mesa3d-24.2.7-release-msvc.7z -7z x mesa3d-24.2.7-release-msvc.7z -mv -v mesa3d-24.2.7-release-msvc/x64/* /C/Windows/System32/ +VER="24.2.7" +NAME="mesa3d-${VER}-release-msvc" +curl -LO https://github.com/pal1000/mesa-dist-win/releases/download/${VER}/${NAME}.7z +7z x ${NAME}.7z -o./${NAME} +ls -alR ${NAME}/ +mv -v ${NAME}/x64/* /C/Windows/System32/ +rm -Rf ${NAME} takeown /f "C:\Windows\System32\opengl32.dll" icacls "C:\Windows\System32\opengl32.dll" /grant "$USERNAME:F" From 22d146f745803d3814c05d77fe0076d9a3cffe77 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 26 Nov 2024 12:41:18 -0500 Subject: [PATCH 09/13] FIX: Maybe --- windows/install_opengl.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/windows/install_opengl.sh b/windows/install_opengl.sh index 7132a49..6cbf9db 100755 --- a/windows/install_opengl.sh +++ b/windows/install_opengl.sh @@ -7,5 +7,5 @@ curl -LO https://github.com/pal1000/mesa-dist-win/releases/download/${VER}/${NAM ls -alR ${NAME}/ mv -v ${NAME}/x64/* /C/Windows/System32/ rm -Rf ${NAME} -takeown /f "C:\Windows\System32\opengl32.dll" -icacls "C:\Windows\System32\opengl32.dll" /grant "$USERNAME:F" +# takeown "/f" "C:\Windows\System32\opengl32.dll" +# icacls "C:\Windows\System32\opengl32.dll" /grant "$USERNAME:F" From 78e6e1139ce9e9409c9eab27b6f7d014d7906a5e Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 26 Nov 2024 12:41:51 -0500 Subject: [PATCH 10/13] FIX --- windows/install_opengl.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/windows/install_opengl.sh b/windows/install_opengl.sh index 6cbf9db..77392fc 100755 --- a/windows/install_opengl.sh +++ b/windows/install_opengl.sh @@ -1,5 +1,6 @@ #!/bin/bash set -exo pipefail +ls -alt /C/Windows/System32/opengl32.dll VER="24.2.7" NAME="mesa3d-${VER}-release-msvc" curl -LO https://github.com/pal1000/mesa-dist-win/releases/download/${VER}/${NAME}.7z @@ -9,3 +10,4 @@ mv -v ${NAME}/x64/* /C/Windows/System32/ rm -Rf ${NAME} # takeown "/f" "C:\Windows\System32\opengl32.dll" # icacls "C:\Windows\System32\opengl32.dll" /grant "$USERNAME:F" +ls -alt /C/Windows/System32/opengl32.dll From 92935caaa8e1d2c762a21ac8c97f463bd4f69698 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 26 Nov 2024 12:47:49 -0500 Subject: [PATCH 11/13] FIX --- .github/workflows/local.yml | 21 +++++++++++---------- windows/install_opengl.sh | 1 - 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/local.yml b/.github/workflows/local.yml index 6934853..e768eba 100644 --- a/.github/workflows/local.yml +++ b/.github/workflows/local.yml @@ -16,18 +16,18 @@ jobs: strategy: fail-fast: false matrix: - #os: [macos-14, macos-13, ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, windows-2019, windows-2022] + os: [macos-14, macos-13, ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, windows-2019, windows-2022] os: [windows-2019, windows-2022] qt: [""] - #include: - #- os: ubuntu-20.04 - # qt: "pyqt5" - #- os: ubuntu-24.04 - # qt: "pyqt6" - #- os: windows-latest - # qt: "pyqt6" - #- os: ubuntu-latest - # qt: "pyside6" + include: + - os: ubuntu-20.04 + qt: "pyqt5" + - os: ubuntu-24.04 + qt: "pyqt6" + - os: windows-latest + qt: "pyqt6" + - os: ubuntu-latest + qt: "pyside6" runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -40,6 +40,7 @@ jobs: python-version: "3.12" - run: pip install pyvista - run: python tests/test_pyvista.py + - run: python -c "import pyvista;pyvista.Report()" - uses: actions/upload-artifact@v4 with: name: ${{ matrix.os }}-${{ matrix.qt }}-sphere diff --git a/windows/install_opengl.sh b/windows/install_opengl.sh index 77392fc..f201e5f 100755 --- a/windows/install_opengl.sh +++ b/windows/install_opengl.sh @@ -5,7 +5,6 @@ VER="24.2.7" NAME="mesa3d-${VER}-release-msvc" curl -LO https://github.com/pal1000/mesa-dist-win/releases/download/${VER}/${NAME}.7z 7z x ${NAME}.7z -o./${NAME} -ls -alR ${NAME}/ mv -v ${NAME}/x64/* /C/Windows/System32/ rm -Rf ${NAME} # takeown "/f" "C:\Windows\System32\opengl32.dll" From b50daad974f6913a49e6fdd1e5025f9bcfd23ac2 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 26 Nov 2024 12:49:33 -0500 Subject: [PATCH 12/13] FIX --- .github/workflows/local.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/local.yml b/.github/workflows/local.yml index e768eba..a9b0ec8 100644 --- a/.github/workflows/local.yml +++ b/.github/workflows/local.yml @@ -17,7 +17,6 @@ jobs: fail-fast: false matrix: os: [macos-14, macos-13, ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, windows-2019, windows-2022] - os: [windows-2019, windows-2022] qt: [""] include: - os: ubuntu-20.04 From 00b3dd1980b7f91f48c1747e0c3d7c8b7b131ec6 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 26 Nov 2024 12:52:02 -0500 Subject: [PATCH 13/13] FIX: Print --- .github/workflows/local.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/local.yml b/.github/workflows/local.yml index a9b0ec8..5c74ab7 100644 --- a/.github/workflows/local.yml +++ b/.github/workflows/local.yml @@ -39,7 +39,7 @@ jobs: python-version: "3.12" - run: pip install pyvista - run: python tests/test_pyvista.py - - run: python -c "import pyvista;pyvista.Report()" + - run: python -c "import pyvista;print(pyvista.Report())" - uses: actions/upload-artifact@v4 with: name: ${{ matrix.os }}-${{ matrix.qt }}-sphere