From 73b0dc91137912b9301aaba5f7b594d5fb72adc2 Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 14:07:54 +0900 Subject: [PATCH 01/32] =?UTF-8?q?=E3=83=87=E3=83=90=E3=83=83=E3=82=B0?= =?UTF-8?q?=E3=83=93=E3=83=AB=E3=83=89=E3=82=92=E4=BD=9C=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=81=BF=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 215 ++++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 .github/workflows/build-debug.yml diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml new file mode 100644 index 0000000..198c7e5 --- /dev/null +++ b/.github/workflows/build-debug.yml @@ -0,0 +1,215 @@ +name: build-debug + +on: + workflow_dispatch: + push: + paths-ignore: + - "examples/**" + - "**.md" + +env: + TEST_SIGNALING_URLS: ${{ secrets.TEST_SIGNALING_URLS }} + TEST_CHANNEL_ID_PREFIX: ${{ secrets.TEST_CHANNEL_ID_PREFIX }} + TEST_SECRET_KEY: ${{ secrets.TEST_SECRET_KEY }} + TEST_API_URL: ${{ secrets.TEST_API_URL }} + +jobs: + build-linux: + strategy: + fail-fast: false + matrix: + platform: + - name: ubuntu-24.04_x86_64 + runs-on: ubuntu-24.04 + runs-on: ${{ matrix.platform.runs-on }} + steps: + - name: Disk Cleanup + run: | + set -x + df -h + sudo du -h -d1 /usr/local + sudo du -h -d1 /usr/local/share + sudo du -h -d1 /usr/local/lib + sudo du -h -d1 /usr/share + RMI=`docker images -q -a` + if [ -n "$RMI" ]; then + docker rmi $RMI + fi + # 4.6G + sudo rm -rf /usr/local/.ghcup + # 1.7G + sudo rm -rf /usr/share/swift + # 1.4G + sudo rm -rf /usr/share/dotnet + # 13G + sudo rm -rf /usr/local/lib/android + df -h + - name: Get stats + run: | + set -x + cat /etc/lsb-release + uname -a + cat /proc/cpuinfo + cat /proc/meminfo + - name: Setup Git User + run: | + git config --global user.name "${{ github.actor }}" + git config --global user.email "${{ github.actor }}@users.noreply.github.com" + + - name: Setup common + run: | + # clang-18 + wget https://apt.llvm.org/llvm.sh + chmod a+x llvm.sh + sudo ./llvm.sh 18 + + - uses: actions/checkout@v4 + with: + path: sora-python-sdk + - name: Get versions + id: version + run: | + source VERSION + echo "webrtc_build_version=${WEBRTC_BUILD_VERSION}" >> $GITHUB_OUTPUT + echo "sora_cpp_sdk_version=${SORA_CPP_SDK_VERSION}" >> $GITHUB_OUTPUT + echo "boost_version=${BOOST_VERSION}" >> $GITHUB_OUTPUT + + # libwebrtc + - uses: actions/cache@v4 + id: webrtc-build-cache + with: + path: webrtc-build/_package/${{ matrix.platform.name }}/webrtc + key: webrtc-build-${{ matrix.platform.name }}-${{ steps.version.outputs.webrtc_build_version }} + - uses: actions/checkout@v4 + if: steps.webrtc-build-cache.outputs.cache-hit != 'true' + with: + path: webrtc-build + repository: https://github.com/shiguredo-webrtc-build/webrtc-build.git + ref: ${{ steps.version.outputs.webrtc_build_version }} + - name: Setup libwebrtc + if: steps.webrtc-build-cache.outputs.cache-hit != 'true' + run: | + set -x + apt-get -y install tzdata + echo 'Asia/Tokyo' > /etc/timezone + dpkg-reconfigure -f noninteractive tzdata + sudo env DEBIAN_FRONTEND=noninteractive apt-get -y install \ + binutils \ + git \ + locales \ + lsb-release \ + ninja-build \ + pkg-config \ + python3 \ + python3-setuptools \ + rsync \ + sudo \ + unzip \ + vim \ + wget \ + xz-utils + - name: Build libwebrtc + if: steps.webrtc-build-cache.outputs.cache-hit != 'true' + working-directory: webrtc-build + run: | + python3 run.py build --debug ${{ matrix.platform.name }} + python3 run.py package --debug ${{ matrix.platform.name }} + + # # sora-cpp-sdk + # - uses: actions/cache@v4 + # id: sora-cpp-sdk-cache + # with: + # path: sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/sora + # key: sora-cpp-sdk-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk_version }} + # - uses: actions/cache@v4 + # id: boost-cache + # with: + # path: sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/boost + # key: boost-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk_version }} + # - uses: actions/checkout@v4 + # if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' + # with: + # path: sora-cpp-sdk + # repository: https://github.com/shiguredo/sora-cpp-sdk.git + # ref: ${{ steps.version.outputs.sora_cpp_sdk_version }} + # - name: Setup sora-cpp-sdk + # if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' + # working-directory: sora-cpp-sdk + # run: | + # source VERSION + # sudo apt-get update + # sudo apt-get install -y software-properties-common + + # # X11 + # sudo apt-get install libx11-dev libxext-dev + + # # CUDA + # wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb + # sudo dpkg -i cuda-keyring_*all.deb + # sudo apt-get update + # DEBIAN_FRONTEND=noninteractive sudo apt-get -y install cuda=$CUDA_VERSION + + # # Intel Media SDK のために libva-dev, libdrm-dev を入れる + # DEBIAN_FRONTEND=noninteractive sudo apt-get -y install libva-dev libdrm-dev + # - name: Copy libwebrtc to sora-cpp-sdk + # if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' + # run: | + # mkdir -p sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug + # cp -r webrtc-build/_package/${{ matrix.platform.name }}/webrtc sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/webrtc + # echo ${{ steps.version.outputs.webrtc_build_version }} > sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/webrtc.version + # - name: Build sora-cpp-sdk + # if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' + # run: python3 run.py --debug ${{ matrix.platform.name }} + + # # sora-python-sdk + # - name: Setup sora-python-sdk + # run: | + # sudo apt-get update + # sudo apt-get -y install libva2 libdrm2 libva-dev libdrm-dev libx11-dev portaudio19-dev + + # # Download OpneH264 + # curl -LO http://ciscobinary.openh264.org/libopenh264-2.4.1-linux64.7.so.bz2 + # bzip2 -d libopenh264-2.4.1-linux64.7.so.bz2 + # mv libopenh264-2.4.1-linux64.7.so libopenh264.so + # echo "OPENH264_PATH=`pwd`/libopenh264.so" >> $GITHUB_ENV + # - name: Copy libwebrtc to sora-python-sdk + # run: | + # mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/debug + # cp -r webrtc-build/_package/${{ matrix.platform.name }}/webrtc sora-python-sdk/_install/${{ matrix.platform.name }}/debug/webrtc + # echo ${{ steps.version.outputs.webrtc_build_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/debug/webrtc.version + # - name: Copy sora-cpp-sdk to sora-python-sdk + # run: | + # mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/debug + # cp -r sora-cpp-sdk/_package/${{ matrix.platform.name }}/sora sora-python-sdk/_install/${{ matrix.platform.name }}/debug/sora + # echo ${{ steps.version.outputs.sora_cpp_sdk_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/debug/sora.version + # - name: Copy boost to sora-python-sdk + # run: | + # mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/debug + # cp -r boost/_package/${{ matrix.platform.name }}/boost boost/_install/${{ matrix.platform.name }}/debug/boost + # echo ${{ steps.version.outputs.boost_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/debug/boost.version + # - uses: actions/cache@v4 + # id: llvm-cache + # with: + # path: sora-python-sdk/_package/${{ matrix.platform.name }}/llvm + # key: llvm-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk }} + # - uses: actions/cache@v4 + # id: version-file-cache + # with: + # path: versions + # key: versions-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk }} + # - run: cp versions/llvm.version sora-python-sdk/_install/${{ matrix.platform.name }}/debug/ + # - uses: astral-sh/setup-uv@v3 + # - name: Build sora-python-sdk + # working-directory: sora-python-sdk + # run: | + # set -x + # # uv python pin ${{ matrix.python_version }} + # uv sync + # uv run python run.py --debug ${{ matrix.platform.target }} + # # cache + # mkdir ../versions + # cp _install/${{ matrix.platform.name }}/debug/llvm.version ../versions + # - name: E2E Test sora-python-sdk + # working-directory: sora-python-sdk + # run: | + # lldb-18 -o 'settings set target.process.follow-fork-mode child' -o run -o continue -o 'bt all' -o 'exit' -- uv run pytest tests -s From cc89add208b2df4825b3a9a02673f5a2607f7806 Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 14:09:54 +0900 Subject: [PATCH 02/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 198c7e5..d742204 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -27,10 +27,10 @@ jobs: run: | set -x df -h - sudo du -h -d1 /usr/local - sudo du -h -d1 /usr/local/share - sudo du -h -d1 /usr/local/lib - sudo du -h -d1 /usr/share + # sudo du -h -d1 /usr/local + # sudo du -h -d1 /usr/local/share + # sudo du -h -d1 /usr/local/lib + # sudo du -h -d1 /usr/share RMI=`docker images -q -a` if [ -n "$RMI" ]; then docker rmi $RMI @@ -69,7 +69,7 @@ jobs: - name: Get versions id: version run: | - source VERSION + source sora-python-sdk/VERSION echo "webrtc_build_version=${WEBRTC_BUILD_VERSION}" >> $GITHUB_OUTPUT echo "sora_cpp_sdk_version=${SORA_CPP_SDK_VERSION}" >> $GITHUB_OUTPUT echo "boost_version=${BOOST_VERSION}" >> $GITHUB_OUTPUT From 3575cfd1b9c495738f513398f847fab2304c2ad3 Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 14:11:36 +0900 Subject: [PATCH 03/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index d742204..40ed30c 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -84,7 +84,7 @@ jobs: if: steps.webrtc-build-cache.outputs.cache-hit != 'true' with: path: webrtc-build - repository: https://github.com/shiguredo-webrtc-build/webrtc-build.git + repository: shiguredo-webrtc-build/webrtc-build ref: ${{ steps.version.outputs.webrtc_build_version }} - name: Setup libwebrtc if: steps.webrtc-build-cache.outputs.cache-hit != 'true' @@ -130,7 +130,7 @@ jobs: # if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' # with: # path: sora-cpp-sdk - # repository: https://github.com/shiguredo/sora-cpp-sdk.git + # repository: shiguredo/sora-cpp-sdk # ref: ${{ steps.version.outputs.sora_cpp_sdk_version }} # - name: Setup sora-cpp-sdk # if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' From e8d1522923ab5a53bde3cc8c4544881f00a20ebb Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 14:13:03 +0900 Subject: [PATCH 04/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 40ed30c..79df731 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -90,9 +90,9 @@ jobs: if: steps.webrtc-build-cache.outputs.cache-hit != 'true' run: | set -x - apt-get -y install tzdata - echo 'Asia/Tokyo' > /etc/timezone - dpkg-reconfigure -f noninteractive tzdata + sudo apt-get -y install tzdata + sudo echo 'Asia/Tokyo' > /etc/timezone + sudo dpkg-reconfigure -f noninteractive tzdata sudo env DEBIAN_FRONTEND=noninteractive apt-get -y install \ binutils \ git \ From 29643ecf6571ac94a9dd8008edf1ee55b5d994f6 Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 14:18:07 +0900 Subject: [PATCH 05/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 41 +++++++++++++++++-------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 79df731..f481f5c 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -89,25 +89,28 @@ jobs: - name: Setup libwebrtc if: steps.webrtc-build-cache.outputs.cache-hit != 'true' run: | - set -x - sudo apt-get -y install tzdata - sudo echo 'Asia/Tokyo' > /etc/timezone - sudo dpkg-reconfigure -f noninteractive tzdata - sudo env DEBIAN_FRONTEND=noninteractive apt-get -y install \ - binutils \ - git \ - locales \ - lsb-release \ - ninja-build \ - pkg-config \ - python3 \ - python3-setuptools \ - rsync \ - sudo \ - unzip \ - vim \ - wget \ - xz-utils + sudo bash -c ' + set -ex + apt-get -y install tzdata + echo "Asia/Tokyo" > /etc/timezone + dpkg-reconfigure -f noninteractive tzdata + export DEBIAN_FRONTEND=noninteractive + apt-get -y install \ + binutils \ + git \ + locales \ + lsb-release \ + ninja-build \ + pkg-config \ + python3 \ + python3-setuptools \ + rsync \ + sudo \ + unzip \ + vim \ + wget \ + xz-utils + ' - name: Build libwebrtc if: steps.webrtc-build-cache.outputs.cache-hit != 'true' working-directory: webrtc-build From 09e2e36334127c989e2d8a5aaea0df346d0e99c6 Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 15:01:04 +0900 Subject: [PATCH 06/32] =?UTF-8?q?sora-cpp-sdk=20=E3=82=82=E3=83=93?= =?UTF-8?q?=E3=83=AB=E3=83=89=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 84 +++++++++++++++---------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index f481f5c..c7acb38 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -118,51 +118,51 @@ jobs: python3 run.py build --debug ${{ matrix.platform.name }} python3 run.py package --debug ${{ matrix.platform.name }} - # # sora-cpp-sdk - # - uses: actions/cache@v4 - # id: sora-cpp-sdk-cache - # with: - # path: sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/sora - # key: sora-cpp-sdk-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk_version }} - # - uses: actions/cache@v4 - # id: boost-cache - # with: - # path: sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/boost - # key: boost-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk_version }} - # - uses: actions/checkout@v4 - # if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' - # with: - # path: sora-cpp-sdk - # repository: shiguredo/sora-cpp-sdk - # ref: ${{ steps.version.outputs.sora_cpp_sdk_version }} - # - name: Setup sora-cpp-sdk - # if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' - # working-directory: sora-cpp-sdk - # run: | - # source VERSION - # sudo apt-get update - # sudo apt-get install -y software-properties-common + # sora-cpp-sdk + - uses: actions/cache@v4 + id: sora-cpp-sdk-cache + with: + path: sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/sora + key: sora-cpp-sdk-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk_version }} + - uses: actions/cache@v4 + id: boost-cache + with: + path: sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/boost + key: boost-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk_version }} + - uses: actions/checkout@v4 + if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' + with: + path: sora-cpp-sdk + repository: shiguredo/sora-cpp-sdk + ref: ${{ steps.version.outputs.sora_cpp_sdk_version }} + - name: Setup sora-cpp-sdk + if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' + working-directory: sora-cpp-sdk + run: | + source VERSION + sudo apt-get update + sudo apt-get install -y software-properties-common - # # X11 - # sudo apt-get install libx11-dev libxext-dev + # X11 + sudo apt-get install libx11-dev libxext-dev - # # CUDA - # wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb - # sudo dpkg -i cuda-keyring_*all.deb - # sudo apt-get update - # DEBIAN_FRONTEND=noninteractive sudo apt-get -y install cuda=$CUDA_VERSION + # CUDA + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb + sudo dpkg -i cuda-keyring_*all.deb + sudo apt-get update + DEBIAN_FRONTEND=noninteractive sudo apt-get -y install cuda=$CUDA_VERSION - # # Intel Media SDK のために libva-dev, libdrm-dev を入れる - # DEBIAN_FRONTEND=noninteractive sudo apt-get -y install libva-dev libdrm-dev - # - name: Copy libwebrtc to sora-cpp-sdk - # if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' - # run: | - # mkdir -p sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug - # cp -r webrtc-build/_package/${{ matrix.platform.name }}/webrtc sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/webrtc - # echo ${{ steps.version.outputs.webrtc_build_version }} > sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/webrtc.version - # - name: Build sora-cpp-sdk - # if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' - # run: python3 run.py --debug ${{ matrix.platform.name }} + # Intel Media SDK のために libva-dev, libdrm-dev を入れる + DEBIAN_FRONTEND=noninteractive sudo apt-get -y install libva-dev libdrm-dev + - name: Copy libwebrtc to sora-cpp-sdk + if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' + run: | + mkdir -p sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug + cp -r webrtc-build/_package/${{ matrix.platform.name }}/webrtc sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/webrtc + echo ${{ steps.version.outputs.webrtc_build_version }} > sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/webrtc.version + - name: Build sora-cpp-sdk + if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' + run: python3 run.py --debug ${{ matrix.platform.name }} # # sora-python-sdk # - name: Setup sora-python-sdk From f8c710d0feb5f3d3a88ad563b263cacc731b4dc6 Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 17:59:20 +0900 Subject: [PATCH 07/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index c7acb38..0f8f7d1 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -147,6 +147,8 @@ jobs: sudo apt-get install libx11-dev libxext-dev # CUDA + wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb + sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb sudo dpkg -i cuda-keyring_*all.deb sudo apt-get update From 6667b8ee7ca296bbaab072723db9298d69eac706 Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 18:10:38 +0900 Subject: [PATCH 08/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 0f8f7d1..a9541ed 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -135,6 +135,24 @@ jobs: path: sora-cpp-sdk repository: shiguredo/sora-cpp-sdk ref: ${{ steps.version.outputs.sora_cpp_sdk_version }} + # Ubuntu 24.04 だと libtinfo5 が見つからない問題があるので、その修正 + # ref: https://qiita.com/gengen16k/items/88cf3c18a40a94205fab + - name: Fix CUDA issues for Ubuntu 24.04 + if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' && matrix.platform.name == ubuntu-24.04_x86_64 + run: | + sudo tee /etc/apt/sources.list.d/jammy.list << EOF + deb http://archive.ubuntu.com/ubuntu/ jammy universe + EOF + + sudo tee /etc/apt/preferences.d/pin-jammy < Date: Sat, 2 Nov 2024 18:11:46 +0900 Subject: [PATCH 09/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index a9541ed..6825a83 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -138,7 +138,7 @@ jobs: # Ubuntu 24.04 だと libtinfo5 が見つからない問題があるので、その修正 # ref: https://qiita.com/gengen16k/items/88cf3c18a40a94205fab - name: Fix CUDA issues for Ubuntu 24.04 - if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' && matrix.platform.name == ubuntu-24.04_x86_64 + if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' && matrix.platform.name == 'ubuntu-24.04_x86_64' run: | sudo tee /etc/apt/sources.list.d/jammy.list << EOF deb http://archive.ubuntu.com/ubuntu/ jammy universe From 88bbd1ca0550097d615311208205a09f6914c291 Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 18:18:34 +0900 Subject: [PATCH 10/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 6825a83..8ba1135 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -182,6 +182,7 @@ jobs: echo ${{ steps.version.outputs.webrtc_build_version }} > sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/webrtc.version - name: Build sora-cpp-sdk if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' + working-directory: sora-cpp-sdk run: python3 run.py --debug ${{ matrix.platform.name }} # # sora-python-sdk From 48eec50a3184ddbce0eea1412c7193e83e823994 Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 18:29:21 +0900 Subject: [PATCH 11/32] =?UTF-8?q?=E3=83=A1=E3=82=A4=E3=83=B3=E3=81=AE?= =?UTF-8?q?=E3=83=93=E3=83=AB=E3=83=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 102 +++++++++++++++--------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 8ba1135..ae1926b 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -185,55 +185,55 @@ jobs: working-directory: sora-cpp-sdk run: python3 run.py --debug ${{ matrix.platform.name }} - # # sora-python-sdk - # - name: Setup sora-python-sdk - # run: | - # sudo apt-get update - # sudo apt-get -y install libva2 libdrm2 libva-dev libdrm-dev libx11-dev portaudio19-dev + # sora-python-sdk + - name: Setup sora-python-sdk + run: | + sudo apt-get update + sudo apt-get -y install libva2 libdrm2 libva-dev libdrm-dev libx11-dev portaudio19-dev - # # Download OpneH264 - # curl -LO http://ciscobinary.openh264.org/libopenh264-2.4.1-linux64.7.so.bz2 - # bzip2 -d libopenh264-2.4.1-linux64.7.so.bz2 - # mv libopenh264-2.4.1-linux64.7.so libopenh264.so - # echo "OPENH264_PATH=`pwd`/libopenh264.so" >> $GITHUB_ENV - # - name: Copy libwebrtc to sora-python-sdk - # run: | - # mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/debug - # cp -r webrtc-build/_package/${{ matrix.platform.name }}/webrtc sora-python-sdk/_install/${{ matrix.platform.name }}/debug/webrtc - # echo ${{ steps.version.outputs.webrtc_build_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/debug/webrtc.version - # - name: Copy sora-cpp-sdk to sora-python-sdk - # run: | - # mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/debug - # cp -r sora-cpp-sdk/_package/${{ matrix.platform.name }}/sora sora-python-sdk/_install/${{ matrix.platform.name }}/debug/sora - # echo ${{ steps.version.outputs.sora_cpp_sdk_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/debug/sora.version - # - name: Copy boost to sora-python-sdk - # run: | - # mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/debug - # cp -r boost/_package/${{ matrix.platform.name }}/boost boost/_install/${{ matrix.platform.name }}/debug/boost - # echo ${{ steps.version.outputs.boost_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/debug/boost.version - # - uses: actions/cache@v4 - # id: llvm-cache - # with: - # path: sora-python-sdk/_package/${{ matrix.platform.name }}/llvm - # key: llvm-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk }} - # - uses: actions/cache@v4 - # id: version-file-cache - # with: - # path: versions - # key: versions-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk }} - # - run: cp versions/llvm.version sora-python-sdk/_install/${{ matrix.platform.name }}/debug/ - # - uses: astral-sh/setup-uv@v3 - # - name: Build sora-python-sdk - # working-directory: sora-python-sdk - # run: | - # set -x - # # uv python pin ${{ matrix.python_version }} - # uv sync - # uv run python run.py --debug ${{ matrix.platform.target }} - # # cache - # mkdir ../versions - # cp _install/${{ matrix.platform.name }}/debug/llvm.version ../versions - # - name: E2E Test sora-python-sdk - # working-directory: sora-python-sdk - # run: | - # lldb-18 -o 'settings set target.process.follow-fork-mode child' -o run -o continue -o 'bt all' -o 'exit' -- uv run pytest tests -s + # Download OpneH264 + curl -LO http://ciscobinary.openh264.org/libopenh264-2.4.1-linux64.7.so.bz2 + bzip2 -d libopenh264-2.4.1-linux64.7.so.bz2 + mv libopenh264-2.4.1-linux64.7.so libopenh264.so + echo "OPENH264_PATH=`pwd`/libopenh264.so" >> $GITHUB_ENV + - name: Copy libwebrtc to sora-python-sdk + run: | + mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/debug + cp -r webrtc-build/_package/${{ matrix.platform.name }}/webrtc sora-python-sdk/_install/${{ matrix.platform.name }}/debug/webrtc + echo ${{ steps.version.outputs.webrtc_build_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/debug/webrtc.version + - name: Copy sora-cpp-sdk to sora-python-sdk + run: | + mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/debug + cp -r sora-cpp-sdk/_package/${{ matrix.platform.name }}/sora sora-python-sdk/_install/${{ matrix.platform.name }}/debug/sora + echo ${{ steps.version.outputs.sora_cpp_sdk_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/debug/sora.version + - name: Copy boost to sora-python-sdk + run: | + mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/debug + cp -r boost/_package/${{ matrix.platform.name }}/boost boost/_install/${{ matrix.platform.name }}/debug/boost + echo ${{ steps.version.outputs.boost_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/debug/boost.version + - uses: actions/cache@v4 + id: llvm-cache + with: + path: sora-python-sdk/_package/${{ matrix.platform.name }}/llvm + key: llvm-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk }} + - uses: actions/cache@v4 + id: version-file-cache + with: + path: versions + key: versions-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk }} + - run: cp versions/llvm.version sora-python-sdk/_install/${{ matrix.platform.name }}/debug/ + - uses: astral-sh/setup-uv@v3 + - name: Build sora-python-sdk + working-directory: sora-python-sdk + run: | + set -x + # uv python pin ${{ matrix.python_version }} + uv sync + uv run python run.py --debug ${{ matrix.platform.target }} + # cache + mkdir ../versions + cp _install/${{ matrix.platform.name }}/debug/llvm.version ../versions + - name: E2E Test sora-python-sdk + working-directory: sora-python-sdk + run: | + lldb-18 -o 'settings set target.process.follow-fork-mode child' -o run -o continue -o 'bt all' -o 'exit' -- uv run pytest tests -s From 38d295d07ec0dfad8719879922573bbd92a441d0 Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 18:33:56 +0900 Subject: [PATCH 12/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index ae1926b..45d483d 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -204,7 +204,7 @@ jobs: - name: Copy sora-cpp-sdk to sora-python-sdk run: | mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/debug - cp -r sora-cpp-sdk/_package/${{ matrix.platform.name }}/sora sora-python-sdk/_install/${{ matrix.platform.name }}/debug/sora + cp -r sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/sora sora-python-sdk/_install/${{ matrix.platform.name }}/debug/sora echo ${{ steps.version.outputs.sora_cpp_sdk_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/debug/sora.version - name: Copy boost to sora-python-sdk run: | From cabf01985f16979dc83aea7352b3ebda4eb3a01d Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 18:36:28 +0900 Subject: [PATCH 13/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 45d483d..040eb2c 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -209,7 +209,7 @@ jobs: - name: Copy boost to sora-python-sdk run: | mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/debug - cp -r boost/_package/${{ matrix.platform.name }}/boost boost/_install/${{ matrix.platform.name }}/debug/boost + cp -r sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/boost sora-python-sdk/_install/${{ matrix.platform.name }}/debug/boost echo ${{ steps.version.outputs.boost_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/debug/boost.version - uses: actions/cache@v4 id: llvm-cache From de6f285db95837df80e47f74fba2dd71271fca21 Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 18:40:07 +0900 Subject: [PATCH 14/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 040eb2c..d8bf51c 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -221,7 +221,9 @@ jobs: with: path: versions key: versions-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk }} - - run: cp versions/llvm.version sora-python-sdk/_install/${{ matrix.platform.name }}/debug/ + - name: Copy version file + if: steps.version-file-cache.outputs.cache-hit == 'true' + run: cp versions/llvm.version sora-python-sdk/_install/${{ matrix.platform.name }}/debug/ - uses: astral-sh/setup-uv@v3 - name: Build sora-python-sdk working-directory: sora-python-sdk From 478b72482d5933d67debb0f416eeec41ae7e4e5f Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 18:41:42 +0900 Subject: [PATCH 15/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index d8bf51c..ba3706c 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -231,7 +231,7 @@ jobs: set -x # uv python pin ${{ matrix.python_version }} uv sync - uv run python run.py --debug ${{ matrix.platform.target }} + uv run python run.py --debug ${{ matrix.platform.name }} # cache mkdir ../versions cp _install/${{ matrix.platform.name }}/debug/llvm.version ../versions From 800bf26d4bdc4ba9fc640af737a696b04b5148f5 Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 18:51:03 +0900 Subject: [PATCH 16/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index ba3706c..5c32f6d 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -199,18 +199,18 @@ jobs: - name: Copy libwebrtc to sora-python-sdk run: | mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/debug - cp -r webrtc-build/_package/${{ matrix.platform.name }}/webrtc sora-python-sdk/_install/${{ matrix.platform.name }}/debug/webrtc - echo ${{ steps.version.outputs.webrtc_build_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/debug/webrtc.version + cp -r webrtc-build/_package/${{ matrix.platform.name }}/webrtc sora-python-sdk/_install/${{ matrix.platform.name }}/webrtc + echo ${{ steps.version.outputs.webrtc_build_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/webrtc.version - name: Copy sora-cpp-sdk to sora-python-sdk run: | mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/debug - cp -r sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/sora sora-python-sdk/_install/${{ matrix.platform.name }}/debug/sora - echo ${{ steps.version.outputs.sora_cpp_sdk_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/debug/sora.version + cp -r sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/sora sora-python-sdk/_install/${{ matrix.platform.name }}/sora + echo ${{ steps.version.outputs.sora_cpp_sdk_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/sora.version - name: Copy boost to sora-python-sdk run: | mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/debug - cp -r sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/boost sora-python-sdk/_install/${{ matrix.platform.name }}/debug/boost - echo ${{ steps.version.outputs.boost_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/debug/boost.version + cp -r sora-cpp-sdk/_install/${{ matrix.platform.name }}/debug/boost sora-python-sdk/_install/${{ matrix.platform.name }}/boost + echo ${{ steps.version.outputs.boost_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/boost.version - uses: actions/cache@v4 id: llvm-cache with: From 61f0b06cfe698e5a94c7d5ba11c6d6cc1d213b2d Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 18:56:55 +0900 Subject: [PATCH 17/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 5c32f6d..32b8e53 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -234,7 +234,7 @@ jobs: uv run python run.py --debug ${{ matrix.platform.name }} # cache mkdir ../versions - cp _install/${{ matrix.platform.name }}/debug/llvm.version ../versions + cp _install/${{ matrix.platform.name }}/llvm.version ../versions - name: E2E Test sora-python-sdk working-directory: sora-python-sdk run: | From 13636a56d70521b6b0d411c827316e3bb4d9f57b Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 18:57:12 +0900 Subject: [PATCH 18/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 32b8e53..1980028 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -223,7 +223,7 @@ jobs: key: versions-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk }} - name: Copy version file if: steps.version-file-cache.outputs.cache-hit == 'true' - run: cp versions/llvm.version sora-python-sdk/_install/${{ matrix.platform.name }}/debug/ + run: cp versions/llvm.version sora-python-sdk/_install/${{ matrix.platform.name }}/ - uses: astral-sh/setup-uv@v3 - name: Build sora-python-sdk working-directory: sora-python-sdk From 2bc359ae44c9599e7288fa3ced9bd812f6d93cca Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 19:45:11 +0900 Subject: [PATCH 19/32] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=B9?= =?UTF-8?q?=E3=82=AF=E3=83=AA=E3=83=97=E3=83=88=E3=82=92=E4=BD=BF=E3=81=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 2 +- test_with_llvm.py | 35 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 test_with_llvm.py diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 1980028..3155496 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -238,4 +238,4 @@ jobs: - name: E2E Test sora-python-sdk working-directory: sora-python-sdk run: | - lldb-18 -o 'settings set target.process.follow-fork-mode child' -o run -o continue -o 'bt all' -o 'exit' -- uv run pytest tests -s + lldb-18 --batch -o 'command script import test_with_llvm.py' -o 'test' diff --git a/test_with_llvm.py b/test_with_llvm.py new file mode 100644 index 0000000..8e9dc36 --- /dev/null +++ b/test_with_llvm.py @@ -0,0 +1,35 @@ +import sys +import time + +import lldb + + +def test(debugger, command, result, internal_dict): + debugger.HandleCommand("settings set target.process.follow-fork-mode child") + + target = debugger.CreateTargetWithFileAndArch("uv", lldb.LLDB_ARCH_DEFAULT) + process = target.LaunchSimple(["run", "pytest", "tests", "-s"], None, None) + + if not process: + print("Error: could not launch process") + return + + while True: + time.sleep(1.0) + state = process.GetState() + + if state == lldb.eStateExited: + exit_status = process.GetExitStatus() + sys.exit(exit_status) + elif state == lldb.eStateStopped: + thread = process.GetSelectedThread() + if thread.GetStopReason() == lldb.eStopReasonExec: + process.Continue() + continue + debugger.HandleCommand("bt all") + sys.exit(1) + + +# LLDBにスクリプトを初期化してコマンドを追加 +def __lldb_init_module(debugger, internal_dict): + debugger.HandleCommand("command script add -f test_with_llvm.test test") From 85c67fe97734ee177350c97ee228d59f67db34f8 Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 19:54:23 +0900 Subject: [PATCH 20/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 3155496..ab48961 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -214,7 +214,7 @@ jobs: - uses: actions/cache@v4 id: llvm-cache with: - path: sora-python-sdk/_package/${{ matrix.platform.name }}/llvm + path: sora-python-sdk/_install/${{ matrix.platform.name }}/llvm key: llvm-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk }} - uses: actions/cache@v4 id: version-file-cache From ac69f1323f00cccf6971b06c2e44ccd22362c93d Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 20:03:23 +0900 Subject: [PATCH 21/32] =?UTF-8?q?=E7=B9=B0=E3=82=8A=E8=BF=94=E3=81=97?= =?UTF-8?q?=E5=AE=9F=E8=A1=8C=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index ab48961..86d87cc 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -238,4 +238,8 @@ jobs: - name: E2E Test sora-python-sdk working-directory: sora-python-sdk run: | - lldb-18 --batch -o 'command script import test_with_llvm.py' -o 'test' + for i in {1..10}; do + echo "---------------- $i 回目 ----------------" + sleep 10 + lldb-18 --batch -o 'command script import test_with_llvm.py' -o 'test' + done From dc393e04addf2c3ad1c4a13ad9b2411d4f16d616 Mon Sep 17 00:00:00 2001 From: melpon Date: Sat, 2 Nov 2024 20:08:05 +0900 Subject: [PATCH 22/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 86d87cc..6d7dbf9 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -233,7 +233,7 @@ jobs: uv sync uv run python run.py --debug ${{ matrix.platform.name }} # cache - mkdir ../versions + mkdir -p ../versions cp _install/${{ matrix.platform.name }}/llvm.version ../versions - name: E2E Test sora-python-sdk working-directory: sora-python-sdk From 01fb3bac05357ba5fbfae9e16e26bdefd740e36c Mon Sep 17 00:00:00 2001 From: melpon Date: Sun, 3 Nov 2024 01:15:47 +0900 Subject: [PATCH 23/32] =?UTF-8?q?relwithdebinfo=20=E3=82=92=E8=A9=A6?= =?UTF-8?q?=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-relwithdebinfo.yml | 190 +++++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 .github/workflows/build-relwithdebinfo.yml diff --git a/.github/workflows/build-relwithdebinfo.yml b/.github/workflows/build-relwithdebinfo.yml new file mode 100644 index 0000000..7e504d9 --- /dev/null +++ b/.github/workflows/build-relwithdebinfo.yml @@ -0,0 +1,190 @@ +name: build-relwithdebinfo + +on: + workflow_dispatch: + push: + paths-ignore: + - "examples/**" + - "**.md" + +env: + TEST_SIGNALING_URLS: ${{ secrets.TEST_SIGNALING_URLS }} + TEST_CHANNEL_ID_PREFIX: ${{ secrets.TEST_CHANNEL_ID_PREFIX }} + TEST_SECRET_KEY: ${{ secrets.TEST_SECRET_KEY }} + TEST_API_URL: ${{ secrets.TEST_API_URL }} + +jobs: + build-linux: + strategy: + fail-fast: false + matrix: + platform: + - name: ubuntu-24.04_x86_64 + runs-on: ubuntu-24.04 + runs-on: ${{ matrix.platform.runs-on }} + steps: + - name: Disk Cleanup + run: | + set -x + df -h + # sudo du -h -d1 /usr/local + # sudo du -h -d1 /usr/local/share + # sudo du -h -d1 /usr/local/lib + # sudo du -h -d1 /usr/share + RMI=`docker images -q -a` + if [ -n "$RMI" ]; then + docker rmi $RMI + fi + # 4.6G + sudo rm -rf /usr/local/.ghcup + # 1.7G + sudo rm -rf /usr/share/swift + # 1.4G + sudo rm -rf /usr/share/dotnet + # 13G + sudo rm -rf /usr/local/lib/android + df -h + - name: Get stats + run: | + set -x + cat /etc/lsb-release + uname -a + cat /proc/cpuinfo + cat /proc/meminfo + - name: Setup Git User + run: | + git config --global user.name "${{ github.actor }}" + git config --global user.email "${{ github.actor }}@users.noreply.github.com" + + - name: Setup common + run: | + # clang-18 + wget https://apt.llvm.org/llvm.sh + chmod a+x llvm.sh + sudo ./llvm.sh 18 + + - uses: actions/checkout@v4 + with: + path: sora-python-sdk + - name: Get versions + id: version + run: | + source sora-python-sdk/VERSION + echo "webrtc_build_version=${WEBRTC_BUILD_VERSION}" >> $GITHUB_OUTPUT + echo "sora_cpp_sdk_version=${SORA_CPP_SDK_VERSION}" >> $GITHUB_OUTPUT + echo "boost_version=${BOOST_VERSION}" >> $GITHUB_OUTPUT + + # sora-cpp-sdk + - uses: actions/cache@v4 + id: sora-cpp-sdk-cache + with: + path: sora-cpp-sdk/_install/${{ matrix.platform.name }}/release/sora + key: sora-cpp-sdk-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk_version }}-relwithdebinfo + - uses: actions/cache@v4 + id: boost-cache + with: + path: sora-cpp-sdk/_install/${{ matrix.platform.name }}/release/boost + key: boost-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk_version }}-relwithdebinfo + - uses: actions/checkout@v4 + if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' + with: + path: sora-cpp-sdk + repository: shiguredo/sora-cpp-sdk + ref: ${{ steps.version.outputs.sora_cpp_sdk_version }} + # Ubuntu 24.04 だと libtinfo5 が見つからない問題があるので、その修正 + # ref: https://qiita.com/gengen16k/items/88cf3c18a40a94205fab + - name: Fix CUDA issues for Ubuntu 24.04 + if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' && matrix.platform.name == 'ubuntu-24.04_x86_64' + run: | + sudo tee /etc/apt/sources.list.d/jammy.list << EOF + deb http://archive.ubuntu.com/ubuntu/ jammy universe + EOF + + sudo tee /etc/apt/preferences.d/pin-jammy <> $GITHUB_ENV + - name: Copy sora-cpp-sdk to sora-python-sdk + run: | + mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/release + cp -r sora-cpp-sdk/_install/${{ matrix.platform.name }}/release/sora sora-python-sdk/_install/${{ matrix.platform.name }}/sora + echo ${{ steps.version.outputs.sora_cpp_sdk_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/sora.version + - name: Copy boost to sora-python-sdk + run: | + mkdir -p sora-python-sdk/_install/${{ matrix.platform.name }}/release + cp -r sora-cpp-sdk/_install/${{ matrix.platform.name }}/release/boost sora-python-sdk/_install/${{ matrix.platform.name }}/boost + echo ${{ steps.version.outputs.boost_version }} > sora-python-sdk/_install/${{ matrix.platform.name }}/boost.version + - uses: actions/cache@v4 + id: llvm-cache + with: + path: sora-python-sdk/_install/${{ matrix.platform.name }}/llvm + key: llvm-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk }} + - uses: actions/cache@v4 + id: version-file-cache + with: + path: versions + key: versions-${{ matrix.platform.name }}-${{ steps.version.outputs.sora_cpp_sdk }} + - name: Copy version file + if: steps.version-file-cache.outputs.cache-hit == 'true' + run: cp versions/llvm.version sora-python-sdk/_install/${{ matrix.platform.name }}/ + - uses: astral-sh/setup-uv@v3 + - name: Build sora-python-sdk + working-directory: sora-python-sdk + run: | + set -x + # uv python pin ${{ matrix.python_version }} + uv sync + uv run python run.py --relwithdebinfo ${{ matrix.platform.name }} + # cache + mkdir -p ../versions + cp _install/${{ matrix.platform.name }}/llvm.version ../versions + - name: E2E Test sora-python-sdk + working-directory: sora-python-sdk + run: | + for i in {1..10}; do + echo "---------------- $i 回目 ----------------" + sleep 10 + lldb-18 --batch -o 'command script import test_with_llvm.py' -o 'test' + done From f55e36bd60b46be2609a9e43aa16dea09ca85cf9 Mon Sep 17 00:00:00 2001 From: melpon Date: Sun, 3 Nov 2024 01:58:41 +0900 Subject: [PATCH 24/32] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_with_llvm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test_with_llvm.py b/test_with_llvm.py index 8e9dc36..e12c446 100644 --- a/test_with_llvm.py +++ b/test_with_llvm.py @@ -20,6 +20,7 @@ def test(debugger, command, result, internal_dict): if state == lldb.eStateExited: exit_status = process.GetExitStatus() + debugger.HandleCommand(f"exit {exit_status}") sys.exit(exit_status) elif state == lldb.eStateStopped: thread = process.GetSelectedThread() @@ -27,6 +28,7 @@ def test(debugger, command, result, internal_dict): process.Continue() continue debugger.HandleCommand("bt all") + debugger.HandleCommand("exit 1") sys.exit(1) From 4d8aab6230204f818f598b29ff37e21d85d0c908 Mon Sep 17 00:00:00 2001 From: melpon Date: Sun, 3 Nov 2024 02:07:50 +0900 Subject: [PATCH 25/32] =?UTF-8?q?=E8=90=BD=E3=81=A1=E3=81=AA=E3=81=91?= =?UTF-8?q?=E3=82=8C=E3=81=B0=20exit=200=20=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run.py | 6 +++++- test_with_llvm.py | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/run.py b/run.py index e054a37..3bc6a79 100644 --- a/run.py +++ b/run.py @@ -226,7 +226,11 @@ def main(): args.local_sora_cpp_sdk_args, ) - configuration = "Debug" if args.debug else "Release" + configuration = "Release" + if args.debug: + configuration = "Debug" + if args.relwithdebinfo: + configuration = "RelWithDebInfo" webrtc_platform = get_webrtc_platform(platform) webrtc_info = get_webrtc_info( diff --git a/test_with_llvm.py b/test_with_llvm.py index e12c446..77f28c6 100644 --- a/test_with_llvm.py +++ b/test_with_llvm.py @@ -20,8 +20,10 @@ def test(debugger, command, result, internal_dict): if state == lldb.eStateExited: exit_status = process.GetExitStatus() - debugger.HandleCommand(f"exit {exit_status}") - sys.exit(exit_status) + # debugger.HandleCommand(f"exit {exit_status}") + # sys.exit(exit_status) + debugger.HandleCommand("exit 0") + sys.exit(0) elif state == lldb.eStateStopped: thread = process.GetSelectedThread() if thread.GetStopReason() == lldb.eStopReasonExec: From f4dd5a8a73955044516c52617264025067160d63 Mon Sep 17 00:00:00 2001 From: melpon Date: Sun, 3 Nov 2024 13:59:10 +0900 Subject: [PATCH 26/32] =?UTF-8?q?=E3=82=8F=E3=81=96=E3=81=A8=E8=90=BD?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E3=81=BF=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/client.py b/tests/client.py index 13aea57..a3328c7 100644 --- a/tests/client.py +++ b/tests/client.py @@ -416,6 +416,8 @@ def _on_disconnect(self, error_code: SoraSignalingErrorCode, message: str) -> No if self._fake_video_thread is not None: self._fake_video_thread.join(timeout=10) + self._sora = None + def _on_ws_close(self, code: int, reason: str) -> None: print(f"WebSocket closed: code={code} reason={reason}") self._ws_close = True From d79f3ef377d59208e96f48867b40894ccfeb9803 Mon Sep 17 00:00:00 2001 From: melpon Date: Sun, 3 Nov 2024 14:07:03 +0900 Subject: [PATCH 27/32] =?UTF-8?q?Revert=20"=E3=82=8F=E3=81=96=E3=81=A8?= =?UTF-8?q?=E8=90=BD=E3=81=A8=E3=81=97=E3=81=A6=E3=81=BF=E3=82=8B"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f4dd5a8a73955044516c52617264025067160d63. --- tests/client.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/client.py b/tests/client.py index a3328c7..13aea57 100644 --- a/tests/client.py +++ b/tests/client.py @@ -416,8 +416,6 @@ def _on_disconnect(self, error_code: SoraSignalingErrorCode, message: str) -> No if self._fake_video_thread is not None: self._fake_video_thread.join(timeout=10) - self._sora = None - def _on_ws_close(self, code: int, reason: str) -> None: print(f"WebSocket closed: code={code} reason={reason}") self._ws_close = True From 653b121985654e9a27fccf374eee084089e08efd Mon Sep 17 00:00:00 2001 From: melpon Date: Sun, 3 Nov 2024 14:07:32 +0900 Subject: [PATCH 28/32] =?UTF-8?q?=E5=AE=9F=E8=A1=8C=E5=9B=9E=E6=95=B0?= =?UTF-8?q?=E3=82=92=E5=A2=97=E3=82=84=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 2 +- .github/workflows/build-relwithdebinfo.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 6d7dbf9..7e8fd40 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -238,7 +238,7 @@ jobs: - name: E2E Test sora-python-sdk working-directory: sora-python-sdk run: | - for i in {1..10}; do + for i in {1..50}; do echo "---------------- $i 回目 ----------------" sleep 10 lldb-18 --batch -o 'command script import test_with_llvm.py' -o 'test' diff --git a/.github/workflows/build-relwithdebinfo.yml b/.github/workflows/build-relwithdebinfo.yml index 7e504d9..dfae6fd 100644 --- a/.github/workflows/build-relwithdebinfo.yml +++ b/.github/workflows/build-relwithdebinfo.yml @@ -183,7 +183,7 @@ jobs: - name: E2E Test sora-python-sdk working-directory: sora-python-sdk run: | - for i in {1..10}; do + for i in {1..50}; do echo "---------------- $i 回目 ----------------" sleep 10 lldb-18 --batch -o 'command script import test_with_llvm.py' -o 'test' From 91892cc31dcbe8869dea5dd5e9ef71707575a17e Mon Sep 17 00:00:00 2001 From: melpon Date: Sun, 3 Nov 2024 14:31:38 +0900 Subject: [PATCH 29/32] =?UTF-8?q?Python=20=E3=83=90=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=82=92=E5=A2=97=E3=82=84=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-relwithdebinfo.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-relwithdebinfo.yml b/.github/workflows/build-relwithdebinfo.yml index dfae6fd..b0e3da5 100644 --- a/.github/workflows/build-relwithdebinfo.yml +++ b/.github/workflows/build-relwithdebinfo.yml @@ -21,6 +21,11 @@ jobs: platform: - name: ubuntu-24.04_x86_64 runs-on: ubuntu-24.04 + python: + - version: 3.10 + - version: 3.11 + - version: 3.12 + - version: 3.13 runs-on: ${{ matrix.platform.runs-on }} steps: - name: Disk Cleanup @@ -118,7 +123,7 @@ jobs: sudo apt-get install -y software-properties-common # X11 - sudo apt-get install libx11-dev libxext-dev + sudo apt-get install -y libx11-dev libxext-dev # CUDA wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb @@ -134,6 +139,12 @@ jobs: if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' working-directory: sora-cpp-sdk run: python3 run.py --relwithdebinfo ${{ matrix.platform.name }} + - name: Teardown sora-cpp-sdk + if: steps.sora-cpp-sdk-cache.outputs.cache-hit != 'true' + run: | + # CUDA が入ってると使おうとしてエラーになるのでアンインストールしておく + sudo apt-get remove -y cuda + sudo apt-get autoremove -y # sora-python-sdk - name: Setup sora-python-sdk @@ -174,7 +185,7 @@ jobs: working-directory: sora-python-sdk run: | set -x - # uv python pin ${{ matrix.python_version }} + uv python pin ${{ matrix.python.version }} uv sync uv run python run.py --relwithdebinfo ${{ matrix.platform.name }} # cache From b8c9c3428e283c0c88f1f17d18a008513eb03ead Mon Sep 17 00:00:00 2001 From: melpon Date: Sun, 3 Nov 2024 17:54:53 +0900 Subject: [PATCH 30/32] =?UTF-8?q?YAML=20=E3=81=AE=E6=82=AA=E3=81=84?= =?UTF-8?q?=E3=81=A8=E3=81=93=E3=82=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 7 ++++++- .github/workflows/build-relwithdebinfo.yml | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 7e8fd40..1c4ee36 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -21,6 +21,11 @@ jobs: platform: - name: ubuntu-24.04_x86_64 runs-on: ubuntu-24.04 + python: + - version: "3.10" + - version: "3.11" + - version: "3.12" + - version: "3.13" runs-on: ${{ matrix.platform.runs-on }} steps: - name: Disk Cleanup @@ -229,7 +234,7 @@ jobs: working-directory: sora-python-sdk run: | set -x - # uv python pin ${{ matrix.python_version }} + uv python pin ${{ matrix.python.version }} uv sync uv run python run.py --debug ${{ matrix.platform.name }} # cache diff --git a/.github/workflows/build-relwithdebinfo.yml b/.github/workflows/build-relwithdebinfo.yml index b0e3da5..d399260 100644 --- a/.github/workflows/build-relwithdebinfo.yml +++ b/.github/workflows/build-relwithdebinfo.yml @@ -22,10 +22,10 @@ jobs: - name: ubuntu-24.04_x86_64 runs-on: ubuntu-24.04 python: - - version: 3.10 - - version: 3.11 - - version: 3.12 - - version: 3.13 + - version: "3.10" + - version: "3.11" + - version: "3.12" + - version: "3.13" runs-on: ${{ matrix.platform.runs-on }} steps: - name: Disk Cleanup From de43231475a542588cc93d9c4ffcd57094da53f6 Mon Sep 17 00:00:00 2001 From: melpon Date: Mon, 4 Nov 2024 04:59:41 +0900 Subject: [PATCH 31/32] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=83=A9=E3=82=AF=E3=82=BF=E3=81=8C=E5=91=BC=E3=81=B0=E3=82=8C?= =?UTF-8?q?=E3=82=8B=E5=89=8D=E3=81=AB=20tp=5Ftraverse=20=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C=E3=81=82=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sora_sdk_ext.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/sora_sdk_ext.cpp b/src/sora_sdk_ext.cpp index 41237dc..b08b029 100644 --- a/src/sora_sdk_ext.cpp +++ b/src/sora_sdk_ext.cpp @@ -30,6 +30,10 @@ using namespace nb::literals; * やっておかないと終了時にリークエラーが発生する。 */ int audio_sink_tp_traverse(PyObject* self, visitproc visit, void* arg) { + if (!nb::inst_ready(self)) { + return 0; + } + // インスタンスを取得する SoraAudioSinkImpl* audio_sink = nb::inst_ptr(self); @@ -51,6 +55,10 @@ int audio_sink_tp_traverse(PyObject* self, visitproc visit, void* arg) { } int audio_sink_tp_clear(PyObject* self) { + if (!nb::inst_ready(self)) { + return 0; + } + SoraAudioSinkImpl* audio_sink = nb::inst_ptr(self); audio_sink->on_format_ = nullptr; audio_sink->on_data_ = nullptr; @@ -67,6 +75,10 @@ PyType_Slot audio_sink_slots[] = { {0, nullptr}}; int audio_stream_sink_tp_traverse(PyObject* self, visitproc visit, void* arg) { + if (!nb::inst_ready(self)) { + return 0; + } + SoraAudioStreamSinkImpl* audio_sink = nb::inst_ptr(self); @@ -79,6 +91,10 @@ int audio_stream_sink_tp_traverse(PyObject* self, visitproc visit, void* arg) { } int audio_stream_sink_tp_clear(PyObject* self) { + if (!nb::inst_ready(self)) { + return 0; + } + SoraAudioStreamSinkImpl* audio_sink = nb::inst_ptr(self); audio_sink->on_frame_ = nullptr; @@ -91,6 +107,10 @@ PyType_Slot audio_stream_sink_slots[] = { {0, nullptr}}; int video_sink_tp_traverse(PyObject* self, visitproc visit, void* arg) { + if (!nb::inst_ready(self)) { + return 0; + } + SoraVideoSinkImpl* video_sink = nb::inst_ptr(self); if (video_sink->on_frame_) { @@ -102,6 +122,10 @@ int video_sink_tp_traverse(PyObject* self, visitproc visit, void* arg) { } int video_sink_tp_clear(PyObject* self) { + if (!nb::inst_ready(self)) { + return 0; + } + SoraVideoSinkImpl* video_sink = nb::inst_ptr(self); video_sink->on_frame_ = nullptr; return 0; @@ -115,6 +139,10 @@ PyType_Slot video_sink_slots[] = { int audio_frame_transformer_tp_traverse(PyObject* self, visitproc visit, void* arg) { + if (!nb::inst_ready(self)) { + return 0; + } + SoraAudioFrameTransformer* audio_frame_transformer = nb::inst_ptr(self); @@ -127,6 +155,10 @@ int audio_frame_transformer_tp_traverse(PyObject* self, } int audio_frame_transformer_tp_clear(PyObject* self) { + if (!nb::inst_ready(self)) { + return 0; + } + SoraAudioFrameTransformer* audio_frame_transformer = nb::inst_ptr(self); audio_frame_transformer->on_transform_ = nullptr; @@ -141,6 +173,10 @@ PyType_Slot audio_frame_transformer_slots[] = { int video_frame_transformer_tp_traverse(PyObject* self, visitproc visit, void* arg) { + if (!nb::inst_ready(self)) { + return 0; + } + SoraVideoFrameTransformer* video_frame_transformer = nb::inst_ptr(self); @@ -153,6 +189,10 @@ int video_frame_transformer_tp_traverse(PyObject* self, } int video_frame_transformer_tp_clear(PyObject* self) { + if (!nb::inst_ready(self)) { + return 0; + } + SoraVideoFrameTransformer* video_frame_transformer = nb::inst_ptr(self); video_frame_transformer->on_transform_ = nullptr; @@ -165,6 +205,10 @@ PyType_Slot video_frame_transformer_slots[] = { {0, nullptr}}; int connection_tp_traverse(PyObject* self, visitproc visit, void* arg) { + if (!nb::inst_ready(self)) { + return 0; + } + SoraConnection* conn = nb::inst_ptr(self); if (conn->on_set_offer_) { @@ -221,6 +265,10 @@ int connection_tp_traverse(PyObject* self, visitproc visit, void* arg) { } int connection_tp_clear(PyObject* self) { + if (!nb::inst_ready(self)) { + return 0; + } + SoraConnection* conn = nb::inst_ptr(self); conn->on_set_offer_ = nullptr; conn->on_ws_close_ = nullptr; From 072d2340d7585e96b7f888e82a299ad812d1a4a4 Mon Sep 17 00:00:00 2001 From: melpon Date: Mon, 4 Nov 2024 15:44:41 +0900 Subject: [PATCH 32/32] =?UTF-8?q?workflow=5Fdispatch=20=E3=81=AE=E3=81=BF?= =?UTF-8?q?=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-debug.yml | 11 ++++++----- .github/workflows/build-relwithdebinfo.yml | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-debug.yml b/.github/workflows/build-debug.yml index 1c4ee36..a1a5166 100644 --- a/.github/workflows/build-debug.yml +++ b/.github/workflows/build-debug.yml @@ -2,10 +2,11 @@ name: build-debug on: workflow_dispatch: - push: - paths-ignore: - - "examples/**" - - "**.md" + inputs: + loopCount: + required: true + type: number + defualt: 10 env: TEST_SIGNALING_URLS: ${{ secrets.TEST_SIGNALING_URLS }} @@ -243,7 +244,7 @@ jobs: - name: E2E Test sora-python-sdk working-directory: sora-python-sdk run: | - for i in {1..50}; do + for i in {1..${{ inputs.loopCount || 10 }}}; do echo "---------------- $i 回目 ----------------" sleep 10 lldb-18 --batch -o 'command script import test_with_llvm.py' -o 'test' diff --git a/.github/workflows/build-relwithdebinfo.yml b/.github/workflows/build-relwithdebinfo.yml index d399260..b5db9c3 100644 --- a/.github/workflows/build-relwithdebinfo.yml +++ b/.github/workflows/build-relwithdebinfo.yml @@ -2,10 +2,11 @@ name: build-relwithdebinfo on: workflow_dispatch: - push: - paths-ignore: - - "examples/**" - - "**.md" + inputs: + loopCount: + required: true + type: number + defualt: 10 env: TEST_SIGNALING_URLS: ${{ secrets.TEST_SIGNALING_URLS }} @@ -194,7 +195,7 @@ jobs: - name: E2E Test sora-python-sdk working-directory: sora-python-sdk run: | - for i in {1..50}; do + for i in {1..${{ inputs.loopCount || 10 }}}; do echo "---------------- $i 回目 ----------------" sleep 10 lldb-18 --batch -o 'command script import test_with_llvm.py' -o 'test'