From fe0bdbd1473fda4518f9b86b0bf0a52ac1b6c3a0 Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Sat, 2 Nov 2024 17:32:39 -0700 Subject: [PATCH] Add golang. Fix libdatachannel. --- .github/workflows/build.yaml | 403 ++++++----------- Justfile | 428 +++++++++--------- .../libdatachannel/src/impl/icetransport.cpp | 1 + 3 files changed, 361 insertions(+), 471 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0bc28f76..91169161 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,269 +1,140 @@ -name: Build Platform Target - -on: - push: - branches: [main] - pull_request: - branches: [main] - types: [opened, reopened, edited, synchronize] - -jobs: - build-native: - runs-on: macos-latest - permissions: - pull-requests: write - actions: write - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} - GODOT_BASE_BRANCH: main - CACHE_NAME: v-sekai-world - - strategy: - fail-fast: false - matrix: - precision: [single, double] - platform: [macos] - target: [editor, template_release, template_debug] - - concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }} - cancel-in-progress: true - - steps: - - name: Set up dependencies - run: brew install just hyperfine scons - - - name: Set up placeholders - run: | - mkdir -p godot/bin/ - mkdir -p tpz/ - mkdir -p editor - echo "This is the README for the Godot bin directory." > godot/bin/readme.md - echo "This is the README for the TPZ directory." > tpz/readme.md - echo "This is the README for the Editor directory." > editor/readme.md - - - name: Checkout code - uses: actions/checkout@v4 - - - name: Cache SCons cache - uses: actions/cache@v4 - if: always() - with: - path: | - .scons_cache - key: ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }} - restore-keys: | - ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }} - ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.target }} - ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }} - ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }} - ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-refs/heads/${{ env.GODOT_BASE_BRANCH }} - ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }} - - - uses: bencherdev/bencher@main - - - name: Fetch dependencies and Build Platform Target +name: Build Platform Target + +on: + push: + branches: [main] + pull_request: + branches: [main] + types: [opened, reopened, edited, synchronize] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + pull-requests: write + actions: write + container: + image: fedora:39 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} + GODOT_BASE_BRANCH: main + CACHE_NAME: v-sekai-world + + strategy: + fail-fast: false + matrix: + precision: [double] + platform: [macos] + target: [editor, template_release, template_debug] + + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }} + cancel-in-progress: true + + steps: + - name: Set up dependencies + run: dnf install -y just git + + - name: Set up placeholders run: | - export PLATFORM_ARGS="fetch-vulkan-sdk" - bencher run \ - --project 'v-sekai-world' \ - --adapter shell_hyperfine \ - --branch '${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}' \ - --testbed ubuntu-latest \ - --threshold-measure latency \ - --threshold-test t_test \ - --threshold-max-sample-size 64 \ - --threshold-upper-boundary 0.99 \ - --thresholds-reset \ - --ci-id ${{ runner.os }}-scons-${{ matrix.platform }}-${{ matrix.target }} \ - --err \ - --token '${{ secrets.BENCHER_API_TOKEN }}' \ - --github-actions '${{ secrets.GITHUB_TOKEN }}' \ - --ci-only-on-alert \ - --file results.json \ - "hyperfine --show-output --runs 1 --export-json results.json 'just $PLATFORM_ARGS && just build-platform-target ${{ matrix.platform }} ${{ matrix.target }} ${{ matrix.precision }}'" - - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: build-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }} - path: godot/bin/* - - - name: Upload TPZ File - uses: actions/upload-artifact@v4 - with: - name: Godot-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }}.tpz - path: tpz - - - name: Upload Godot Editor Files - uses: actions/upload-artifact@v4 - with: - name: Godot-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }} - path: editor - build: - runs-on: ubuntu-latest - permissions: - pull-requests: write - actions: write - container: - image: fedora:39 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} - GODOT_BASE_BRANCH: main - CACHE_NAME: v-sekai-world - - strategy: - fail-fast: false - matrix: - precision: [single, double] - platform: [linux, windows, android, web] - target: [editor, template_release, template_debug] - - concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }} - cancel-in-progress: true - - steps: - - name: Set up dependencies - run: dnf install -y just git - - - name: Set up placeholders - run: | - mkdir -p godot/bin/ - mkdir -p tpz/ - mkdir -p editor - echo "This is the README for the Godot bin directory." > godot/bin/readme.md - echo "This is the README for the TPZ directory." > tpz/readme.md - echo "This is the README for the Editor directory." > editor/readme.md - - - name: Checkout code - uses: actions/checkout@v4 - - - name: Cache SCons cache - uses: actions/cache@v4 - if: always() + mkdir -p godot/bin/ + mkdir -p tpz/ + mkdir -p editor + echo "This is the README for the Godot bin directory." > godot/bin/readme.md + echo "This is the README for the TPZ directory." > tpz/readme.md + echo "This is the README for the Editor directory." > editor/readme.md + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Cache SCons cache + uses: actions/cache@v4 + if: always() + with: + path: | + .scons_cache + emsdk + osxcross + jdk + android_sdk + vulkan_sdk + mingw + key: ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }} + restore-keys: | + ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }} + ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.target }} + ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }} + ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }} + ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-refs/heads/${{ env.GODOT_BASE_BRANCH }} + ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }} + + - name: Fetch dependencies and Build Platform Target + run: | + just install_packages + hyperfine --show-output --runs 1 'just $PLATFORM_ARGS && just build-platform-target ${{ matrix.platform }} ${{ matrix.target }} ${{ matrix.precision }}' + + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: build-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }} + path: godot/bin/* + + - name: Upload TPZ File + uses: actions/upload-artifact@v4 + with: + name: Godot-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }}.tpz + path: tpz + + - name: Upload Godot Editor Files + uses: actions/upload-artifact@v4 + with: + name: Godot-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }} + path: editor + + merge: + runs-on: ubuntu-latest + needs: ["build"] + steps: + - name: Merge Artifacts + uses: actions/upload-artifact/merge@v4 with: - path: | - .scons_cache - emsdk - osxcross - jdk - android_sdk - vulkan_sdk - mingw - key: ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }} - restore-keys: | - ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }} - ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.target }} - ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }} - ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }} - ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-refs/heads/${{ env.GODOT_BASE_BRANCH }} - ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }} - - - uses: bencherdev/bencher@main - - - name: Fetch dependencies and Build Platform Target + name: v-sekai-world + delete-merged: true + + release: + runs-on: ubuntu-latest + needs: merge + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + steps: + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: latest.v-sekai-editor-${{ github.run_number }} + release_name: Latest Release of V-Sekai Godot Engine Editor + draft: false + prerelease: true + + - name: Download Artifacts + uses: actions/download-artifact@v4 + with: + path: v-sekai-world + name: v-sekai-world + + - name: Zip Artifacts run: | - just install_packages - export PLATFORM_ARGS="" - case "${{ matrix.platform }}" in - android) - PLATFORM_ARGS="fetch-openjdk setup-android-sdk" - ;; - web) - PLATFORM_ARGS="setup-emscripten" - ;; - windows) - PLATFORM_ARGS="fetch-llvm-mingw" - ;; - macos) - PLATFORM_ARGS="build-osxcross fetch-vulkan-sdk" - ;; - *) - PLATFORM_ARGS="nil" - ;; - esac - bencher run \ - --project 'v-sekai-world' \ - --adapter shell_hyperfine \ - --branch '${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}' \ - --testbed ubuntu-latest \ - --threshold-measure latency \ - --threshold-test t_test \ - --threshold-max-sample-size 64 \ - --threshold-upper-boundary 0.99 \ - --thresholds-reset \ - --ci-id ${{ runner.os }}-scons-${{ matrix.platform }}-${{ matrix.target }} \ - --err \ - --token '${{ secrets.BENCHER_API_TOKEN }}' \ - --github-actions '${{ secrets.GITHUB_TOKEN }}' \ - --ci-only-on-alert \ - --file results.json \ - "hyperfine --show-output --runs 1 --export-json results.json 'just $PLATFORM_ARGS && just build-platform-target ${{ matrix.platform }} ${{ matrix.target }} ${{ matrix.precision }}'" - - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: build-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }} - path: godot/bin/* - - - name: Upload TPZ File - uses: actions/upload-artifact@v4 - with: - name: Godot-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }}.tpz - path: tpz - - - name: Upload Godot Editor Files - uses: actions/upload-artifact@v4 - with: - name: Godot-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }} - path: editor - - merge: - runs-on: ubuntu-latest - needs: ["build", "build-native"] - steps: - - name: Merge Artifacts - uses: actions/upload-artifact/merge@v4 - with: - name: v-sekai-world - delete-merged: true - - release: - runs-on: ubuntu-latest - needs: merge - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - steps: - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: latest.v-sekai-editor-${{ github.run_number }} - release_name: Latest Release of V-Sekai Godot Engine Editor - draft: false - prerelease: true - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - path: v-sekai-world - name: v-sekai-world - - - name: Zip Artifacts - run: | - tree - zip -r v-sekai-world.zip v-sekai-world - - - name: Upload Release Asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./v-sekai-world.zip - asset_name: v-sekai-world.zip - asset_content_type: application/zip + tree + zip -r v-sekai-world.zip v-sekai-world + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./v-sekai-world.zip + asset_name: v-sekai-world.zip + asset_content_type: application/zip diff --git a/Justfile b/Justfile index 9de09491..3b53604e 100644 --- a/Justfile +++ b/Justfile @@ -1,205 +1,223 @@ -export RUST_LOG := "log" -export MVSQLITE_DATA_PLANE := "http://192.168.0.39:7000" -export OPERATING_SYSTEM := os() -export EDITOR_TYPE_COMMAND := "run-editor-$OPERATING_SYSTEM" -export PROJECT_PATH := "" # Can be empty - -export BUILD_COUNT := "001" -export DOCKER_GOCDA_AGENT_CENTOS_8_GROUPS_GIT := "abcdefgh" # Example hash -export GODOT_GROUPS_EDITOR_PIPELINE_DEPENDENCY := "dependency_name" - -export LABEL_TEMPLATE := "docker-gocd-agent-centos-8-groups_${DOCKER_GOCDA_AGENT_CENTOS_8_GROUPS_GIT:0:8}.$BUILD_COUNT" -export GROUPS_LABEL_TEMPLATE := "groups-4.3.$GODOT_GROUPS_EDITOR_PIPELINE_DEPENDENCY.$BUILD_COUNT" -export GODOT_STATUS := "groups-4.3" -export GIT_URL_DOCKER := "https://github.com/V-Sekai/docker-groups.git" -export GIT_URL_VSEKAI := "https://github.com/V-Sekai/v-sekai-game.git" -export WORLD_PWD := invocation_directory() -export ANDROID_NDK_VERSION := "23.2.8568313" -export cmdlinetools := "commandlinetools-linux-11076708_latest.zip" - -export SCONS_CACHE := WORLD_PWD + "/.scons_cache" -export ANDROID_SDK_ROOT := WORLD_PWD + "/android_sdk" -export JAVA_HOME := WORLD_PWD + "/jdk" -export VULKAN_SDK_ROOT := WORLD_PWD + "/vulkan_sdk/" -export EMSDK_ROOT := WORLD_PWD + "/emsdk" -export OSXCROSS_ROOT := WORLD_PWD + "/osxcross" -export MINGW_ROOT := WORLD_PWD + "/mingw" - -build-target-macos-editor-single: - @just build-platform-target macos editor single - -run-all: - just fetch-openjdk - just setup-android-sdk - just setup-emscripten - just fetch-llvm-mingw - just build-osxcross - just fetch-vulkan-sdk - just build-platform-target macos template_release - echo "run-all: Success!" - -fetch-llvm-mingw: - #!/usr/bin/env bash - if [ ! -d "${MINGW_ROOT}" ]; then - cd $WORLD_PWD - mkdir -p ${MINGW_ROOT} - curl -o llvm-mingw.tar.xz -L https://github.com/mstorsjo/llvm-mingw/releases/download/20240917/llvm-mingw-20240917-ucrt-ubuntu-20.04-x86_64.tar.xz - tar -xf llvm-mingw.tar.xz -C ${MINGW_ROOT} --strip 1 - rm -rf llvm-mingw.tar.xz - fi - -fetch-openjdk: - #!/usr/bin/env bash - if [ ! -d "${JAVA_HOME}" ]; then - curl --fail --location --silent --show-error "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11%2B9/OpenJDK17U-jdk_$(uname -m | sed -e s/86_//g)_linux_hotspot_17.0.11_9.tar.gz" --output jdk.tar.gz - mkdir -p {{JAVA_HOME}} - tar -xf jdk.tar.gz -C {{JAVA_HOME}} --strip 1 - rm -rf jdk.tar.gz - fi - -fetch-vulkan-sdk: - #!/usr/bin/env bash - if [ ! -d "${VULKAN_SDK_ROOT}" ]; then - curl -L "https://github.com/godotengine/moltenvk-osxcross/releases/download/vulkan-sdk-1.3.283.0-2/MoltenVK-all.tar" -o vulkan-sdk.zip - mkdir -p ${VULKAN_SDK_ROOT} - tar -xf vulkan-sdk.zip -C {{VULKAN_SDK_ROOT}} - rm vulkan-sdk.zip - fi - -setup-android-sdk: - #!/usr/bin/env bash - if [ ! -d "${ANDROID_SDK_ROOT}" ]; then - mkdir -p {{ANDROID_SDK_ROOT}} - if [ ! -d "{{WORLD_PWD}}/{{cmdlinetools}}" ]; then - curl -LO https://dl.google.com/android/repository/{{cmdlinetools}} -o {{WORLD_PWD}}/{{cmdlinetools}} - cd {{WORLD_PWD}} && unzip -o {{WORLD_PWD}}/{{cmdlinetools}} - rm {{WORLD_PWD}}/{{cmdlinetools}} - yes | {{WORLD_PWD}}/cmdline-tools/bin/sdkmanager --sdk_root={{ANDROID_SDK_ROOT}} --licenses - yes | {{WORLD_PWD}}/cmdline-tools/bin/sdkmanager --sdk_root={{ANDROID_SDK_ROOT}} "ndk;{{ANDROID_NDK_VERSION}}" 'cmdline-tools;latest' 'build-tools;34.0.0' 'platforms;android-34' 'cmake;3.22.1' - fi - fi -setup-rust: - #!/usr/bin/env bash - cd $WORLD_PWD - if [ ! -d "${RUST_ROOT}" ]; then - mkdir -p ${RUST_ROOT} - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly --no-modify-path - . "$HOME/.cargo/env" - rustup default nightly - rustup target add aarch64-linux-android x86_64-linux-android x86_64-unknown-linux-gnu aarch64-apple-ios x86_64-apple-ios x86_64-apple-darwin aarch64-apple-darwin x86_64-pc-windows-gnu x86_64-pc-windows-msvc wasm32-wasi - fi - -setup-emscripten: - #!/usr/bin/env bash - if [ ! -d "${EMSDK_ROOT}" ]; then - git clone https://github.com/emscripten-core/emsdk.git $EMSDK_ROOT - cd $EMSDK_ROOT - ./emsdk install 3.1.67 - ./emsdk activate 3.1.67 - fi - -deploy_osxcross: - #!/usr/bin/env bash - git clone https://github.com/tpoechtrager/osxcross.git || true - cd osxcross - ./tools/gen_sdk_package.sh - -build-osxcross: - #!/usr/bin/env bash - if [ ! -d "${OSXCROSS_ROOT}" ]; then - git clone https://github.com/tpoechtrager/osxcross.git - curl -o $OSXCROSS_ROOT/tarballs/MacOSX15.0.sdk.tar.xz -L https://github.com/V-Sekai/world/releases/download/v0.0.1/MacOSX15.0.sdk.tar.xz - ls -l $OSXCROSS_ROOT/tarballs/ - cd $OSXCROSS_ROOT && UNATTENDED=1 ./build.sh && ./build_compiler_rt.sh - fi - -nil: - echo "nil: Suceeded." - -install_packages: - dnf install -y hyperfine vulkan xz gcc gcc-c++ zlib-devel libmpc-devel mpfr-devel gmp-devel clang just parallel scons mold pkgconfig libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel libXi-devel wayland-devel mesa-libGL-devel mesa-libGLU-devel alsa-lib-devel pulseaudio-libs-devel libudev-devel libstdc++-static libatomic-static cmake ccache patch libxml2-devel openssl openssl-devel git unzip - -copy_binaries: - cp templates/windows_release_x86_64.exe export_windows/v_sekai_windows.exe - cp templates/linux_release.x86_64 export_linuxbsd/v_sekai_linuxbsd - -prepare_exports: - rm -rf export_windows export_linuxbsd - mkdir export_windows export_linuxbsd - -generate_build_constants: - echo "## AUTOGENERATED BY BUILD" > v/addons/vsk_version/build_constants.gd - echo "" >> v/addons/vsk_version/build_constants.gd - echo "const BUILD_LABEL = \"$GROUPS_LABEL_TEMPLATE\"" >> v/addons/vsk_version/build_constants.gd - echo "const BUILD_DATE_STR = \"$(shell date --utc --iso=seconds)\"" >> v/addons/vsk_version/build_constants.gd - echo "const BUILD_UNIX_TIME = $(shell date +%s)" >> v/addons/vsk_version/build_constants.gd - - -build-platform-target platform target precision="double": - #!/usr/bin/env bash - cd $WORLD_PWD - export PATH=$MINGW_ROOT/bin:$PATH - export PATH=$OSXCROSS_ROOT/target/bin/:$PATH - source "$EMSDK_ROOT/emsdk_env.sh" - cd godot - export EXTRA_FLAGS="" - case "{{platform}}" in \ - macos) \ - EXTRA_FLAGS="vulkan=yes arch=arm64 werror=no vulkan_sdk_path=$VULKAN_SDK_ROOT/MoltenVK/MoltenVK/static/MoltenVK.xcframework osxcross_sdk=darwin24 generate_bundle=yes" - if [ "$(uname)" = "Darwin" ]; then - unset OSXCROSS_ROOT - fi - ;; - web) - EXTRA_FLAGS="dlink_enabled=yes" - ;; - *) - EXTRA_FLAGS="use_llvm=yes use_mingw=yes" - ;; - esac - scons platform={{platform}} \ - werror=no \ - compiledb=yes \ - precision={{precision}} \ - target={{target}} \ - test=yes \ - debug_symbol=yes \ - $EXTRA_FLAGS - just handle-special-cases {{platform}} {{target}} - if [[ "{{target}}" == "editor" ]]; then - mkdir -p $WORLD_PWD/editors - cp -rf $WORLD_PWD/godot/bin/* $WORLD_PWD/editors - elif [[ "{{target}}" =~ template_* ]]; then - mkdir -p $WORLD_PWD/tpz - cp -rf $WORLD_PWD/godot/bin/* $WORLD_PWD/tpz - fi - -all-build-platform-target: - #!/usr/bin/env bash - parallel --ungroup --jobs 1 'just build-platform-target {1} {2}' \ - ::: windows linux macos android web \ - ::: editor template_debug template_release - -handle-special-cases platform target: - #!/usr/bin/env bash - case "{{platform}}" in \ - android) \ - just handle-android {{target}} \ - ;; - esac - -handle-android target: - #!/usr/bin/env bash - cd godot - if [ "{{target}}" = "editor" ]; then - cd platform/android/java - ./gradlew generateGodotEditor - ./gradlew generateGodotHorizonOSEditor - cd ../../.. - ls -l bin/android_editor_builds/ - elif [ "{{target}}" = "template_release" ] || [ "{{target}}" = "template_debug" ]; then - cd platform/android/java - ./gradlew generateGodotTemplates - cd ../../.. - ls -l bin/ - fi +export RUST_LOG := "log" +export MVSQLITE_DATA_PLANE := "http://192.168.0.39:7000" +export OPERATING_SYSTEM := os() +export EDITOR_TYPE_COMMAND := "run-editor-$OPERATING_SYSTEM" +export PROJECT_PATH := "" # Can be empty + +export BUILD_COUNT := "001" +export DOCKER_GOCDA_AGENT_CENTOS_8_GROUPS_GIT := "abcdefgh" # Example hash +export GODOT_GROUPS_EDITOR_PIPELINE_DEPENDENCY := "dependency_name" + +export LABEL_TEMPLATE := "docker-gocd-agent-centos-8-groups_${DOCKER_GOCDA_AGENT_CENTOS_8_GROUPS_GIT:0:8}.$BUILD_COUNT" +export GROUPS_LABEL_TEMPLATE := "groups-4.3.$GODOT_GROUPS_EDITOR_PIPELINE_DEPENDENCY.$BUILD_COUNT" +export GODOT_STATUS := "groups-4.3" +export GIT_URL_DOCKER := "https://github.com/V-Sekai/docker-groups.git" +export GIT_URL_VSEKAI := "https://github.com/V-Sekai/v-sekai-game.git" +export WORLD_PWD := invocation_directory() +export ANDROID_NDK_VERSION := "23.2.8568313" +export cmdlinetools := "commandlinetools-linux-11076708_latest.zip" + +export SCONS_CACHE := WORLD_PWD + "/.scons_cache" +export ANDROID_SDK_ROOT := WORLD_PWD + "/android_sdk" +export JAVA_HOME := WORLD_PWD + "/jdk" +export VULKAN_SDK_ROOT := WORLD_PWD + "/vulkan_sdk/" +export EMSDK_ROOT := WORLD_PWD + "/emsdk" +export MINGW_ROOT := WORLD_PWD + "/mingw" +export OSXCROSS_ROOT := WORLD_PWD + "/osxcross" + +build-target-macos-editor-single: + @just build-platform-target macos editor single + +fetch-llvm-mingw: + #!/usr/bin/env bash + if [ ! -d "${MINGW_ROOT}" ]; then + cd $WORLD_PWD + mkdir -p ${MINGW_ROOT} + curl -o llvm-mingw.tar.xz -L https://github.com/mstorsjo/llvm-mingw/releases/download/20240917/llvm-mingw-20240917-ucrt-ubuntu-20.04-x86_64.tar.xz + tar -xf llvm-mingw.tar.xz -C ${MINGW_ROOT} --strip 1 + rm -rf llvm-mingw.tar.xz + fi + +fetch-openjdk: + #!/usr/bin/env bash + if [ ! -d "${JAVA_HOME}" ]; then + curl --fail --location --silent --show-error "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11%2B9/OpenJDK17U-jdk_$(uname -m | sed -e s/86_//g)_linux_hotspot_17.0.11_9.tar.gz" --output jdk.tar.gz + mkdir -p {{JAVA_HOME}} + tar -xf jdk.tar.gz -C {{JAVA_HOME}} --strip 1 + rm -rf jdk.tar.gz + fi + +fetch-vulkan-sdk: + #!/usr/bin/env bash + if [ ! -d "${VULKAN_SDK_ROOT}" ]; then + curl -L "https://github.com/godotengine/moltenvk-osxcross/releases/download/vulkan-sdk-1.3.283.0-2/MoltenVK-all.tar" -o vulkan-sdk.zip + mkdir -p ${VULKAN_SDK_ROOT} + tar -xf vulkan-sdk.zip -C {{VULKAN_SDK_ROOT}} + rm vulkan-sdk.zip + fi + +setup-android-sdk: + #!/usr/bin/env bash + if [ ! -d "${ANDROID_SDK_ROOT}" ]; then + mkdir -p {{ANDROID_SDK_ROOT}} + if [ ! -d "{{WORLD_PWD}}/{{cmdlinetools}}" ]; then + curl -LO https://dl.google.com/android/repository/{{cmdlinetools}} -o {{WORLD_PWD}}/{{cmdlinetools}} + cd {{WORLD_PWD}} && unzip -o {{WORLD_PWD}}/{{cmdlinetools}} + rm {{WORLD_PWD}}/{{cmdlinetools}} + yes | {{WORLD_PWD}}/cmdline-tools/bin/sdkmanager --sdk_root={{ANDROID_SDK_ROOT}} --licenses + yes | {{WORLD_PWD}}/cmdline-tools/bin/sdkmanager --sdk_root={{ANDROID_SDK_ROOT}} "ndk;{{ANDROID_NDK_VERSION}}" 'cmdline-tools;latest' 'build-tools;34.0.0' 'platforms;android-34' 'cmake;3.22.1' + fi + fi +setup-rust: + #!/usr/bin/env bash + cd $WORLD_PWD + if [ ! -d "${RUST_ROOT}" ]; then + mkdir -p ${RUST_ROOT} + curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly --no-modify-path + . "$HOME/.cargo/env" + rustup default nightly + rustup target add aarch64-linux-android x86_64-linux-android x86_64-unknown-linux-gnu aarch64-apple-ios x86_64-apple-ios x86_64-apple-darwin aarch64-apple-darwin x86_64-pc-windows-gnu x86_64-pc-windows-msvc wasm32-wasi + fi + +setup-emscripten: + #!/usr/bin/env bash + if [ ! -d "${EMSDK_ROOT}" ]; then + git clone https://github.com/emscripten-core/emsdk.git $EMSDK_ROOT + cd $EMSDK_ROOT + ./emsdk install 3.1.67 + ./emsdk activate 3.1.67 + fi + +deploy_osxcross: + #!/usr/bin/env bash + git clone https://github.com/tpoechtrager/osxcross.git || true + cd osxcross + ./tools/gen_sdk_package.sh + +build-osxcross: + #!/usr/bin/env bash + if [ ! -d "$OSXCROSS_ROOT" ]; then + # Clone the osxcross repository + git clone https://github.com/tpoechtrager/osxcross.git $OSXCROSS_ROOT + # Download MacOSX15.0.sdk.tar.xz + curl -o $OSXCROSS_ROOT/tarballs/MacOSX15.0.sdk.tar.xz -L https://github.com/V-Sekai/world/releases/download/v0.0.1/MacOSX15.0.sdk.tar.xz + # List contents of tarballs directory to verify download + ls -l $OSXCROSS_ROOT/tarballs/ + cd $OSXCROSS_ROOT + UNATTENDED=1 ./build.sh && ./build_compiler_rt.sh + else + echo "osxcross already exists, skipping build." + fi +nil: + echo "nil: Suceeded." + +install_packages: + dnf install -y golang hyperfine vulkan xz gcc gcc-c++ zlib-devel libmpc-devel mpfr-devel gmp-devel clang just parallel scons mold pkgconfig libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel libXi-devel wayland-devel mesa-libGL-devel mesa-libGLU-devel alsa-lib-devel pulseaudio-libs-devel libudev-devel libstdc++-static libatomic-static cmake ccache patch libxml2-devel openssl openssl-devel git unzip + +copy_binaries: + cp templates/windows_release_x86_64.exe export_windows/v_sekai_windows.exe + cp templates/linux_release.x86_64 export_linuxbsd/v_sekai_linuxbsd + +prepare_exports: + rm -rf export_windows export_linuxbsd + mkdir export_windows export_linuxbsd + +generate_build_constants: + echo "## AUTOGENERATED BY BUILD" > v/addons/vsk_version/build_constants.gd + echo "" >> v/addons/vsk_version/build_constants.gd + echo "const BUILD_LABEL = \"$GROUPS_LABEL_TEMPLATE\"" >> v/addons/vsk_version/build_constants.gd + echo "const BUILD_DATE_STR = \"$(shell date --utc --iso=seconds)\"" >> v/addons/vsk_version/build_constants.gd + echo "const BUILD_UNIX_TIME = $(shell date +%s)" >> v/addons/vsk_version/build_constants.gd + +build-platform-target platform target precision="double": + #!/usr/bin/env bash + cd $WORLD_PWD + export EXTRA_FLAGS="" + case "{{platform}}" in + windows) + @just fetch-llvm-mingw + export PATH=$MINGW_ROOT/bin:$PATH + EXTRA_FLAGS="use_llvm=yes use_mingw=yes" + ;; + web) + @just setup-emscripten + source "$EMSDK_ROOT/emsdk_env.sh" + ;; + linuxbsd) + @just setup-emscripten + source "$EMSDK_ROOT/emsdk_env.sh" + ;; + linux) + @just setup-emscripten + source "$EMSDK_ROOT/emsdk_env.sh" + ;; + android) + @just fetch-openjdk setup-android-sdk + ;; + macos) + export PATH=$OSXCROSS_ROOT/target/bin/:$PATH + just build-osxcross fetch-vulkan-sdk + EXTRA_FLAGS="vulkan=no arch=arm64 werror=no vulkan_sdk_path=$VULKAN_SDK_ROOT/MoltenVK/MoltenVK/static/MoltenVK.xcframework osxcross_sdk=darwin24 generate_bundle=yes" + if [ "$(uname)" = "Darwin" ]; then + unset OSXCROSS_ROOT + fi + ;; + web) + EXTRA_FLAGS="dlink_enabled=yes" + ;; + *) + echo "Invalid option" + exit 1 + ;; + esac + cd $WORLD_PWD/godot + scons platform={{platform}} \ + werror=no \ + compiledb=yes \ + precision={{precision}} \ + target={{target}} \ + test=yes \ + debug_symbol=yes \ + $EXTRA_FLAGS + just handle-special-cases {{platform}} {{target}} + + case "{{target}}" in + editor) + mkdir -p $WORLD_PWD/editors + cp -rf $WORLD_PWD/godot/bin/* $WORLD_PWD/editors + ;; + template_*) + mkdir -p $WORLD_PWD/tpz + cp -rf $WORLD_PWD/godot/bin/* $WORLD_PWD/tpz + ;; + esac + +all-build-platform-target: + #!/usr/bin/env bash + parallel --ungroup --jobs 1 'just build-platform-target {1} {2}' \ + ::: windows linux macos android web \ + ::: editor template_debug template_release + +handle-special-cases platform target: + #!/usr/bin/env bash + case "{{platform}}" in \ + android) \ + just handle-android {{target}} \ + ;; + esac + +handle-android target: + #!/usr/bin/env bash + cd godot + if [ "{{target}}" = "editor" ]; then + cd platform/android/java + ./gradlew generateGodotEditor + ./gradlew generateGodotHorizonOSEditor + cd ../../.. + ls -l bin/android_editor_builds/ + elif [ "{{target}}" = "template_release" ] || [ "{{target}}" = "template_debug" ]; then + cd platform/android/java + ./gradlew generateGodotTemplates + cd ../../.. + ls -l bin/ + fi diff --git a/godot/thirdparty/libdatachannel/src/impl/icetransport.cpp b/godot/thirdparty/libdatachannel/src/impl/icetransport.cpp index d311dc6f..f023a4cc 100644 --- a/godot/thirdparty/libdatachannel/src/impl/icetransport.cpp +++ b/godot/thirdparty/libdatachannel/src/impl/icetransport.cpp @@ -12,6 +12,7 @@ #include "transport.hpp" #include "utils.hpp" +#include #include #include #include