From e01a7cfde6d56e3cbf57de81605c409c7ff1dd1f Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Thu, 20 Jan 2022 22:18:10 +0100 Subject: [PATCH 01/63] move windows workflow to disk C --- .github/workflows/build_windows_wheels.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 67ebd04..c05fddc 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -30,22 +30,30 @@ jobs: run: | git config --global core.longpaths true + - name: Move repository to disk C. + shell: bash + run: | + move ${GITHUB_REPOSITORY##*/} C:/${GITHUB_REPOSITORY##*/} + - name: WebRTC cache. uses: actions/cache@v2 with: - path: third_party/libwebrtc + path: "C:/${GITHUB_REPOSITORY##*/}/third_party/libwebrtc" key: ${{ runner.os }}-cache-webrtc-${{ env.WEBRTC_CACHE_KEY }} - name: Build wheels. - uses: pypa/cibuildwheel@v2.3.1 + working-directory: "C:/${GITHUB_REPOSITORY##*/}" env: CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* - # CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" + CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" + run: | + pip install cibuildwheel==2.3.1 + cibuildwheel - name: Upload artifacts. uses: actions/upload-artifact@v2 with: name: "wrtc wheels for Windows" - path: .\wheelhouse\*.whl + path: "C:/${GITHUB_REPOSITORY##*/}/wheelhouse/*.whl" From c3e10e25d249d406390ddb4451e728c06aa89452 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Thu, 20 Jan 2022 22:21:19 +0100 Subject: [PATCH 02/63] move windows workflow to disk C (2) --- .github/workflows/build_windows_wheels.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index c05fddc..9ac7aa8 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -31,7 +31,6 @@ jobs: git config --global core.longpaths true - name: Move repository to disk C. - shell: bash run: | move ${GITHUB_REPOSITORY##*/} C:/${GITHUB_REPOSITORY##*/} From 92960ef2779606f62e5c64caa5bcc12c3d2ce600 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Thu, 20 Jan 2022 22:26:14 +0100 Subject: [PATCH 03/63] move windows workflow to disk C (3) --- .github/workflows/build_windows_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 9ac7aa8..9aa8ccd 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -32,7 +32,7 @@ jobs: - name: Move repository to disk C. run: | - move ${GITHUB_REPOSITORY##*/} C:/${GITHUB_REPOSITORY##*/} + move %GITHUB_REPOSITORY% C:/%GITHUB_REPOSITORY% - name: WebRTC cache. uses: actions/cache@v2 From 0ecf07b90a8f4622bed56831f855d29776527bd2 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Thu, 20 Jan 2022 22:30:38 +0100 Subject: [PATCH 04/63] move windows workflow to disk C (4) --- .github/workflows/build_windows_wheels.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 9aa8ccd..200ffa8 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -32,16 +32,16 @@ jobs: - name: Move repository to disk C. run: | - move %GITHUB_REPOSITORY% C:/%GITHUB_REPOSITORY% + move . C:/src - name: WebRTC cache. uses: actions/cache@v2 with: - path: "C:/${GITHUB_REPOSITORY##*/}/third_party/libwebrtc" + path: "C:/src/third_party/libwebrtc" key: ${{ runner.os }}-cache-webrtc-${{ env.WEBRTC_CACHE_KEY }} - name: Build wheels. - working-directory: "C:/${GITHUB_REPOSITORY##*/}" + working-directory: "C:/src" env: CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* @@ -55,4 +55,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: "wrtc wheels for Windows" - path: "C:/${GITHUB_REPOSITORY##*/}/wheelhouse/*.whl" + path: "C:/src/wheelhouse/*.whl" From a327c3d64bc697391b8f57ed74b6598ca7178c8f Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Thu, 20 Jan 2022 22:35:28 +0100 Subject: [PATCH 05/63] move windows workflow to disk C (5) --- .github/workflows/build_windows_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 200ffa8..9004ce4 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -32,7 +32,7 @@ jobs: - name: Move repository to disk C. run: | - move . C:/src + xcopy . C:\src\ /E/H - name: WebRTC cache. uses: actions/cache@v2 From d0f4b99c43117cf0a4dbed2de74b1cee5a616ab5 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Thu, 20 Jan 2022 23:56:14 +0100 Subject: [PATCH 06/63] move windows workflow to disk C (6) --- .github/workflows/build_windows_wheels.yml | 3 ++- python-webrtc/cpp/src/interfaces/peer_connection_factory.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 9004ce4..92cae65 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -11,7 +11,8 @@ on: - 'CMakeLists.txt' - 'setup.py' jobs: - # TODO migrate to disk C because on D not enough space... + # Disk C is used to bypass limitation of default disk space + # ref: https://github.com/actions/virtual-environments/issues/1341 build_wheels_for_windows: name: Build and publish wheels for Windows runs-on: windows-latest diff --git a/python-webrtc/cpp/src/interfaces/peer_connection_factory.h b/python-webrtc/cpp/src/interfaces/peer_connection_factory.h index 0faf72e..d0907a6 100644 --- a/python-webrtc/cpp/src/interfaces/peer_connection_factory.h +++ b/python-webrtc/cpp/src/interfaces/peer_connection_factory.h @@ -5,6 +5,8 @@ #pragma once +#include + #include #include #include From 80368567905fa3856a2c16ac131cfe15671cfe95 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Fri, 21 Jan 2022 00:04:54 +0100 Subject: [PATCH 07/63] move windows workflow to disk C (7) --- python-webrtc/cpp/src/interfaces/rtc_audio_track_source.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python-webrtc/cpp/src/interfaces/rtc_audio_track_source.h b/python-webrtc/cpp/src/interfaces/rtc_audio_track_source.h index 2871efd..53e38f6 100644 --- a/python-webrtc/cpp/src/interfaces/rtc_audio_track_source.h +++ b/python-webrtc/cpp/src/interfaces/rtc_audio_track_source.h @@ -4,6 +4,8 @@ #pragma once +#include + #include #include "peer_connection_factory.h" From 5d5ded23aeb7012d20c37fc22edb32101d2eb71a Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Fri, 21 Jan 2022 08:14:27 +0100 Subject: [PATCH 08/63] move windows workflow to disk C (8) --- .github/workflows/build_windows_wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 92cae65..6451a08 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -44,6 +44,7 @@ jobs: - name: Build wheels. working-directory: "C:/src" env: + CIBW_ARCHS: AMD64 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* From dc3d4ae031631ff90490277e8da564a0db06f127 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Fri, 21 Jan 2022 11:23:14 +0100 Subject: [PATCH 09/63] move windows workflow to disk C (9) --- .github/workflows/build_windows_wheels.yml | 27 ++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 6451a08..4a66bc9 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -17,6 +17,13 @@ jobs: name: Build and publish wheels for Windows runs-on: windows-latest + strategy: + matrix: + arch: [ + "x32", + "x64", + ] + env: WEBRTC_CACHE_KEY: "1" @@ -39,11 +46,27 @@ jobs: uses: actions/cache@v2 with: path: "C:/src/third_party/libwebrtc" - key: ${{ runner.os }}-cache-webrtc-${{ env.WEBRTC_CACHE_KEY }} + key: ${{ runner.os }}-${{ matrix.arch }}-cache-webrtc-${{ env.WEBRTC_CACHE_KEY }} + + - name: Build wheels for x32. + if: matrix.arch == "x32" + working-directory: "C:/src" + env: + CIBW_BEFORE_BUILD: call vcvars32.bat && cd C:/src/third_part/depot_tool/src && git stash + CIBW_ARCHS: x86 + CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" + CIBW_BUILD: cp3*-* + CIBW_SKIP: cp36-* + CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" + run: | + pip install cibuildwheel==2.3.1 + cibuildwheel - - name: Build wheels. + - name: Build wheels for x64. + if: matrix.arch == "x64" working-directory: "C:/src" env: + CIBW_BEFORE_BUILD: cd C:/src/third_part/depot_tool/src && git stash CIBW_ARCHS: AMD64 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* From 4a986f508c411136fe5ea443cc27b8f9db1a1e29 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Fri, 21 Jan 2022 11:31:14 +0100 Subject: [PATCH 10/63] move windows workflow to disk C (10) --- .github/workflows/build_windows_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 4a66bc9..d1f0195 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -49,7 +49,7 @@ jobs: key: ${{ runner.os }}-${{ matrix.arch }}-cache-webrtc-${{ env.WEBRTC_CACHE_KEY }} - name: Build wheels for x32. - if: matrix.arch == "x32" + if: matrix.arch == x32 working-directory: "C:/src" env: CIBW_BEFORE_BUILD: call vcvars32.bat && cd C:/src/third_part/depot_tool/src && git stash @@ -63,7 +63,7 @@ jobs: cibuildwheel - name: Build wheels for x64. - if: matrix.arch == "x64" + if: matrix.arch == x64 working-directory: "C:/src" env: CIBW_BEFORE_BUILD: cd C:/src/third_part/depot_tool/src && git stash From d71099ebdf71ccb8649bae857022fddde24c721a Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Fri, 21 Jan 2022 11:33:40 +0100 Subject: [PATCH 11/63] move windows workflow to disk C (11) --- .github/workflows/build_windows_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index d1f0195..3a2435e 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -49,7 +49,7 @@ jobs: key: ${{ runner.os }}-${{ matrix.arch }}-cache-webrtc-${{ env.WEBRTC_CACHE_KEY }} - name: Build wheels for x32. - if: matrix.arch == x32 + if: matrix.arch == 'x32' working-directory: "C:/src" env: CIBW_BEFORE_BUILD: call vcvars32.bat && cd C:/src/third_part/depot_tool/src && git stash @@ -63,7 +63,7 @@ jobs: cibuildwheel - name: Build wheels for x64. - if: matrix.arch == x64 + if: matrix.arch == 'x64' working-directory: "C:/src" env: CIBW_BEFORE_BUILD: cd C:/src/third_part/depot_tool/src && git stash From 9602940762bebc852fb07d476fa19af5b56d2b98 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Fri, 21 Jan 2022 11:43:17 +0100 Subject: [PATCH 12/63] move windows workflow to disk C (12) --- .github/workflows/build_windows_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 3a2435e..adec4e2 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -52,7 +52,7 @@ jobs: if: matrix.arch == 'x32' working-directory: "C:/src" env: - CIBW_BEFORE_BUILD: call vcvars32.bat && cd C:/src/third_part/depot_tool/src && git stash + CIBW_BEFORE_BUILD: call "%vsappiddir%..\..\VC\Auxiliary\Build\vcvars32.bat" x86 && cd C:/src/third_part/depot_tool/src && git stash CIBW_ARCHS: x86 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* From f1f0d7e98861c31edf88315182dd08f517318fa5 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Fri, 21 Jan 2022 12:05:34 +0100 Subject: [PATCH 13/63] move windows workflow to disk C (13) --- .github/workflows/build_windows_wheels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index adec4e2..c51a554 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -36,6 +36,7 @@ jobs: - name: Set up git config. shell: bash run: | + echo "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\" >> $GITHUB_PATH git config --global core.longpaths true - name: Move repository to disk C. @@ -52,7 +53,7 @@ jobs: if: matrix.arch == 'x32' working-directory: "C:/src" env: - CIBW_BEFORE_BUILD: call "%vsappiddir%..\..\VC\Auxiliary\Build\vcvars32.bat" x86 && cd C:/src/third_part/depot_tool/src && git stash + CIBW_BEFORE_BUILD: call vcvars32.bat && cd C:/src/third_part/depot_tool/src && git stash CIBW_ARCHS: x86 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* From fe75aaeb7a41fff42e541cffe8de611d7ebc128c Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Fri, 21 Jan 2022 12:17:32 +0100 Subject: [PATCH 14/63] move windows workflow to disk C (14) --- .github/workflows/build_windows_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index c51a554..820b152 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -53,7 +53,7 @@ jobs: if: matrix.arch == 'x32' working-directory: "C:/src" env: - CIBW_BEFORE_BUILD: call vcvars32.bat && cd C:/src/third_part/depot_tool/src && git stash + CIBW_BEFORE_BUILD: call vcvars32.bat && cd C:/src/third_party/depot_tool/src && git stash CIBW_ARCHS: x86 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* @@ -67,7 +67,7 @@ jobs: if: matrix.arch == 'x64' working-directory: "C:/src" env: - CIBW_BEFORE_BUILD: cd C:/src/third_part/depot_tool/src && git stash + CIBW_BEFORE_BUILD: cd C:/src/third_party/depot_tool/src && git stash CIBW_ARCHS: AMD64 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* From ef7a7071b40ef2f06523df90d96bd4bb28a7bf3e Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Fri, 21 Jan 2022 12:28:01 +0100 Subject: [PATCH 15/63] move windows workflow to disk C (15) --- .github/workflows/build_windows_wheels.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 820b152..1d3b381 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -33,7 +33,7 @@ jobs: with: submodules: recursive - - name: Set up git config. + - name: Set up environment. shell: bash run: | echo "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\" >> $GITHUB_PATH @@ -53,11 +53,12 @@ jobs: if: matrix.arch == 'x32' working-directory: "C:/src" env: - CIBW_BEFORE_BUILD: call vcvars32.bat && cd C:/src/third_party/depot_tool/src && git stash + CIBW_BEFORE_BUILD: call vcvars32.bat CIBW_ARCHS: x86 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* + CIBW_BEFORE_TEST: cd C:\src\third_party\depot_tool\src && git stash CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" run: | pip install cibuildwheel==2.3.1 @@ -67,11 +68,11 @@ jobs: if: matrix.arch == 'x64' working-directory: "C:/src" env: - CIBW_BEFORE_BUILD: cd C:/src/third_party/depot_tool/src && git stash CIBW_ARCHS: AMD64 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* + CIBW_BEFORE_TEST: cd C:\src\third_party\depot_tool\src && git stash CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" run: | pip install cibuildwheel==2.3.1 From 4d9e550b9e3173a96a4f86373ffaf15b49e83f4d Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Fri, 21 Jan 2022 13:37:10 +0100 Subject: [PATCH 16/63] move windows workflow to disk C (16) --- .github/workflows/build_windows_wheels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 1d3b381..5ee0fd2 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -20,7 +20,7 @@ jobs: strategy: matrix: arch: [ - "x32", +# "x32", "x64", ] @@ -58,7 +58,7 @@ jobs: CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* - CIBW_BEFORE_TEST: cd C:\src\third_party\depot_tool\src && git stash + CIBW_BEFORE_TEST: cd /d C:\src\third_party\depot_tool\src && git stash CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" run: | pip install cibuildwheel==2.3.1 @@ -72,7 +72,7 @@ jobs: CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* - CIBW_BEFORE_TEST: cd C:\src\third_party\depot_tool\src && git stash + CIBW_BEFORE_TEST: cd /d C:\src\third_party\depot_tool\src && git stash CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" run: | pip install cibuildwheel==2.3.1 From 6520d2f2189101dda15a011cf2bf7c562093e8b9 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Fri, 21 Jan 2022 15:21:14 +0100 Subject: [PATCH 17/63] move windows workflow to disk C (17) --- .github/workflows/build_windows_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 5ee0fd2..3bdd564 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -72,7 +72,7 @@ jobs: CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* - CIBW_BEFORE_TEST: cd /d C:\src\third_party\depot_tool\src && git stash + CIBW_BEFORE_TEST: cd third_party\depot_tool\src && git stash CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" run: | pip install cibuildwheel==2.3.1 From 0e3db8adb9088eb89d1d4484147bca02be8c9c90 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Fri, 21 Jan 2022 19:55:00 +0100 Subject: [PATCH 18/63] move windows workflow to disk C (18) --- .github/workflows/build_windows_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 3bdd564..432a721 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -58,7 +58,7 @@ jobs: CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* - CIBW_BEFORE_TEST: cd /d C:\src\third_party\depot_tool\src && git stash + CIBW_BEFORE_TEST: cd /d C:\src\third_party\depot_tools\src && git stash CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" run: | pip install cibuildwheel==2.3.1 @@ -72,7 +72,7 @@ jobs: CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* - CIBW_BEFORE_TEST: cd third_party\depot_tool\src && git stash + CIBW_BEFORE_TEST: cd /d C:\src\third_party\depot_tools\src && git stash CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" run: | pip install cibuildwheel==2.3.1 From a106ea3c515a3d8f27b57f84e22a0cf53f667da7 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Fri, 21 Jan 2022 21:07:44 +0100 Subject: [PATCH 19/63] move windows workflow to disk C (19) --- .github/workflows/build_windows_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 432a721..3c3d3f7 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -58,7 +58,7 @@ jobs: CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* - CIBW_BEFORE_TEST: cd /d C:\src\third_party\depot_tools\src && git stash + CIBW_BEFORE_TEST: rmdir C:\src\third_party\depot_tools CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" run: | pip install cibuildwheel==2.3.1 @@ -72,7 +72,7 @@ jobs: CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* - CIBW_BEFORE_TEST: cd /d C:\src\third_party\depot_tools\src && git stash + CIBW_BEFORE_TEST: rmdir C:\src\third_party\depot_tools CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" run: | pip install cibuildwheel==2.3.1 From 9ca5976854478feb5109823709a99282c032a88e Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Fri, 21 Jan 2022 22:19:11 +0100 Subject: [PATCH 20/63] move windows workflow to disk C (20) --- .github/workflows/build_windows_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 3c3d3f7..5843d27 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -58,7 +58,7 @@ jobs: CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* - CIBW_BEFORE_TEST: rmdir C:\src\third_party\depot_tools + CIBW_BEFORE_TEST: rmdir C:\src\third_party\depot_tools /s /q CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" run: | pip install cibuildwheel==2.3.1 @@ -72,7 +72,7 @@ jobs: CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* - CIBW_BEFORE_TEST: rmdir C:\src\third_party\depot_tools + CIBW_BEFORE_TEST: rmdir C:\src\third_party\depot_tools /s /q CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" run: | pip install cibuildwheel==2.3.1 From 699c0c1d9bb8d409198faf5c06f6900c202ab0b0 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Fri, 21 Jan 2022 23:46:29 +0100 Subject: [PATCH 21/63] move windows workflow to disk C (20) --- .github/workflows/build_windows_wheels.yml | 5 +++-- CMakeLists.txt | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 5843d27..62ff10a 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -20,8 +20,8 @@ jobs: strategy: matrix: arch: [ -# "x32", - "x64", + "x32", +# "x64", ] env: @@ -53,6 +53,7 @@ jobs: if: matrix.arch == 'x32' working-directory: "C:/src" env: + TARGET_ARCH: ia32 CIBW_BEFORE_BUILD: call vcvars32.bat CIBW_ARCHS: x86 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" diff --git a/CMakeLists.txt b/CMakeLists.txt index 0aa52ba..f0ce5ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -159,6 +159,12 @@ else() list(APPEND GN_GEN_ARGS rtc_build_tools=false ) + + if ("$ENV{TARGET_ARCH}" STREQUAL "ia32") + list(APPEND GN_GEN_ARGS + target_arch=ia32 + ) + endif() endif() if (WIN32) From a2d8f8fd409f1f59e52d2cdc55f6f2a0ff9ab813 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 00:56:33 +0100 Subject: [PATCH 22/63] move windows workflow to disk C (21) --- .github/workflows/build_windows_wheels.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 62ff10a..44e8550 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -20,8 +20,8 @@ jobs: strategy: matrix: arch: [ - "x32", -# "x64", +# "x32", + "x64", ] env: @@ -59,6 +59,7 @@ jobs: CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* + # because after each build there is some strange local changes and the next build can't check out CIBW_BEFORE_TEST: rmdir C:\src\third_party\depot_tools /s /q CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" run: | @@ -73,6 +74,7 @@ jobs: CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* + # because after each build there is some strange local changes and the next build can't check out CIBW_BEFORE_TEST: rmdir C:\src\third_party\depot_tools /s /q CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" run: | From 678ff74d5b114222b029ed0b4d4e10a58bd210f2 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 12:52:35 +0100 Subject: [PATCH 23/63] fix linux workflow --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0ce5ea..6743515 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,11 +21,17 @@ get_filename_component(src_loc "${project_loc}/src" REALPATH) # depot tools # ref about fix on M1 macs with git commits: https://bugs.chromium.org/p/chromium/issues/detail?id=1102967 +if (APPLE) + set(DEPOT_GIT_TAG cb340f5b7bbdcaba0fad346b08db91538619a531) +else() + set(DEPOT_GIT_TAG 2fddb95698211db1373ebe2b16091a54eac51c9c) +endif() + ExternalProject_Add( project_depot_tools GIT_REPOSITORY https://chromium.googlesource.com/chromium/tools/depot_tools.git - GIT_TAG cb340f5b7bbdcaba0fad346b08db91538619a531 + GIT_TAG ${DEPOT_GIT_TAG} PREFIX ${third_party_loc}/depot_tools/prefix TMP_DIR ${third_party_loc}/depot_tools/tmp From 73dad0eb1f6b18685b61360cdf244de8328c6406 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 12:57:21 +0100 Subject: [PATCH 24/63] fix linux workflow (2) --- .github/workflows/build_linux_wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 3756fb3..4a02cf2 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -25,6 +25,7 @@ jobs: uses: pypa/cibuildwheel@v2.3.1 env: # TODO install deps in docker + CIBW_BEFORE_ALL_LINUX: yum install -y python3 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* From b3875a9501879b72dfd3f8fa97a6ab3f49e04ca8 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 13:36:07 +0100 Subject: [PATCH 25/63] fix linux workflow (3) --- .github/workflows/build_linux_wheels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 4a02cf2..a70c661 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -25,7 +25,8 @@ jobs: uses: pypa/cibuildwheel@v2.3.1 env: # TODO install deps in docker - CIBW_BEFORE_ALL_LINUX: yum install -y python3 + #CIBW_BEFORE_ALL_LINUX: yum install -y python3 + CIBW_BEFORE_BUILD: alias python=/usr/bin/python2 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* From 0ee032a803fe2a20f8b478e74dba12162ca6caf4 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 13:42:18 +0100 Subject: [PATCH 26/63] fix linux workflow (4) --- .github/workflows/build_linux_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index a70c661..abb145e 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -26,7 +26,7 @@ jobs: env: # TODO install deps in docker #CIBW_BEFORE_ALL_LINUX: yum install -y python3 - CIBW_BEFORE_BUILD: alias python=/usr/bin/python2 + CIBW_BEFORE_BUILD: ll /usr/bin/python CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* From c768e8cd3929b1fe0487028b1af143de01e47b00 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 13:45:56 +0100 Subject: [PATCH 27/63] fix linux workflow (5) --- .github/workflows/build_linux_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index abb145e..8bdfd9a 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -26,7 +26,7 @@ jobs: env: # TODO install deps in docker #CIBW_BEFORE_ALL_LINUX: yum install -y python3 - CIBW_BEFORE_BUILD: ll /usr/bin/python + CIBW_BEFORE_BUILD: which python2 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* From 48c8c360286da4e38672cad7f77030159317863e Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 13:47:39 +0100 Subject: [PATCH 28/63] fix linux workflow (6) --- .github/workflows/build_linux_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 8bdfd9a..34b5825 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -26,7 +26,7 @@ jobs: env: # TODO install deps in docker #CIBW_BEFORE_ALL_LINUX: yum install -y python3 - CIBW_BEFORE_BUILD: which python2 + CIBW_BEFORE_BUILD: which python CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* From d91ee3797e425e8eb67ba0864bc413f6df4644ab Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 13:50:39 +0100 Subject: [PATCH 29/63] fix linux workflow (7) --- .github/workflows/build_linux_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 34b5825..27c7c0b 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -26,11 +26,11 @@ jobs: env: # TODO install deps in docker #CIBW_BEFORE_ALL_LINUX: yum install -y python3 - CIBW_BEFORE_BUILD: which python + CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* - CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" + CIBW_TEST_COMMAND: python3 -c "import wrtc; wrtc.ping()" - name: Upload artifacts. uses: actions/upload-artifact@v2 From eba03d316079581aaf3bfbce5c4346ba5fff6642 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 13:52:29 +0100 Subject: [PATCH 30/63] fix linux workflow (8) --- .github/workflows/build_linux_wheels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 27c7c0b..21d7dbb 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -26,10 +26,10 @@ jobs: env: # TODO install deps in docker #CIBW_BEFORE_ALL_LINUX: yum install -y python3 - CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python - CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" + #CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python + CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" CIBW_BUILD: cp3*-* - CIBW_SKIP: cp36-* + CIBW_SKIP: cp36-* cp37-* CIBW_TEST_COMMAND: python3 -c "import wrtc; wrtc.ping()" - name: Upload artifacts. From 5626d3602f245201642007d0407dab84e2660b8e Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 13:59:09 +0100 Subject: [PATCH 31/63] fix linux workflow (9) --- .github/workflows/build_linux_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 21d7dbb..ec6697d 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -26,7 +26,7 @@ jobs: env: # TODO install deps in docker #CIBW_BEFORE_ALL_LINUX: yum install -y python3 - #CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python + CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python && which python CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* cp37-* From 94bd65b1e2a0166ed099a26fc3c6367cd0e99e31 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 14:04:20 +0100 Subject: [PATCH 32/63] fix linux workflow (9) --- .github/workflows/build_linux_wheels.yml | 6 +++--- .github/workflows/build_macos_wheels.yml | 1 - .github/workflows/build_windows_wheels.yml | 1 - CMakeLists.txt | 3 ++- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index ec6697d..9553060 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -26,10 +26,10 @@ jobs: env: # TODO install deps in docker #CIBW_BEFORE_ALL_LINUX: yum install -y python3 - CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python && which python - CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" + #CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python && which python + CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* - CIBW_SKIP: cp36-* cp37-* + CIBW_SKIP: cp36-* CIBW_TEST_COMMAND: python3 -c "import wrtc; wrtc.ping()" - name: Upload artifacts. diff --git a/.github/workflows/build_macos_wheels.yml b/.github/workflows/build_macos_wheels.yml index a516a14..97767b0 100644 --- a/.github/workflows/build_macos_wheels.yml +++ b/.github/workflows/build_macos_wheels.yml @@ -4,7 +4,6 @@ on: branches: - main - pypi-dev - - ci-dev paths: - '.github/workflows/build_macos_wheels.yml' - 'python-webrtc/cpp/**' diff --git a/.github/workflows/build_windows_wheels.yml b/.github/workflows/build_windows_wheels.yml index 44e8550..728b7e0 100644 --- a/.github/workflows/build_windows_wheels.yml +++ b/.github/workflows/build_windows_wheels.yml @@ -4,7 +4,6 @@ on: branches: - main - pypi-dev - - ci-dev paths: - '.github/workflows/build_windows_wheels.yml' - 'python-webrtc/cpp/**' diff --git a/CMakeLists.txt b/CMakeLists.txt index 6743515..05a19f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,8 @@ get_filename_component(src_loc "${project_loc}/src" REALPATH) if (APPLE) set(DEPOT_GIT_TAG cb340f5b7bbdcaba0fad346b08db91538619a531) else() - set(DEPOT_GIT_TAG 2fddb95698211db1373ebe2b16091a54eac51c9c) +# set(DEPOT_GIT_TAG 2fddb95698211db1373ebe2b16091a54eac51c9c) + set(DEPOT_GIT_TAG 9b5dd7ab8a98140a1b73b9dea29245605137cd09) endif() ExternalProject_Add( From 6bab2720b95c0e1769a1964a01fdd219f31086ca Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 14:40:01 +0100 Subject: [PATCH 33/63] fix linux workflow (10) --- .github/workflows/build_linux_wheels.yml | 1 + CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 9553060..22ab47a 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -28,6 +28,7 @@ jobs: #CIBW_BEFORE_ALL_LINUX: yum install -y python3 #CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python && which python CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24 CIBW_BUILD: cp3*-* CIBW_SKIP: cp36-* CIBW_TEST_COMMAND: python3 -c "import wrtc; wrtc.ping()" diff --git a/CMakeLists.txt b/CMakeLists.txt index 05a19f0..91acd11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ if (APPLE) set(DEPOT_GIT_TAG cb340f5b7bbdcaba0fad346b08db91538619a531) else() # set(DEPOT_GIT_TAG 2fddb95698211db1373ebe2b16091a54eac51c9c) - set(DEPOT_GIT_TAG 9b5dd7ab8a98140a1b73b9dea29245605137cd09) + set(DEPOT_GIT_TAG 9b5dd7ab8a98140a1b73b9dea29245605137cd09) # glibc 2.18 endif() ExternalProject_Add( From bcd9744a2f1e51448a05e6dcd6761c2803c7a7ee Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 16:41:51 +0100 Subject: [PATCH 34/63] fix linux workflow (11) --- .github/workflows/build_linux_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 22ab47a..ead157f 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -25,7 +25,7 @@ jobs: uses: pypa/cibuildwheel@v2.3.1 env: # TODO install deps in docker - #CIBW_BEFORE_ALL_LINUX: yum install -y python3 + CIBW_BEFORE_ALL_LINUX: yum install -y xz #CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python && which python CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24 From ecc4a109b3dc04754f2fea5045dbd9d5aab6d7b3 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 16:44:39 +0100 Subject: [PATCH 35/63] fix linux workflow (12) --- .github/workflows/build_linux_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index ead157f..a4c6d49 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -25,7 +25,7 @@ jobs: uses: pypa/cibuildwheel@v2.3.1 env: # TODO install deps in docker - CIBW_BEFORE_ALL_LINUX: yum install -y xz + CIBW_BEFORE_ALL_LINUX: apt-get install -y xz #CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python && which python CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24 From 84830e6ea8211a4bb6fad86d1c0b8d27ace7afff Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 16:46:11 +0100 Subject: [PATCH 36/63] fix linux workflow (13) --- .github/workflows/build_linux_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index a4c6d49..d087be5 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -25,7 +25,7 @@ jobs: uses: pypa/cibuildwheel@v2.3.1 env: # TODO install deps in docker - CIBW_BEFORE_ALL_LINUX: apt-get install -y xz + CIBW_BEFORE_ALL_LINUX: apt-get update && apt-get install -y xz #CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python && which python CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24 From 5d4933662526626ff78e00ff52d87ed565b79c8f Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 16:46:41 +0100 Subject: [PATCH 37/63] fix linux workflow (14) --- .github/workflows/build_linux_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index d087be5..72a33de 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -25,7 +25,7 @@ jobs: uses: pypa/cibuildwheel@v2.3.1 env: # TODO install deps in docker - CIBW_BEFORE_ALL_LINUX: apt-get update && apt-get install -y xz + CIBW_BEFORE_ALL_LINUX: apt-get update && apt-get install -y xz-utils #CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python && which python CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24 From c387f6619684645260da2a8fb2e3a99fe4384e88 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 17:39:11 +0100 Subject: [PATCH 38/63] fix linux workflow (15) --- .github/workflows/build_linux_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 72a33de..995e204 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -25,7 +25,7 @@ jobs: uses: pypa/cibuildwheel@v2.3.1 env: # TODO install deps in docker - CIBW_BEFORE_ALL_LINUX: apt-get update && apt-get install -y xz-utils + CIBW_BEFORE_ALL_LINUX: apt-get update && apt-get install -y xz-utils libxml2 #CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python && which python CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24 From 7f42d38113de33b46b7fe21670612d4edc97c088 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 18:22:41 +0100 Subject: [PATCH 39/63] fix linux workflow (16) --- .github/workflows/build_linux_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 995e204..b431696 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -25,7 +25,7 @@ jobs: uses: pypa/cibuildwheel@v2.3.1 env: # TODO install deps in docker - CIBW_BEFORE_ALL_LINUX: apt-get update && apt-get install -y xz-utils libxml2 + CIBW_BEFORE_ALL_LINUX: apt-get update && apt-get install -y xz-utils libxml2 libcrypt-dev #CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python && which python CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24 From 8a25c7d81fd6d84f5b20ce1cfb68349f452c2d1d Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 18:31:22 +0100 Subject: [PATCH 40/63] fix linux workflow (17) --- .github/workflows/build_linux_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index b431696..f11dd62 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -25,7 +25,7 @@ jobs: uses: pypa/cibuildwheel@v2.3.1 env: # TODO install deps in docker - CIBW_BEFORE_ALL_LINUX: apt-get update && apt-get install -y xz-utils libxml2 libcrypt-dev + CIBW_BEFORE_ALL_LINUX: apt-get update && apt-get install -y xz-utils libxml2 python3-dev #CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python && which python CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24 From 49225e6000730476458eafc04b87c087f0714328 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 18:33:45 +0100 Subject: [PATCH 41/63] fix linux workflow (18) --- .github/workflows/build_linux_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index f11dd62..4a79f25 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -25,7 +25,7 @@ jobs: uses: pypa/cibuildwheel@v2.3.1 env: # TODO install deps in docker - CIBW_BEFORE_ALL_LINUX: apt-get update && apt-get install -y xz-utils libxml2 python3-dev + CIBW_BEFORE_ALL_LINUX: apt-get update && apt-get install -y xz-utils libxml2 python3-dev libxcrypt1 #CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python && which python CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24 From 2f11bd8942b64441a00c5a8bab32922028aedc31 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 19:51:00 +0100 Subject: [PATCH 42/63] fix linux workflow (19) --- .github/workflows/build_linux_wheels.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 4a79f25..6ca4c2e 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -29,8 +29,9 @@ jobs: #CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python && which python CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24 - CIBW_BUILD: cp3*-* - CIBW_SKIP: cp36-* + CIBW_BUILD: cp310-* +# CIBW_BUILD: cp3*-* +# CIBW_SKIP: cp36-* CIBW_TEST_COMMAND: python3 -c "import wrtc; wrtc.ping()" - name: Upload artifacts. From 335c9dbf51b515936bef3b88a5d882fdaba21f20 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Sat, 22 Jan 2022 20:46:30 +0100 Subject: [PATCH 43/63] downgrade to cpp 14; fix linux workflow (20). --- python-webrtc/cpp/CMakeLists.txt | 2 +- .../cpp/src/interfaces/media_stream.cpp | 6 ++- .../cpp/src/interfaces/media_stream.h | 3 +- .../src/interfaces/rtc_peer_connection.cpp | 52 +++++++++---------- .../cpp/src/interfaces/rtc_peer_connection.h | 2 +- .../cpp/src/interfaces/rtc_rtp_sender.cpp | 6 ++- .../cpp/src/interfaces/rtc_rtp_sender.h | 3 +- .../python_webrtc/rtc_on_data_event.cpp | 3 +- 8 files changed, 42 insertions(+), 35 deletions(-) diff --git a/python-webrtc/cpp/CMakeLists.txt b/python-webrtc/cpp/CMakeLists.txt index d9c17a3..314036c 100644 --- a/python-webrtc/cpp/CMakeLists.txt +++ b/python-webrtc/cpp/CMakeLists.txt @@ -4,7 +4,7 @@ file(GLOB_RECURSE MODULE_SRC ${src_loc}/*.cpp ${src_loc}/*.h) pybind11_add_module(${MODULE} ${MODULE_SRC}) -set_property(TARGET ${MODULE} PROPERTY CXX_STANDARD 17) +set_property(TARGET ${MODULE} PROPERTY CXX_STANDARD 14) target_include_directories(${MODULE} SYSTEM PRIVATE ${libwebrtc_source_dir} diff --git a/python-webrtc/cpp/src/interfaces/media_stream.cpp b/python-webrtc/cpp/src/interfaces/media_stream.cpp index cc4a8bc..fb518a4 100644 --- a/python-webrtc/cpp/src/interfaces/media_stream.cpp +++ b/python-webrtc/cpp/src/interfaces/media_stream.cpp @@ -140,7 +140,8 @@ namespace python_webrtc { return tracks; } - std::optional MediaStream::GetTrackById(const std::string &label) { +// std::optional MediaStream::GetTrackById(const std::string &label) { + MediaStreamTrack MediaStream::GetTrackById(const std::string &label) { auto audioTrack = _impl._stream->FindAudioTrack(label); if (audioTrack) { return MediaStreamTrack(_impl._factory, audioTrack); @@ -151,7 +152,8 @@ namespace python_webrtc { return MediaStreamTrack(_impl._factory, videoTrack); } - return {}; +// return {}; + return MediaStreamTrack(_impl._factory, videoTrack); } void MediaStream::AddTrack(MediaStreamTrack *mediaStreamTrack) { diff --git a/python-webrtc/cpp/src/interfaces/media_stream.h b/python-webrtc/cpp/src/interfaces/media_stream.h index 7cc7e8f..daf19cb 100644 --- a/python-webrtc/cpp/src/interfaces/media_stream.h +++ b/python-webrtc/cpp/src/interfaces/media_stream.h @@ -49,7 +49,8 @@ namespace python_webrtc { std::vector GetTracks(); - std::optional GetTrackById(const std::string &); + MediaStreamTrack GetTrackById(const std::string &); +// std::optional GetTrackById(const std::string &); void AddTrack(MediaStreamTrack *); diff --git a/python-webrtc/cpp/src/interfaces/rtc_peer_connection.cpp b/python-webrtc/cpp/src/interfaces/rtc_peer_connection.cpp index ced16df..d23a193 100644 --- a/python-webrtc/cpp/src/interfaces/rtc_peer_connection.cpp +++ b/python-webrtc/cpp/src/interfaces/rtc_peer_connection.cpp @@ -63,9 +63,9 @@ namespace python_webrtc { .def("createAnswer", &RTCPeerConnection::CreateAnswer) .def("setLocalDescription", &RTCPeerConnection::SetLocalDescription) .def("setRemoteDescription", &RTCPeerConnection::SetRemoteDescription) - .def("addTrack", - pybind11::overload_cast>>( - &RTCPeerConnection::AddTrack)) +// .def("addTrack", +// pybind11::overload_cast>>( +// &RTCPeerConnection::AddTrack)) .def("addTrack", pybind11::overload_cast &>( &RTCPeerConnection::AddTrack)) @@ -171,29 +171,29 @@ namespace python_webrtc { return std::make_unique(_factory, rtpSender); } - std::unique_ptr RTCPeerConnection::AddTrack( - MediaStreamTrack &mediaStreamTrack, std::optional> mediaStream) { - if (!_jinglePeerConnection) { - // TODO raise - // "Cannot addTrack; RTCPeerConnection is closed" - return {}; - } - - std::vector streamIds; - if (mediaStream != std::nullopt) { - streamIds.emplace_back(mediaStream->get().stream()->id()); - } - - auto result = _jinglePeerConnection->AddTrack(mediaStreamTrack.track(), streamIds); - if (!result.ok()) { - // TODO raise - // result.error() // RTCError - return {}; - } - - auto rtpSender = result.value(); - return std::make_unique(_factory, rtpSender); - } +// std::unique_ptr RTCPeerConnection::AddTrack( +// MediaStreamTrack &mediaStreamTrack, std::optional> mediaStream) { +// if (!_jinglePeerConnection) { +// // TODO raise +// // "Cannot addTrack; RTCPeerConnection is closed" +// return {}; +// } +// +// std::vector streamIds; +// if (mediaStream != std::nullopt) { +// streamIds.emplace_back(mediaStream->get().stream()->id()); +// } +// +// auto result = _jinglePeerConnection->AddTrack(mediaStreamTrack.track(), streamIds); +// if (!result.ok()) { +// // TODO raise +// // result.error() // RTCError +// return {}; +// } +// +// auto rtpSender = result.value(); +// return std::make_unique(_factory, rtpSender); +// } void RTCPeerConnection::Close() { if (_jinglePeerConnection) { diff --git a/python-webrtc/cpp/src/interfaces/rtc_peer_connection.h b/python-webrtc/cpp/src/interfaces/rtc_peer_connection.h index d6d21f4..3f4bd27 100644 --- a/python-webrtc/cpp/src/interfaces/rtc_peer_connection.h +++ b/python-webrtc/cpp/src/interfaces/rtc_peer_connection.h @@ -38,7 +38,7 @@ namespace python_webrtc { void SetRemoteDescription(std::function &, RTCSessionDescription &); - std::unique_ptr AddTrack(MediaStreamTrack &, std::optional>); +// std::unique_ptr AddTrack(MediaStreamTrack &, std::optional>); std::unique_ptr AddTrack(MediaStreamTrack &, const std::vector&); static void Init(pybind11::module &m); diff --git a/python-webrtc/cpp/src/interfaces/rtc_rtp_sender.cpp b/python-webrtc/cpp/src/interfaces/rtc_rtp_sender.cpp index 08938ba..5052233 100644 --- a/python-webrtc/cpp/src/interfaces/rtc_rtp_sender.cpp +++ b/python-webrtc/cpp/src/interfaces/rtc_rtp_sender.cpp @@ -18,13 +18,15 @@ namespace python_webrtc { .def_property_readonly("track", &RTCRtpSender::GetTrack); } - std::optional RTCRtpSender::GetTrack() { +// std::optional RTCRtpSender::GetTrack() { + MediaStreamTrack RTCRtpSender::GetTrack() { auto track = _sender->track(); if (track) { return MediaStreamTrack(_factory, track); } - return {}; +// return {}; + return MediaStreamTrack(_factory, track); } } diff --git a/python-webrtc/cpp/src/interfaces/rtc_rtp_sender.h b/python-webrtc/cpp/src/interfaces/rtc_rtp_sender.h index 05ca46f..d444ab3 100644 --- a/python-webrtc/cpp/src/interfaces/rtc_rtp_sender.h +++ b/python-webrtc/cpp/src/interfaces/rtc_rtp_sender.h @@ -23,7 +23,8 @@ namespace python_webrtc { static void Init(pybind11::module &m); - std::optional GetTrack(); +// std::optional GetTrack(); + MediaStreamTrack GetTrack(); // TODO // void GetTransport(); diff --git a/python-webrtc/cpp/src/models/python_webrtc/rtc_on_data_event.cpp b/python-webrtc/cpp/src/models/python_webrtc/rtc_on_data_event.cpp index 2c94f0b..983482e 100644 --- a/python-webrtc/cpp/src/models/python_webrtc/rtc_on_data_event.cpp +++ b/python-webrtc/cpp/src/models/python_webrtc/rtc_on_data_event.cpp @@ -7,7 +7,8 @@ namespace python_webrtc { RTCOnDataEvent::RTCOnDataEvent(std::string &data, uint16_t length) { - audioData = reinterpret_cast(data.data()); +// audioData = reinterpret_cast(data.data()); + audioData = (uint8_t*) data.data(); numberOfFrames = length; } From 0ba0866a9eb9e17b047934167b27b4b70dd5843e Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Mon, 24 Jan 2022 14:14:44 +0100 Subject: [PATCH 44/63] Revert "downgrade to cpp 14;" This reverts commit 335c9dbf51b515936bef3b88a5d882fdaba21f20. --- python-webrtc/cpp/CMakeLists.txt | 2 +- .../cpp/src/interfaces/media_stream.cpp | 6 +-- .../cpp/src/interfaces/media_stream.h | 3 +- .../src/interfaces/rtc_peer_connection.cpp | 52 +++++++++---------- .../cpp/src/interfaces/rtc_peer_connection.h | 2 +- .../cpp/src/interfaces/rtc_rtp_sender.cpp | 6 +-- .../cpp/src/interfaces/rtc_rtp_sender.h | 3 +- .../python_webrtc/rtc_on_data_event.cpp | 3 +- 8 files changed, 35 insertions(+), 42 deletions(-) diff --git a/python-webrtc/cpp/CMakeLists.txt b/python-webrtc/cpp/CMakeLists.txt index 314036c..d9c17a3 100644 --- a/python-webrtc/cpp/CMakeLists.txt +++ b/python-webrtc/cpp/CMakeLists.txt @@ -4,7 +4,7 @@ file(GLOB_RECURSE MODULE_SRC ${src_loc}/*.cpp ${src_loc}/*.h) pybind11_add_module(${MODULE} ${MODULE_SRC}) -set_property(TARGET ${MODULE} PROPERTY CXX_STANDARD 14) +set_property(TARGET ${MODULE} PROPERTY CXX_STANDARD 17) target_include_directories(${MODULE} SYSTEM PRIVATE ${libwebrtc_source_dir} diff --git a/python-webrtc/cpp/src/interfaces/media_stream.cpp b/python-webrtc/cpp/src/interfaces/media_stream.cpp index fb518a4..cc4a8bc 100644 --- a/python-webrtc/cpp/src/interfaces/media_stream.cpp +++ b/python-webrtc/cpp/src/interfaces/media_stream.cpp @@ -140,8 +140,7 @@ namespace python_webrtc { return tracks; } -// std::optional MediaStream::GetTrackById(const std::string &label) { - MediaStreamTrack MediaStream::GetTrackById(const std::string &label) { + std::optional MediaStream::GetTrackById(const std::string &label) { auto audioTrack = _impl._stream->FindAudioTrack(label); if (audioTrack) { return MediaStreamTrack(_impl._factory, audioTrack); @@ -152,8 +151,7 @@ namespace python_webrtc { return MediaStreamTrack(_impl._factory, videoTrack); } -// return {}; - return MediaStreamTrack(_impl._factory, videoTrack); + return {}; } void MediaStream::AddTrack(MediaStreamTrack *mediaStreamTrack) { diff --git a/python-webrtc/cpp/src/interfaces/media_stream.h b/python-webrtc/cpp/src/interfaces/media_stream.h index daf19cb..7cc7e8f 100644 --- a/python-webrtc/cpp/src/interfaces/media_stream.h +++ b/python-webrtc/cpp/src/interfaces/media_stream.h @@ -49,8 +49,7 @@ namespace python_webrtc { std::vector GetTracks(); - MediaStreamTrack GetTrackById(const std::string &); -// std::optional GetTrackById(const std::string &); + std::optional GetTrackById(const std::string &); void AddTrack(MediaStreamTrack *); diff --git a/python-webrtc/cpp/src/interfaces/rtc_peer_connection.cpp b/python-webrtc/cpp/src/interfaces/rtc_peer_connection.cpp index d23a193..ced16df 100644 --- a/python-webrtc/cpp/src/interfaces/rtc_peer_connection.cpp +++ b/python-webrtc/cpp/src/interfaces/rtc_peer_connection.cpp @@ -63,9 +63,9 @@ namespace python_webrtc { .def("createAnswer", &RTCPeerConnection::CreateAnswer) .def("setLocalDescription", &RTCPeerConnection::SetLocalDescription) .def("setRemoteDescription", &RTCPeerConnection::SetRemoteDescription) -// .def("addTrack", -// pybind11::overload_cast>>( -// &RTCPeerConnection::AddTrack)) + .def("addTrack", + pybind11::overload_cast>>( + &RTCPeerConnection::AddTrack)) .def("addTrack", pybind11::overload_cast &>( &RTCPeerConnection::AddTrack)) @@ -171,29 +171,29 @@ namespace python_webrtc { return std::make_unique(_factory, rtpSender); } -// std::unique_ptr RTCPeerConnection::AddTrack( -// MediaStreamTrack &mediaStreamTrack, std::optional> mediaStream) { -// if (!_jinglePeerConnection) { -// // TODO raise -// // "Cannot addTrack; RTCPeerConnection is closed" -// return {}; -// } -// -// std::vector streamIds; -// if (mediaStream != std::nullopt) { -// streamIds.emplace_back(mediaStream->get().stream()->id()); -// } -// -// auto result = _jinglePeerConnection->AddTrack(mediaStreamTrack.track(), streamIds); -// if (!result.ok()) { -// // TODO raise -// // result.error() // RTCError -// return {}; -// } -// -// auto rtpSender = result.value(); -// return std::make_unique(_factory, rtpSender); -// } + std::unique_ptr RTCPeerConnection::AddTrack( + MediaStreamTrack &mediaStreamTrack, std::optional> mediaStream) { + if (!_jinglePeerConnection) { + // TODO raise + // "Cannot addTrack; RTCPeerConnection is closed" + return {}; + } + + std::vector streamIds; + if (mediaStream != std::nullopt) { + streamIds.emplace_back(mediaStream->get().stream()->id()); + } + + auto result = _jinglePeerConnection->AddTrack(mediaStreamTrack.track(), streamIds); + if (!result.ok()) { + // TODO raise + // result.error() // RTCError + return {}; + } + + auto rtpSender = result.value(); + return std::make_unique(_factory, rtpSender); + } void RTCPeerConnection::Close() { if (_jinglePeerConnection) { diff --git a/python-webrtc/cpp/src/interfaces/rtc_peer_connection.h b/python-webrtc/cpp/src/interfaces/rtc_peer_connection.h index 3f4bd27..d6d21f4 100644 --- a/python-webrtc/cpp/src/interfaces/rtc_peer_connection.h +++ b/python-webrtc/cpp/src/interfaces/rtc_peer_connection.h @@ -38,7 +38,7 @@ namespace python_webrtc { void SetRemoteDescription(std::function &, RTCSessionDescription &); -// std::unique_ptr AddTrack(MediaStreamTrack &, std::optional>); + std::unique_ptr AddTrack(MediaStreamTrack &, std::optional>); std::unique_ptr AddTrack(MediaStreamTrack &, const std::vector&); static void Init(pybind11::module &m); diff --git a/python-webrtc/cpp/src/interfaces/rtc_rtp_sender.cpp b/python-webrtc/cpp/src/interfaces/rtc_rtp_sender.cpp index 5052233..08938ba 100644 --- a/python-webrtc/cpp/src/interfaces/rtc_rtp_sender.cpp +++ b/python-webrtc/cpp/src/interfaces/rtc_rtp_sender.cpp @@ -18,15 +18,13 @@ namespace python_webrtc { .def_property_readonly("track", &RTCRtpSender::GetTrack); } -// std::optional RTCRtpSender::GetTrack() { - MediaStreamTrack RTCRtpSender::GetTrack() { + std::optional RTCRtpSender::GetTrack() { auto track = _sender->track(); if (track) { return MediaStreamTrack(_factory, track); } -// return {}; - return MediaStreamTrack(_factory, track); + return {}; } } diff --git a/python-webrtc/cpp/src/interfaces/rtc_rtp_sender.h b/python-webrtc/cpp/src/interfaces/rtc_rtp_sender.h index d444ab3..05ca46f 100644 --- a/python-webrtc/cpp/src/interfaces/rtc_rtp_sender.h +++ b/python-webrtc/cpp/src/interfaces/rtc_rtp_sender.h @@ -23,8 +23,7 @@ namespace python_webrtc { static void Init(pybind11::module &m); -// std::optional GetTrack(); - MediaStreamTrack GetTrack(); + std::optional GetTrack(); // TODO // void GetTransport(); diff --git a/python-webrtc/cpp/src/models/python_webrtc/rtc_on_data_event.cpp b/python-webrtc/cpp/src/models/python_webrtc/rtc_on_data_event.cpp index 983482e..2c94f0b 100644 --- a/python-webrtc/cpp/src/models/python_webrtc/rtc_on_data_event.cpp +++ b/python-webrtc/cpp/src/models/python_webrtc/rtc_on_data_event.cpp @@ -7,8 +7,7 @@ namespace python_webrtc { RTCOnDataEvent::RTCOnDataEvent(std::string &data, uint16_t length) { -// audioData = reinterpret_cast(data.data()); - audioData = (uint8_t*) data.data(); + audioData = reinterpret_cast(data.data()); numberOfFrames = length; } From 35e94d7d05668c9f73250b7f2d60c717d19fe3be Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Mon, 24 Jan 2022 14:51:18 +0100 Subject: [PATCH 45/63] add workflow with building and uploading manylinux images with new GCC; fix building on linux. --- .github/workflows/build_manylinux.yml | 51 +++++++++++++++++++++++++++ CMakeLists.txt | 5 ++- build/Dockerfile | 13 +++++++ 3 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build_manylinux.yml create mode 100644 build/Dockerfile diff --git a/.github/workflows/build_manylinux.yml b/.github/workflows/build_manylinux.yml new file mode 100644 index 0000000..a7cf880 --- /dev/null +++ b/.github/workflows/build_manylinux.yml @@ -0,0 +1,51 @@ +name: Build and publish manylinux with updated GCC +on: + push: + branches: + - main + - pypi-dev + - ci-dev + paths: + - '.github/workflows/build_manylinux.yml' + - 'build/Dockerfile' +jobs: + build_manylinux: + name: Build and publish manylinux images + runs-on: ubuntu-latest + + strategy: + matrix: + arch: [ + "x86_64", + "aarch64", + ] + + steps: + - name: Clone. + uses: actions/checkout@v2 + + - name: Set up QEMU. + if: matrix.arch == 'aarch64' + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx. + uses: docker/setup-buildx-action@v1 + + - name: Login to GitHub Container Registry. + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.CR_PAT }} + + - name: Prepare registry name. + run: echo IMAGE_REPOSITORY=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV + + - name: manylinux_2_24_${{ matrix.arch }}. + uses: docker/build-push-action@v2 + with: + context: . + file: build/Dockerfile + push: true + build-args: MANYLINUX_ARCH=${{ matrix.arch }} + tags: ghcr.io/${{ env.IMAGE_REPOSITORY }}/wrtc/manylinux_2_24_${{ matrix.arch }}:latest diff --git a/CMakeLists.txt b/CMakeLists.txt index 91acd11..16f637f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,8 +24,7 @@ get_filename_component(src_loc "${project_loc}/src" REALPATH) if (APPLE) set(DEPOT_GIT_TAG cb340f5b7bbdcaba0fad346b08db91538619a531) else() -# set(DEPOT_GIT_TAG 2fddb95698211db1373ebe2b16091a54eac51c9c) - set(DEPOT_GIT_TAG 9b5dd7ab8a98140a1b73b9dea29245605137cd09) # glibc 2.18 + set(DEPOT_GIT_TAG 9b5dd7ab8a98140a1b73b9dea29245605137cd09) # glibc 2.18, supports python 3 < 3.8 endif() ExternalProject_Add( @@ -101,7 +100,6 @@ list(TRANSFORM libc++_objects PREPEND ${libwebrtc_binary_dir}/obj/buildtools/thi set_property(TARGET libc++ APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) set_target_properties(libc++ PROPERTIES IMPORTED_OBJECTS_DEBUG "${libc++_objects}" IMPORTED_OBJECTS "${libc++_objects}") - # libc++abi add_library(libc++abi OBJECT IMPORTED) add_dependencies(libc++abi libwebrtc) @@ -164,6 +162,7 @@ elseif ("$ENV{TARGET_ARCH}" STREQUAL "arm64") ) else() list(APPEND GN_GEN_ARGS + use_glib=false rtc_build_tools=false ) diff --git a/build/Dockerfile b/build/Dockerfile new file mode 100644 index 0000000..0271533 --- /dev/null +++ b/build/Dockerfile @@ -0,0 +1,13 @@ +ARG MANYLINUX_ARCH +FROM quay.io/pypa/manylinux_2_24_$MANYLINUX_ARCH AS builder + +RUN apt-get update && apt-get install -y xz-utils libxml2 wget build-essential + +WORKDIR /opt +RUN wget http://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-7.5.0/gcc-7.5.0.tar.gz && \ + tar zxf gcc-7.5.0.tar.gz +WORKDIR gcc-7.5.0 +RUN ./contrib/download_prerequisites && \ + ./configure --disable-multilib && \ + make -j $(nproc) && \ + make install From 172afb3469fe15a6efe068fa84cc3c482311dd03 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Mon, 24 Jan 2022 16:12:17 +0100 Subject: [PATCH 46/63] use another manylinux build; use another gcc. --- .github/workflows/build_linux_wheels.yml | 7 ++----- setup.py | 3 +++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 6ca4c2e..4b4c0f3 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -24,15 +24,12 @@ jobs: - name: Build wheels. uses: pypa/cibuildwheel@v2.3.1 env: - # TODO install deps in docker - CIBW_BEFORE_ALL_LINUX: apt-get update && apt-get install -y xz-utils libxml2 python3-dev libxcrypt1 - #CIBW_BEFORE_BUILD: rm -f /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python && which python CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" - CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24 + CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/marshalx/wrtc/manylinux_2_24_x86_64:latest CIBW_BUILD: cp310-* # CIBW_BUILD: cp3*-* # CIBW_SKIP: cp36-* - CIBW_TEST_COMMAND: python3 -c "import wrtc; wrtc.ping()" + CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" - name: Upload artifacts. uses: actions/upload-artifact@v2 diff --git a/setup.py b/setup.py index 9e24ddd..c462182 100644 --- a/setup.py +++ b/setup.py @@ -48,6 +48,9 @@ def build_extension(self, ext): f'-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}', f'-DPYTHON_EXECUTABLE={sys.executable}', f'-DCMAKE_BUILD_TYPE={cfg}', # not used on MSVC, but no harm + # TODO should be optional + passed from args + '-DCMAKE_C_COMPILER=/usr/local/bin/gcc', + '-DCMAKE_CXX_COMPILER=/usr/local/bin/g++', ] build_args = [] # Adding CMake arguments set as environment variable From e98e8ceafaef5a19423f7b1d143653a6a7c43a1d Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Mon, 24 Jan 2022 20:20:25 +0100 Subject: [PATCH 47/63] fix linux build --- .github/workflows/build_linux_wheels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 4b4c0f3..b0dfd9e 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -24,6 +24,7 @@ jobs: - name: Build wheels. uses: pypa/cibuildwheel@v2.3.1 env: + CIBW_ARCHS: x86_64 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/marshalx/wrtc/manylinux_2_24_x86_64:latest CIBW_BUILD: cp310-* @@ -34,5 +35,5 @@ jobs: - name: Upload artifacts. uses: actions/upload-artifact@v2 with: - name: "wrtc for Linux (Intel)" + name: "wrtc for Linux (x86_64)" path: ./wheelhouse/*.whl From 8ee2602cc8109c9bdbec288969200fce95342dbf Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Mon, 24 Jan 2022 20:20:54 +0100 Subject: [PATCH 48/63] linux build all --- .github/workflows/build_linux_wheels.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index b0dfd9e..cb2a2e5 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -27,9 +27,8 @@ jobs: CIBW_ARCHS: x86_64 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/marshalx/wrtc/manylinux_2_24_x86_64:latest - CIBW_BUILD: cp310-* -# CIBW_BUILD: cp3*-* -# CIBW_SKIP: cp36-* + CIBW_BUILD: cp3*-* + CIBW_SKIP: cp36-* CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" - name: Upload artifacts. From 6c6cbefc333697be96e56f2a26832ca93598288f Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Mon, 24 Jan 2022 20:26:34 +0100 Subject: [PATCH 49/63] try to build m1 wheels --- .github/workflows/build_macos_arm_wheels.yml | 46 ++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/build_macos_arm_wheels.yml diff --git a/.github/workflows/build_macos_arm_wheels.yml b/.github/workflows/build_macos_arm_wheels.yml new file mode 100644 index 0000000..49b2856 --- /dev/null +++ b/.github/workflows/build_macos_arm_wheels.yml @@ -0,0 +1,46 @@ +name: Build and publish macOS wheels +on: + push: + branches: + - main + - pypi-dev + - ci-dev + paths: + - '.github/workflows/build_macos_wheels.yml' + - 'python-webrtc/cpp/**' + - 'CMakeLists.txt' + - 'setup.py' +jobs: + build_wheels_for_macos: + name: Build and publish wheels for macOS + runs-on: macos-latest + + env: + WEBRTC_CACHE_KEY: "1" + + steps: + - name: Clone. + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: WebRTC cache. + uses: actions/cache@v2 + with: + path: third_party/libwebrtc + key: ${{ runner.os }}-arm-cache-webrtc-${{ env.WEBRTC_CACHE_KEY }} + + - name: Build wheels. + uses: pypa/cibuildwheel@v2.3.1 + env: + CIBW_ARCHS: arm64 + CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" + CIBW_BUILD: cp3*-* + CIBW_SKIP: cp36-* + CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" + + - name: Upload artifacts. + uses: actions/upload-artifact@v2 + with: + name: "wrtc for macOS (M1)" + path: ./wheelhouse/*.whl From dfe2945387247dc784c286eb3c0e9aa7b5094851 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Mon, 24 Jan 2022 20:27:26 +0100 Subject: [PATCH 50/63] trigger --- .github/workflows/build_macos_arm_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_macos_arm_wheels.yml b/.github/workflows/build_macos_arm_wheels.yml index 49b2856..c58f91b 100644 --- a/.github/workflows/build_macos_arm_wheels.yml +++ b/.github/workflows/build_macos_arm_wheels.yml @@ -6,7 +6,7 @@ on: - pypi-dev - ci-dev paths: - - '.github/workflows/build_macos_wheels.yml' + - '.github/workflows/build_macos_arm_wheels.yml' - 'python-webrtc/cpp/**' - 'CMakeLists.txt' - 'setup.py' From f5921788ff6a6a075ee0c4a51ef52cab2b38e743 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Mon, 24 Jan 2022 20:34:51 +0100 Subject: [PATCH 51/63] trigger 2 --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index c462182..f0ea10e 100644 --- a/setup.py +++ b/setup.py @@ -49,8 +49,8 @@ def build_extension(self, ext): f'-DPYTHON_EXECUTABLE={sys.executable}', f'-DCMAKE_BUILD_TYPE={cfg}', # not used on MSVC, but no harm # TODO should be optional + passed from args - '-DCMAKE_C_COMPILER=/usr/local/bin/gcc', - '-DCMAKE_CXX_COMPILER=/usr/local/bin/g++', + # '-DCMAKE_C_COMPILER=/usr/local/bin/gcc', + # '-DCMAKE_CXX_COMPILER=/usr/local/bin/g++', ] build_args = [] # Adding CMake arguments set as environment variable From 2c02e6990a20ecc472f8df9d9507dfdecc9f66e6 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Mon, 24 Jan 2022 20:36:29 +0100 Subject: [PATCH 52/63] fix env vars --- .github/workflows/build_macos_arm_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_macos_arm_wheels.yml b/.github/workflows/build_macos_arm_wheels.yml index c58f91b..61d682e 100644 --- a/.github/workflows/build_macos_arm_wheels.yml +++ b/.github/workflows/build_macos_arm_wheels.yml @@ -33,10 +33,10 @@ jobs: - name: Build wheels. uses: pypa/cibuildwheel@v2.3.1 env: + TARGET_ARCH: arm64 CIBW_ARCHS: arm64 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_BUILD: cp3*-* - CIBW_SKIP: cp36-* CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" - name: Upload artifacts. From 06c92bacddcd5141c3fb444d05bfd2eac8edb299 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Mon, 24 Jan 2022 21:51:26 +0100 Subject: [PATCH 53/63] fix linux build --- .github/workflows/build_linux_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index cb2a2e5..33657bf 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -27,7 +27,7 @@ jobs: CIBW_ARCHS: x86_64 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/marshalx/wrtc/manylinux_2_24_x86_64:latest - CIBW_BUILD: cp3*-* + CIBW_BUILD: cp3*-manylinux_* CIBW_SKIP: cp36-* CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" From 20d472d33c189a14e7cb0fa4777a0bc73fe416b0 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Mon, 24 Jan 2022 22:03:58 +0100 Subject: [PATCH 54/63] fix manylinux build --- .github/workflows/build_manylinux.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_manylinux.yml b/.github/workflows/build_manylinux.yml index a7cf880..6ff9bc8 100644 --- a/.github/workflows/build_manylinux.yml +++ b/.github/workflows/build_manylinux.yml @@ -11,6 +11,7 @@ on: jobs: build_manylinux: name: Build and publish manylinux images + timeout-minutes: 1024 runs-on: ubuntu-latest strategy: @@ -43,6 +44,7 @@ jobs: - name: manylinux_2_24_${{ matrix.arch }}. uses: docker/build-push-action@v2 + timeout-minutes: 1024 with: context: . file: build/Dockerfile From 132866fae4a1e2f4601c958f14502b36124448a6 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Mon, 24 Jan 2022 22:09:04 +0100 Subject: [PATCH 55/63] m1 and intel wheels in 1 workflow --- .github/workflows/build_macos_arm_wheels.yml | 46 -------------------- .github/workflows/build_macos_wheels.yml | 26 +++++++++-- 2 files changed, 22 insertions(+), 50 deletions(-) delete mode 100644 .github/workflows/build_macos_arm_wheels.yml diff --git a/.github/workflows/build_macos_arm_wheels.yml b/.github/workflows/build_macos_arm_wheels.yml deleted file mode 100644 index 61d682e..0000000 --- a/.github/workflows/build_macos_arm_wheels.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Build and publish macOS wheels -on: - push: - branches: - - main - - pypi-dev - - ci-dev - paths: - - '.github/workflows/build_macos_arm_wheels.yml' - - 'python-webrtc/cpp/**' - - 'CMakeLists.txt' - - 'setup.py' -jobs: - build_wheels_for_macos: - name: Build and publish wheels for macOS - runs-on: macos-latest - - env: - WEBRTC_CACHE_KEY: "1" - - steps: - - name: Clone. - uses: actions/checkout@v2 - with: - submodules: recursive - - - name: WebRTC cache. - uses: actions/cache@v2 - with: - path: third_party/libwebrtc - key: ${{ runner.os }}-arm-cache-webrtc-${{ env.WEBRTC_CACHE_KEY }} - - - name: Build wheels. - uses: pypa/cibuildwheel@v2.3.1 - env: - TARGET_ARCH: arm64 - CIBW_ARCHS: arm64 - CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" - CIBW_BUILD: cp3*-* - CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" - - - name: Upload artifacts. - uses: actions/upload-artifact@v2 - with: - name: "wrtc for macOS (M1)" - path: ./wheelhouse/*.whl diff --git a/.github/workflows/build_macos_wheels.yml b/.github/workflows/build_macos_wheels.yml index 97767b0..a1c9170 100644 --- a/.github/workflows/build_macos_wheels.yml +++ b/.github/workflows/build_macos_wheels.yml @@ -4,6 +4,7 @@ on: branches: - main - pypi-dev + - ci-dev paths: - '.github/workflows/build_macos_wheels.yml' - 'python-webrtc/cpp/**' @@ -14,6 +15,13 @@ jobs: name: Build and publish wheels for macOS runs-on: macos-latest + strategy: + matrix: + arch: [ + "Intel", + "M1", + ] + env: WEBRTC_CACHE_KEY: "1" @@ -27,9 +35,10 @@ jobs: uses: actions/cache@v2 with: path: third_party/libwebrtc - key: ${{ runner.os }}-cache-webrtc-${{ env.WEBRTC_CACHE_KEY }} + key: ${{ runner.os }}-${{ matrix.arch }}-cache-webrtc-${{ env.WEBRTC_CACHE_KEY }} - - name: Build wheels. + - name: Build wheels (Intel). + if: matrix.arch == 'Intel' uses: pypa/cibuildwheel@v2.3.1 env: CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" @@ -37,8 +46,17 @@ jobs: CIBW_SKIP: cp36-* CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" - - name: Upload artifacts. + - name: Build wheels (M1). + if: matrix.arch == 'M1' + uses: pypa/cibuildwheel@v2.3.1 + env: + TARGET_ARCH: arm64 + CIBW_ARCHS: arm64 + CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" + CIBW_BUILD: cp3*-* + + - name: Upload artifacts (${{ matrix.arch }}). uses: actions/upload-artifact@v2 with: - name: "wrtc for macOS (Intel)" + name: wrtc for macOS (${{ matrix.arch }}) path: ./wheelhouse/*.whl From c7d340e594d068855786368c0e660cd86a2f80a8 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Mon, 24 Jan 2022 22:16:28 +0100 Subject: [PATCH 56/63] fix linux wheels --- .github/workflows/build_linux_wheels.yml | 2 ++ setup.py | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 33657bf..59d8b44 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -24,8 +24,10 @@ jobs: - name: Build wheels. uses: pypa/cibuildwheel@v2.3.1 env: + MANYLINUX_INSIDE: true CIBW_ARCHS: x86_64 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" + # extended manylinux image with updated GCC (7.5) CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/marshalx/wrtc/manylinux_2_24_x86_64:latest CIBW_BUILD: cp3*-manylinux_* CIBW_SKIP: cp36-* diff --git a/setup.py b/setup.py index f0ea10e..3ac7b8b 100644 --- a/setup.py +++ b/setup.py @@ -48,10 +48,16 @@ def build_extension(self, ext): f'-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}', f'-DPYTHON_EXECUTABLE={sys.executable}', f'-DCMAKE_BUILD_TYPE={cfg}', # not used on MSVC, but no harm - # TODO should be optional + passed from args - # '-DCMAKE_C_COMPILER=/usr/local/bin/gcc', - # '-DCMAKE_CXX_COMPILER=/usr/local/bin/g++', ] + + manylinux_inside = os.environ.get('MANYLINUX_INSIDE') + if manylinux_inside: + # using gcc 7.5 instead of default (Debian 9) 6.3 + cmake_args.extend([ + '-DCMAKE_C_COMPILER=/usr/local/bin/gcc', + '-DCMAKE_CXX_COMPILER=/usr/local/bin/g++', + ]) + build_args = [] # Adding CMake arguments set as environment variable # (needed e.g. to build for ARM OSx on conda-forge) From 56afc7a459d79e8f900c1e2b43aae3e7262fac8e Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Mon, 24 Jan 2022 22:20:55 +0100 Subject: [PATCH 57/63] fix linux wheels --- .github/workflows/build_linux_wheels.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 59d8b44..387e818 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -29,8 +29,12 @@ jobs: CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" # extended manylinux image with updated GCC (7.5) CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/marshalx/wrtc/manylinux_2_24_x86_64:latest - CIBW_BUILD: cp3*-manylinux_* - CIBW_SKIP: cp36-* + CIBW_BUILD: cp39-manylinux_* cp310-manylinux_* + # TODO uncomment after applied patches for cpython in manylinux + # there is no cp37, cp38 for now + # ref: https://github.com/pypa/manylinux/issues/1264 +# CIBW_BUILD: cp3*-manylinux_* +# CIBW_SKIP: cp36-* CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" - name: Upload artifacts. From a9577c740df0137b94a50a0a2b84657bd8cf1910 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Mon, 24 Jan 2022 23:12:57 +0100 Subject: [PATCH 58/63] fix linux build --- .github/workflows/build_linux_wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 387e818..1eff553 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -25,6 +25,7 @@ jobs: uses: pypa/cibuildwheel@v2.3.1 env: MANYLINUX_INSIDE: true + CIBW_ENVIRONMENT_PASS_LINUX: MANYLINUX_INSIDE CIBW_ARCHS: x86_64 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" # extended manylinux image with updated GCC (7.5) From 14a674d13997bcdf5b60d801f0bfe940ead2d77b Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Tue, 25 Jan 2022 09:56:44 +0100 Subject: [PATCH 59/63] update manylinux base image --- .github/workflows/build_manylinux.yml | 2 +- build/Dockerfile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_manylinux.yml b/.github/workflows/build_manylinux.yml index 6ff9bc8..8c38e4f 100644 --- a/.github/workflows/build_manylinux.yml +++ b/.github/workflows/build_manylinux.yml @@ -18,7 +18,7 @@ jobs: matrix: arch: [ "x86_64", - "aarch64", +# "aarch64", ] steps: diff --git a/build/Dockerfile b/build/Dockerfile index 0271533..74e1b60 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,5 +1,6 @@ ARG MANYLINUX_ARCH -FROM quay.io/pypa/manylinux_2_24_$MANYLINUX_ARCH AS builder +# celf pathed cpython https://github.com/MarshalX/manylinux-cpython-pathes +FROM quay.io/pypa_patched/manylinux_2_24_$MANYLINUX_ARCH AS builder RUN apt-get update && apt-get install -y xz-utils libxml2 wget build-essential From e0b1e6290ae12dcb56f1618dd8c58e40910e18cf Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Tue, 25 Jan 2022 11:20:39 +0100 Subject: [PATCH 60/63] use patched cpython in manylinux to support old python versions --- .github/workflows/build_linux_wheels.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 1eff553..6983454 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -28,13 +28,12 @@ jobs: CIBW_ENVIRONMENT_PASS_LINUX: MANYLINUX_INSIDE CIBW_ARCHS: x86_64 CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" - # extended manylinux image with updated GCC (7.5) + # extended manylinux image with updated GCC (7.5) and patched CPython + # about gcc: https://github.com/pypa/manylinux/issues/1012 + # about patch: https://github.com/pypa/manylinux/issues/1264 CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/marshalx/wrtc/manylinux_2_24_x86_64:latest - CIBW_BUILD: cp39-manylinux_* cp310-manylinux_* - # TODO uncomment after applied patches for cpython in manylinux - # there is no cp37, cp38 for now - # ref: https://github.com/pypa/manylinux/issues/1264 -# CIBW_BUILD: cp3*-manylinux_* + CIBW_BUILD: cp3*-manylinux_* + # TODO uncomment after successful build for cp36 (I just want to test my patched manylinux) # CIBW_SKIP: cp36-* CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" From a59d961397203729e4d0737b72f4146ca25ec7cb Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Tue, 25 Jan 2022 13:46:14 +0100 Subject: [PATCH 61/63] build wheel for python 3.6 also --- .github/workflows/build_linux_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 6983454..ee40e9c 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -27,7 +27,7 @@ jobs: MANYLINUX_INSIDE: true CIBW_ENVIRONMENT_PASS_LINUX: MANYLINUX_INSIDE CIBW_ARCHS: x86_64 - CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" + CIBW_PROJECT_REQUIRES_PYTHON: ">=3.6" # extended manylinux image with updated GCC (7.5) and patched CPython # about gcc: https://github.com/pypa/manylinux/issues/1012 # about patch: https://github.com/pypa/manylinux/issues/1264 From 7a78208db69dfac312cfb3e0a22673f251644110 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Tue, 25 Jan 2022 13:51:35 +0100 Subject: [PATCH 62/63] build wheel for python 3.6 also (2) --- .github/workflows/build_macos_wheels.yml | 1 - setup.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build_macos_wheels.yml b/.github/workflows/build_macos_wheels.yml index a1c9170..c9138f1 100644 --- a/.github/workflows/build_macos_wheels.yml +++ b/.github/workflows/build_macos_wheels.yml @@ -4,7 +4,6 @@ on: branches: - main - pypi-dev - - ci-dev paths: - '.github/workflows/build_macos_wheels.yml' - 'python-webrtc/cpp/**' diff --git a/setup.py b/setup.py index 3ac7b8b..1c7bc5f 100644 --- a/setup.py +++ b/setup.py @@ -156,7 +156,7 @@ def build_extension(self, ext): 'Natural Language :: English', 'Intended Audience :: Developers', ], - python_requires='~=3.7', + python_requires='~=3.6', ext_modules=[CMakeExtension('wrtc')], cmdclass={'build_ext': CMakeBuild}, zip_safe=False, From 50c06d8f43ae3ff3f441c2016ce35afa13a41346 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Tue, 25 Jan 2022 16:39:10 +0100 Subject: [PATCH 63/63] remove python 3.6 from linux builds --- .github/workflows/build_linux_wheels.yml | 5 +---- setup.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index ee40e9c..ca1733d 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -4,7 +4,6 @@ on: branches: - main - pypi-dev - - ci-dev paths: - '.github/workflows/build_linux_wheels.yml' - 'python-webrtc/cpp/**' @@ -27,14 +26,12 @@ jobs: MANYLINUX_INSIDE: true CIBW_ENVIRONMENT_PASS_LINUX: MANYLINUX_INSIDE CIBW_ARCHS: x86_64 - CIBW_PROJECT_REQUIRES_PYTHON: ">=3.6" + CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" # extended manylinux image with updated GCC (7.5) and patched CPython # about gcc: https://github.com/pypa/manylinux/issues/1012 # about patch: https://github.com/pypa/manylinux/issues/1264 CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/marshalx/wrtc/manylinux_2_24_x86_64:latest CIBW_BUILD: cp3*-manylinux_* - # TODO uncomment after successful build for cp36 (I just want to test my patched manylinux) -# CIBW_SKIP: cp36-* CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()" - name: Upload artifacts. diff --git a/setup.py b/setup.py index 1c7bc5f..3ac7b8b 100644 --- a/setup.py +++ b/setup.py @@ -156,7 +156,7 @@ def build_extension(self, ext): 'Natural Language :: English', 'Intended Audience :: Developers', ], - python_requires='~=3.6', + python_requires='~=3.7', ext_modules=[CMakeExtension('wrtc')], cmdclass={'build_ext': CMakeBuild}, zip_safe=False,