From ba8976de9541751362fd33abb1af0219d23d58b7 Mon Sep 17 00:00:00 2001 From: Junrou Nishida Date: Sat, 11 Oct 2025 21:13:24 +0900 Subject: [PATCH 1/3] build: upgrade unity to support NDK23+ --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .../ISSUE_TEMPLATE/build-install-issue.yml | 2 +- .github/ISSUE_TEMPLATE/support.yml | 2 +- .github/workflows/linux-test.yml | 4 +- .github/workflows/macos-test.yml | 4 +- .github/workflows/package.yml | 1 + .github/workflows/windows-test.yml | 4 +- Assets/Plugins/Android/mainTemplate.gradle | 81 ++++++++++++++++++- Packages/manifest.json | 20 ++--- Packages/packages-lock.json | 55 +++++++------ ProjectSettings/ProjectVersion.txt | 4 +- 11 files changed, 131 insertions(+), 48 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index f1e220031..ce2721c73 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -24,7 +24,7 @@ body: id: unity_version attributes: label: Unity Version - placeholder: 6000.0.33f1 + placeholder: 6000.0.58f2 validations: required: true diff --git a/.github/ISSUE_TEMPLATE/build-install-issue.yml b/.github/ISSUE_TEMPLATE/build-install-issue.yml index bb217da4a..413b692b2 100644 --- a/.github/ISSUE_TEMPLATE/build-install-issue.yml +++ b/.github/ISSUE_TEMPLATE/build-install-issue.yml @@ -24,7 +24,7 @@ body: id: unity_version attributes: label: Unity Version - placeholder: 6000.0.33f1 + placeholder: 6000.0.58f2 validations: required: true diff --git a/.github/ISSUE_TEMPLATE/support.yml b/.github/ISSUE_TEMPLATE/support.yml index fba2a87cd..ad9f49a86 100644 --- a/.github/ISSUE_TEMPLATE/support.yml +++ b/.github/ISSUE_TEMPLATE/support.yml @@ -25,7 +25,7 @@ body: id: unity_version attributes: label: Unity Version - placeholder: 6000.0.33f1 + placeholder: 6000.0.58f2 validations: required: true diff --git a/.github/workflows/linux-test.yml b/.github/workflows/linux-test.yml index 211176b16..dbe0860aa 100644 --- a/.github/workflows/linux-test.yml +++ b/.github/workflows/linux-test.yml @@ -106,8 +106,8 @@ jobs: os: - ubuntu-24.04 unityVersion: - - 6000.0.33f1 - - 2022.3.55f1 + - 6000.0.33f1 # FIXME: use >= 6000.0.58f2 + - 2022.3.55f1 # FIXME: use >= 2022.3.62f2 steps: - name: Install UnityEditor run: | diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index 0911facdc..1d2245b64 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -98,8 +98,8 @@ jobs: os: - macos-13 unity: - - { version: "6000.0.33f1", changeset: "433b0a79340b" } - - { version: "2022.3.55f1", changeset: "9f374180d209" } + - { version: "6000.0.33f1", changeset: "433b0a79340b" } # FIXME: use >= 6000.0.58f2 + - { version: "2022.3.55f1", changeset: "9f374180d209" } # FIXME: use >= 2022.3.62f2 steps: - name: Install UnityEditor run: | diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 76d280099..d40c3cee0 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -218,6 +218,7 @@ jobs: - name: Install UnityEditor if: ${{ env.BUILD_UNITYPACKAGE == '1' }} run: | + # FIXME: use >= 6000.0.58f2 sudo docker cp $(docker create --rm unityci/editor:6000.0.33f1-base-3):/opt/unity /opt/unity sudo chown -R $(id -u):$(id -g) /opt/unity diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index 8cdb5e12a..7bb98d9cd 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -92,8 +92,8 @@ jobs: os: - windows-2022 unity: - - { version: "6000.0.33f1", changeset: "433b0a79340b" } - - { version: "2022.3.55f1", changeset: "9f374180d209" } + - { version: "6000.0.33f1", changeset: "433b0a79340b" } # FIXME: use >= 6000.0.58f2 + - { version: "2022.3.55f1", changeset: "9f374180d209" } # FIXME: use >= 2022.3.62f2 steps: - name: Install UnityHub uses: crazy-max/ghaction-chocolatey@v3 diff --git a/Assets/Plugins/Android/mainTemplate.gradle b/Assets/Plugins/Android/mainTemplate.gradle index 579cdf7e3..d7eeabdd7 100644 --- a/Assets/Plugins/Android/mainTemplate.gradle +++ b/Assets/Plugins/Android/mainTemplate.gradle @@ -42,10 +42,83 @@ android { }**PACKAGING** // Include libc++_shared.so - task copyLibcppShared(type: Copy) { - def ndkDir = android.ndkDirectory - from("$ndkDir/sources/cxx-stl/llvm-libc++/libs") { include '**/libc++_shared.so' } - into("$projectDir/src/main/jniLibs") + task copyLibcppShared { + doLast { + def ndkDir = android.ndkDirectory + def abiFilters = android.defaultConfig.ndk.abiFilters + def destDir = file("$projectDir/src/main/jniLibs") + + // Mapping from ABI to architecture triple (for NDK 23+) + def abiToTriple = [ + 'arm64-v8a': 'aarch64-linux-android', + 'armeabi-v7a': 'arm-linux-androideabi', + 'x86': 'i686-linux-android', + 'x86_64': 'x86_64-linux-android', + 'riscv64': 'riscv64-linux-android' + ] + + // Find the prebuilt directory (usually there's only one) + def prebuiltDir = null + def prebuiltBase = file("$ndkDir/toolchains/llvm/prebuilt") + if (prebuiltBase.exists()) { + def prebuiltDirs = prebuiltBase.listFiles()?.findAll { it.isDirectory() } + if (prebuiltDirs && prebuiltDirs.size() > 0) { + prebuiltDir = prebuiltDirs[0] + } + } + + abiFilters.each { abi -> + def copied = false + + // Try NDK 23+ path first + if (prebuiltDir != null) { + def triple = abiToTriple[abi] + if (triple != null) { + def libcppPath = file("$prebuiltDir/sysroot/usr/lib/$triple/libc++_shared.so") + if (libcppPath.exists()) { + def destAbiDir = file("$destDir/$abi") + copy { + from libcppPath + into destAbiDir + } + copied = true + } + } + } + + // Fallback to old NDK path (NDK 22 and earlier) + if (!copied) { + def libcppPath = file("$ndkDir/sources/cxx-stl/llvm-libc++/libs/$abi/libc++_shared.so") + if (libcppPath.exists()) { + def destAbiDir = file("$destDir/$abi") + copy { + from libcppPath + into destAbiDir + } + copied = true + } + } + + if (!copied) { + logger.warn("Could not find libc++_shared.so for $abi in NDK") + } + } + } + } + + task cleanCopyLibcppShared { + doLast { + def destDir = file("$projectDir/src/main/jniLibs") + def abiFilters = android.defaultConfig.ndk.abiFilters + + abiFilters.each { abi -> + def libcppFile = file("$destDir/$abi/libc++_shared.so") + if (libcppFile.exists()) { + libcppFile.delete() + println "Deleted libc++_shared.so for $abi" + } + } + } } clean.dependsOn 'cleanCopyLibcppShared' diff --git a/Packages/manifest.json b/Packages/manifest.json index 73a42f78f..28444b0db 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,22 +1,22 @@ { "dependencies": { - "com.unity.2d.animation": "10.1.4", + "com.unity.2d.animation": "10.2.1", "com.unity.2d.pixel-perfect": "5.0.3", - "com.unity.2d.psdimporter": "9.0.3", + "com.unity.2d.psdimporter": "9.1.0", "com.unity.2d.sprite": "1.0.0", "com.unity.2d.spriteshape": "10.0.7", "com.unity.2d.tilemap": "1.0.0", - "com.unity.ai.navigation": "2.0.5", - "com.unity.collab-proxy": "2.6.0", - "com.unity.ide.rider": "3.0.31", - "com.unity.ide.visualstudio": "2.0.22", + "com.unity.ai.navigation": "2.0.9", + "com.unity.collab-proxy": "2.9.3", + "com.unity.ide.rider": "3.0.38", + "com.unity.ide.visualstudio": "2.0.23", "com.unity.mathematics": "1.3.2", - "com.unity.memoryprofiler": "1.1.1", + "com.unity.memoryprofiler": "1.1.8", "com.unity.multiplayer.center": "1.0.0", - "com.unity.settings-manager": "2.0.1", - "com.unity.test-framework": "1.4.5", + "com.unity.settings-manager": "2.1.0", + "com.unity.test-framework": "1.5.1", "com.unity.testtools.codecoverage": "1.2.6", - "com.unity.timeline": "1.8.7", + "com.unity.timeline": "1.8.9", "com.unity.toolchain.linux-x86_64": "2.0.10", "com.unity.toolchain.macos-x86_64-linux-x86_64": "2.0.10", "com.unity.ugui": "2.0.0", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index e581bfc23..62124c9a6 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -10,11 +10,11 @@ } }, "com.unity.2d.animation": { - "version": "10.1.4", + "version": "10.2.1", "depth": 0, "source": "registry", "dependencies": { - "com.unity.2d.common": "9.0.7", + "com.unity.2d.common": "9.1.1", "com.unity.2d.sprite": "1.0.0", "com.unity.collections": "1.2.4", "com.unity.modules.animation": "1.0.0", @@ -23,7 +23,7 @@ "url": "https://packages.unity.com" }, "com.unity.2d.common": { - "version": "9.0.7", + "version": "9.1.1", "depth": 1, "source": "registry", "dependencies": { @@ -43,11 +43,11 @@ "url": "https://packages.unity.com" }, "com.unity.2d.psdimporter": { - "version": "9.0.3", + "version": "9.1.0", "depth": 0, "source": "registry", "dependencies": { - "com.unity.2d.common": "9.0.4", + "com.unity.2d.common": "9.1.1", "com.unity.2d.sprite": "1.0.0" }, "url": "https://packages.unity.com" @@ -79,7 +79,7 @@ } }, "com.unity.ai.navigation": { - "version": "2.0.5", + "version": "2.0.9", "depth": 0, "source": "registry", "dependencies": { @@ -88,8 +88,8 @@ "url": "https://packages.unity.com" }, "com.unity.burst": { - "version": "1.8.18", - "depth": 2, + "version": "1.8.24", + "depth": 1, "source": "registry", "dependencies": { "com.unity.mathematics": "1.2.1", @@ -98,7 +98,7 @@ "url": "https://packages.unity.com" }, "com.unity.collab-proxy": { - "version": "2.6.0", + "version": "2.9.3", "depth": 0, "source": "registry", "dependencies": {}, @@ -126,12 +126,11 @@ "com.unity.ext.nunit": { "version": "2.0.5", "depth": 1, - "source": "registry", - "dependencies": {}, - "url": "https://packages.unity.com" + "source": "builtin", + "dependencies": {} }, "com.unity.ide.rider": { - "version": "3.0.31", + "version": "3.0.38", "depth": 0, "source": "registry", "dependencies": { @@ -140,7 +139,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.visualstudio": { - "version": "2.0.22", + "version": "2.0.23", "depth": 0, "source": "registry", "dependencies": { @@ -156,10 +155,14 @@ "url": "https://packages.unity.com" }, "com.unity.memoryprofiler": { - "version": "1.1.1", + "version": "1.1.8", "depth": 0, "source": "registry", "dependencies": { + "com.unity.burst": "1.8.0", + "com.unity.collections": "1.2.3", + "com.unity.mathematics": "1.2.1", + "com.unity.profiling.core": "1.0.0", "com.unity.editorcoroutines": "1.0.0" }, "url": "https://packages.unity.com" @@ -179,8 +182,15 @@ "dependencies": {}, "url": "https://packages.unity.com" }, + "com.unity.profiling.core": { + "version": "1.0.2", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, "com.unity.settings-manager": { - "version": "2.0.1", + "version": "2.1.0", "depth": 0, "source": "registry", "dependencies": {}, @@ -203,22 +213,21 @@ "url": "https://packages.unity.com" }, "com.unity.test-framework": { - "version": "1.4.5", + "version": "1.5.1", "depth": 0, - "source": "registry", + "source": "builtin", "dependencies": { "com.unity.ext.nunit": "2.0.3", "com.unity.modules.imgui": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0" - }, - "url": "https://packages.unity.com" + } }, "com.unity.test-framework.performance": { - "version": "3.0.3", + "version": "3.1.0", "depth": 2, "source": "registry", "dependencies": { - "com.unity.test-framework": "1.1.31", + "com.unity.test-framework": "1.1.33", "com.unity.modules.jsonserialize": "1.0.0" }, "url": "https://packages.unity.com" @@ -234,7 +243,7 @@ "url": "https://packages.unity.com" }, "com.unity.timeline": { - "version": "1.8.7", + "version": "1.8.9", "depth": 0, "source": "registry", "dependencies": { diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index d5ce6c02a..0faef8df9 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 6000.0.33f1 -m_EditorVersionWithRevision: 6000.0.33f1 (433b0a79340b) +m_EditorVersion: 6000.0.58f2 +m_EditorVersionWithRevision: 6000.0.58f2 (92dee566b325) From 36cfc17edd1e585c780bc10a3f2e8e2df80aea5f Mon Sep 17 00:00:00 2001 From: Junrou Nishida Date: Sun, 12 Oct 2025 11:04:20 +0900 Subject: [PATCH 2/3] build: remove unused 2d dependencies --- Packages/manifest.json | 6 ---- Packages/packages-lock.json | 69 ------------------------------------- 2 files changed, 75 deletions(-) diff --git a/Packages/manifest.json b/Packages/manifest.json index 28444b0db..dad004db3 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,11 +1,5 @@ { "dependencies": { - "com.unity.2d.animation": "10.2.1", - "com.unity.2d.pixel-perfect": "5.0.3", - "com.unity.2d.psdimporter": "9.1.0", - "com.unity.2d.sprite": "1.0.0", - "com.unity.2d.spriteshape": "10.0.7", - "com.unity.2d.tilemap": "1.0.0", "com.unity.ai.navigation": "2.0.9", "com.unity.collab-proxy": "2.9.3", "com.unity.ide.rider": "3.0.38", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 62124c9a6..687d8edf1 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -9,75 +9,6 @@ "com.unity.test-framework": "1.0.0" } }, - "com.unity.2d.animation": { - "version": "10.2.1", - "depth": 0, - "source": "registry", - "dependencies": { - "com.unity.2d.common": "9.1.1", - "com.unity.2d.sprite": "1.0.0", - "com.unity.collections": "1.2.4", - "com.unity.modules.animation": "1.0.0", - "com.unity.modules.uielements": "1.0.0" - }, - "url": "https://packages.unity.com" - }, - "com.unity.2d.common": { - "version": "9.1.1", - "depth": 1, - "source": "registry", - "dependencies": { - "com.unity.burst": "1.8.4", - "com.unity.2d.sprite": "1.0.0", - "com.unity.mathematics": "1.1.0", - "com.unity.modules.animation": "1.0.0", - "com.unity.modules.uielements": "1.0.0" - }, - "url": "https://packages.unity.com" - }, - "com.unity.2d.pixel-perfect": { - "version": "5.0.3", - "depth": 0, - "source": "registry", - "dependencies": {}, - "url": "https://packages.unity.com" - }, - "com.unity.2d.psdimporter": { - "version": "9.1.0", - "depth": 0, - "source": "registry", - "dependencies": { - "com.unity.2d.common": "9.1.1", - "com.unity.2d.sprite": "1.0.0" - }, - "url": "https://packages.unity.com" - }, - "com.unity.2d.sprite": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": {} - }, - "com.unity.2d.spriteshape": { - "version": "10.0.7", - "depth": 0, - "source": "registry", - "dependencies": { - "com.unity.2d.common": "9.0.7", - "com.unity.mathematics": "1.1.0", - "com.unity.modules.physics2d": "1.0.0" - }, - "url": "https://packages.unity.com" - }, - "com.unity.2d.tilemap": { - "version": "1.0.0", - "depth": 0, - "source": "builtin", - "dependencies": { - "com.unity.modules.tilemap": "1.0.0", - "com.unity.modules.uielements": "1.0.0" - } - }, "com.unity.ai.navigation": { "version": "2.0.9", "depth": 0, From dfbba3749c89f2976c1d52effb4cf7d7b548820f Mon Sep 17 00:00:00 2001 From: Junrou Nishida Date: Sun, 12 Oct 2025 10:42:44 +0900 Subject: [PATCH 3/3] fix: keep using an old version of Unity to build packages on CI --- .github/workflows/package.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index d40c3cee0..de85543d7 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -292,6 +292,17 @@ jobs: run: | rm MediaPipeUnityPlugin-all.zip + # NOTE: a workaround to keep using Unity 6000.0.33f1 + - name: Patch dependencies + run: | + echo "$(jq '.dependencies["com.unity.test-framework"] = "1.4.5"' Packages/manifest.json)" > Packages/manifest.json + echo "$(jq ' + .dependencies["com.unity.test-framework"].version = "1.4.5" | + .dependencies["com.unity.test-framework"].source = "registry" | + .dependencies["com.unity.test-framework"].url = "https://packages.unity.com" + ' Packages/packages-lock.json)" > Packages/packages-lock.json + + # NOTE: this step will overwrite AppSettings.asset - name: Export unitypackage if: ${{ env.BUILD_UNITYPACKAGE == '1' }}