From 0387ec478c9b17090355c6c080f348110fc8afc3 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 14:15:43 +0900 Subject: [PATCH 01/25] Add Unity 6000.5 compile compatibility check Run package compilation checks against both the minimum supported Unity version and Unity 6000.5 so incompatible APIs and dependency resolution failures are detected before v3-beta merges.\n\nUse an isolated Unity 6000.5 fixture, version-specific Library caches, and package-scoped diagnostics while preserving the existing 2022.3 checks and required-status skip behavior. --- .../unity-compile-check-and-test-runner.yml | 62 ++++++++++++++----- ci/unity-projects/6000.5/Assets/.gitkeep | 0 .../6000.5/Packages/manifest.json | 5 ++ .../6000.5/ProjectSettings/ProjectVersion.txt | 1 + 4 files changed, 52 insertions(+), 16 deletions(-) create mode 100644 ci/unity-projects/6000.5/Assets/.gitkeep create mode 100644 ci/unity-projects/6000.5/Packages/manifest.json create mode 100644 ci/unity-projects/6000.5/ProjectSettings/ProjectVersion.txt diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index b62f2d8b7..146f9ac2d 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -1,7 +1,7 @@ name: Unity Compile Check -# This job is a required status check, so it must report exactly one -# "Compile Check (Linux)" result on every PR. Path filters at the workflow +# These jobs are required status checks, so they must report one result per +# Unity version on every PR. Path filters at the workflow # level cannot express that: a `paths`/`paths-ignore` pair both fire on a PR # that mixes C# and non-C# files, producing duplicate required checks. Instead # the workflow always runs and a change-detection step decides whether to do @@ -17,8 +17,21 @@ permissions: jobs: compile-check: - name: Compile Check (Linux) + name: Compile Check (${{ matrix.unity-version }}) runs-on: ubuntu-latest + strategy: + matrix: + include: + - unity-version: 2022.3.62f1 + project-path: . + library-path: Library + package-warning-scope: false + run-unit-tests: true + - unity-version: 6000.5.4f1 + project-path: ci/unity-projects/6000.5 + library-path: ci/unity-projects/6000.5/Library + package-warning-scope: true + run-unit-tests: false # Dependabot PRs cannot access repository secrets (UNITY_LICENSE etc.) env: HAS_UNITY_LICENSE: ${{ secrets.UNITY_LICENSE != '' }} @@ -47,7 +60,7 @@ jobs: echo "=== Changed files ===" echo "$CHANGED" - if echo "$CHANGED" | grep -qE '^(Packages/src/Editor/.*\.cs|Packages/src/Runtime/.*\.cs|Assets/.*\.cs|tests/.*\.cs|tests/.*\.csproj|Packages/.*\.asmdef|Assets/.*\.asmdef|Packages/manifest\.json|Packages/packages-lock\.json|\.github/workflows/unity-compile-check-and-test-runner\.yml)$'; then + if echo "$CHANGED" | grep -qE '^(Packages/src/Editor/.*\.cs|Packages/src/Runtime/.*\.cs|Assets/.*\.cs|tests/.*\.cs|tests/.*\.csproj|Packages/.*\.asmdef|Assets/.*\.asmdef|Packages/manifest\.json|Packages/packages-lock\.json|ci/unity-projects/.*|\.github/workflows/unity-compile-check-and-test-runner\.yml)$'; then echo "csharp=true" >> "$GITHUB_OUTPUT" else echo "csharp=false" >> "$GITHUB_OUTPUT" @@ -58,13 +71,13 @@ jobs: run: echo "No C# changes detected; compile check is satisfied without running Unity." - name: Setup .NET - if: steps.changes.outputs.csharp == 'true' + if: steps.changes.outputs.csharp == 'true' && matrix.run-unit-tests == true uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 with: dotnet-version: 10.0.x - name: Run concurrency unit tests - if: steps.changes.outputs.csharp == 'true' + if: steps.changes.outputs.csharp == 'true' && matrix.run-unit-tests == true run: | dotnet test tests/DynamicCodeExecutionScheduler.UnitTests/DynamicCodeExecutionScheduler.UnitTests.csproj --configuration Release dotnet test tests/SharedRoslynCompilerWorker.UnitTests/SharedRoslynCompilerWorker.UnitTests.csproj --configuration Release @@ -74,10 +87,10 @@ jobs: if: env.HAS_UNITY_LICENSE == 'true' uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae with: - path: Library - key: Library-2022.3.62f1-${{ hashFiles('Packages/src/**/*.cs', 'Assets/**/*.cs', 'Packages/manifest.json', 'Packages/packages-lock.json') }} + path: ${{ matrix.library-path }} + key: Library-${{ matrix.unity-version }}-${{ hashFiles('Packages/src/**/*.cs', 'Assets/**/*.cs', 'Packages/manifest.json', 'Packages/packages-lock.json', 'ci/unity-projects/6000.5/**') }} restore-keys: | - Library-2022.3.62f1- + Library-${{ matrix.unity-version }}- - name: Compile Unity project if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' @@ -89,7 +102,8 @@ jobs: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} with: - unityVersion: 2022.3.62f1 + projectPath: ${{ matrix.project-path }} + unityVersion: ${{ matrix.unity-version }} targetPlatform: StandaloneLinux64 buildMethod: '' allowDirtyBuild: true @@ -113,11 +127,27 @@ jobs: if [ -f "$LOG_FILE" ]; then echo "Analyzing log file: $LOG_FILE" - # Count errors (CS errors from compiler) - ERROR_COUNT=$(grep -c "error CS[0-9]*:" "$LOG_FILE" 2>/dev/null || echo "0") + if [ "${{ matrix.package-warning-scope }}" == "true" ]; then + PACKAGE_EVIDENCE_PATTERN='io\.github\.hatayama\.uloopmcp|UnityCLILoop\.Runtime' + if ! grep -Eq "$PACKAGE_EVIDENCE_PATTERN" "$LOG_FILE"; then + echo "::error::Unity did not resolve or compile the io.github.hatayama.uloopmcp package" + exit 1 + fi + echo "Package compilation evidence found in Unity log." + fi + + if [ "${{ matrix.package-warning-scope }}" == "true" ]; then + # Unity 6000.5 can emit compiler noise from other packages. Only + # package source diagnostics determine this compatibility check. + ERROR_PATTERN='(Packages/src/|io\.github\.hatayama\.uloopmcp).*error CS[0-9]*:|error CS[0-9]*:.*(Packages/src/|io\.github\.hatayama\.uloopmcp)' + WARNING_PATTERN='(Packages/src/|io\.github\.hatayama\.uloopmcp).*warning CS[0-9]*:|warning CS[0-9]*:.*(Packages/src/|io\.github\.hatayama\.uloopmcp)' + else + ERROR_PATTERN='error CS[0-9]*:' + WARNING_PATTERN='warning CS[0-9]*:' + fi - # Count warnings (CS warnings from compiler, excluding specific noise) - WARNING_COUNT=$(grep -c "warning CS[0-9]*:" "$LOG_FILE" 2>/dev/null || echo "0") + ERROR_COUNT=$(grep -Ec "$ERROR_PATTERN" "$LOG_FILE" 2>/dev/null || echo "0") + WARNING_COUNT=$(grep -Ec "$WARNING_PATTERN" "$LOG_FILE" 2>/dev/null || echo "0") echo "" echo "=== Compilation Results ===" @@ -129,7 +159,7 @@ jobs: echo "::error::Found $ERROR_COUNT compile error(s)" echo "" echo "=== Errors ===" - grep "error CS[0-9]*:" "$LOG_FILE" | head -20 + grep -E "$ERROR_PATTERN" "$LOG_FILE" | head -20 exit 1 fi @@ -137,7 +167,7 @@ jobs: echo "::warning::Found $WARNING_COUNT compile warning(s)" echo "" echo "=== Warnings ===" - grep "warning CS[0-9]*:" "$LOG_FILE" | head -20 + grep -E "$WARNING_PATTERN" "$LOG_FILE" | head -20 exit 1 fi diff --git a/ci/unity-projects/6000.5/Assets/.gitkeep b/ci/unity-projects/6000.5/Assets/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/ci/unity-projects/6000.5/Packages/manifest.json b/ci/unity-projects/6000.5/Packages/manifest.json new file mode 100644 index 000000000..512a47c96 --- /dev/null +++ b/ci/unity-projects/6000.5/Packages/manifest.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "io.github.hatayama.uloopmcp": "file:../../../../Packages/src" + } +} diff --git a/ci/unity-projects/6000.5/ProjectSettings/ProjectVersion.txt b/ci/unity-projects/6000.5/ProjectSettings/ProjectVersion.txt new file mode 100644 index 000000000..c40a41609 --- /dev/null +++ b/ci/unity-projects/6000.5/ProjectSettings/ProjectVersion.txt @@ -0,0 +1 @@ +m_EditorVersion: 6000.5.4f1 From f8fb74eab068941ee40ad7d21a5513aa540f08a1 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 14:32:09 +0900 Subject: [PATCH 02/25] Fix Unity 6000.5 object identifier compatibility Use the EntityId-based API on Unity 6000.4 and newer while preserving the existing integer pause-point response contract. Keep the legacy API only on older Unity versions so Unity 6000.5 treats the compatibility path as supported code. --- .../Common/UnityObjectIdentifier.cs | 24 +++++++++++++++++++ .../Common/UnityObjectIdentifier.cs.meta | 2 ++ .../SourcePausePointUnityObjectClassifier.cs | 8 +++---- .../SourcePausePointVariableFormatter.cs | 2 +- .../RaycastAnnotation/RaycastGridAnnotator.cs | 2 +- 5 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 Packages/src/Editor/FirstPartyTools/Common/UnityObjectIdentifier.cs create mode 100644 Packages/src/Editor/FirstPartyTools/Common/UnityObjectIdentifier.cs.meta diff --git a/Packages/src/Editor/FirstPartyTools/Common/UnityObjectIdentifier.cs b/Packages/src/Editor/FirstPartyTools/Common/UnityObjectIdentifier.cs new file mode 100644 index 000000000..bf5eaaa38 --- /dev/null +++ b/Packages/src/Editor/FirstPartyTools/Common/UnityObjectIdentifier.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +namespace io.github.hatayama.UnityCliLoop.FirstPartyTools +{ + /// + /// Provides the integer object handle required by the current pause-point response contract. + /// + internal static class UnityObjectIdentifier + { + /// + /// Gets an object handle while keeping the existing integer response contract compatible with older Unity versions. + /// + public static int GetInstanceId(Object unityObject) + { + Debug.Assert(unityObject != null, "unityObject must not be null."); + +#if UNITY_6000_4_OR_NEWER + return (int)unityObject.GetEntityId(); +#else + return unityObject.GetInstanceID(); +#endif + } + } +} diff --git a/Packages/src/Editor/FirstPartyTools/Common/UnityObjectIdentifier.cs.meta b/Packages/src/Editor/FirstPartyTools/Common/UnityObjectIdentifier.cs.meta new file mode 100644 index 000000000..82558273c --- /dev/null +++ b/Packages/src/Editor/FirstPartyTools/Common/UnityObjectIdentifier.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6c0079dd96933453285941f49016354c \ No newline at end of file diff --git a/Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointUnityObjectClassifier.cs b/Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointUnityObjectClassifier.cs index 6b683f4e8..727a0cc3f 100644 --- a/Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointUnityObjectClassifier.cs +++ b/Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointUnityObjectClassifier.cs @@ -43,9 +43,9 @@ public static Classification Classify(Object unityObject) string assetPath = AssetDatabase.GetAssetPath(unityObject); return string.IsNullOrEmpty(assetPath) ? new Classification( - UloopCapturedVariableUnityObjectKind.RuntimeInstance, unityObject.name, unityObject.GetInstanceID()) + UloopCapturedVariableUnityObjectKind.RuntimeInstance, unityObject.name, UnityObjectIdentifier.GetInstanceId(unityObject)) : new Classification( - UloopCapturedVariableUnityObjectKind.Asset, assetPath, unityObject.GetInstanceID()); + UloopCapturedVariableUnityObjectKind.Asset, assetPath, UnityObjectIdentifier.GetInstanceId(unityObject)); } private static Classification ClassifyGameObjectOrComponent(GameObject gameObject, Object handleSource) @@ -55,13 +55,13 @@ private static Classification ClassifyGameObjectOrComponent(GameObject gameObjec return new Classification( UloopCapturedVariableUnityObjectKind.SceneObject, $"{gameObject.scene.name}:{BuildHierarchyPath(gameObject.transform)}", - handleSource.GetInstanceID()); + UnityObjectIdentifier.GetInstanceId(handleSource)); } return new Classification( UloopCapturedVariableUnityObjectKind.PrefabAsset, AssetDatabase.GetAssetPath(handleSource), - handleSource.GetInstanceID()); + UnityObjectIdentifier.GetInstanceId(handleSource)); } private static string BuildHierarchyPath(Transform transform) diff --git a/Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointVariableFormatter.cs b/Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointVariableFormatter.cs index be9ec6976..aa723531b 100644 --- a/Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointVariableFormatter.cs +++ b/Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointVariableFormatter.cs @@ -81,7 +81,7 @@ private static UloopCapturedVariable FormatUnityObjectVariable( { return new UloopCapturedVariable( name, scope, typeName, DestroyedValue, - UloopCapturedVariableUnityObjectKind.Destroyed, string.Empty, unityObjectCandidate.GetInstanceID()); + UloopCapturedVariableUnityObjectKind.Destroyed, string.Empty, UnityObjectIdentifier.GetInstanceId(unityObjectCandidate)); } SourcePausePointUnityObjectClassifier.Classification classification = diff --git a/Packages/src/Editor/FirstPartyTools/Screenshot/RaycastAnnotation/RaycastGridAnnotator.cs b/Packages/src/Editor/FirstPartyTools/Screenshot/RaycastAnnotation/RaycastGridAnnotator.cs index 8c30b6aa0..7b806336e 100644 --- a/Packages/src/Editor/FirstPartyTools/Screenshot/RaycastAnnotation/RaycastGridAnnotator.cs +++ b/Packages/src/Editor/FirstPartyTools/Screenshot/RaycastAnnotation/RaycastGridAnnotator.cs @@ -189,7 +189,7 @@ internal static int CreateClusterKey(Collider collider) // The 4-connected component split in CollectPhysicsColliderElements re-derives one annotation per // visually closed region so a single GameObject can produce multiple entries when UI occlusion // splits its reachable samples. - return collider!.gameObject.GetInstanceID(); + return UnityObjectIdentifier.GetInstanceId(collider!.gameObject); } private static RaycastClusterSample CreateClusterSample( From 1a63e2dc8236cfdda879b845ae87d7cb8b952592 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 14:39:35 +0900 Subject: [PATCH 03/25] Fix Unity 6000.5 adapter assembly visibility --- .../Editor/FirstPartyTools/Common/UnityObjectIdentifier.cs.meta | 2 -- .../Common => ToolContracts}/UnityObjectIdentifier.cs | 1 - Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs.meta | 2 ++ 3 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 Packages/src/Editor/FirstPartyTools/Common/UnityObjectIdentifier.cs.meta rename Packages/src/Editor/{FirstPartyTools/Common => ToolContracts}/UnityObjectIdentifier.cs (99%) create mode 100644 Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs.meta diff --git a/Packages/src/Editor/FirstPartyTools/Common/UnityObjectIdentifier.cs.meta b/Packages/src/Editor/FirstPartyTools/Common/UnityObjectIdentifier.cs.meta deleted file mode 100644 index 82558273c..000000000 --- a/Packages/src/Editor/FirstPartyTools/Common/UnityObjectIdentifier.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 6c0079dd96933453285941f49016354c \ No newline at end of file diff --git a/Packages/src/Editor/FirstPartyTools/Common/UnityObjectIdentifier.cs b/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs similarity index 99% rename from Packages/src/Editor/FirstPartyTools/Common/UnityObjectIdentifier.cs rename to Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs index bf5eaaa38..c2e9a2183 100644 --- a/Packages/src/Editor/FirstPartyTools/Common/UnityObjectIdentifier.cs +++ b/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs @@ -13,7 +13,6 @@ internal static class UnityObjectIdentifier public static int GetInstanceId(Object unityObject) { Debug.Assert(unityObject != null, "unityObject must not be null."); - #if UNITY_6000_4_OR_NEWER return (int)unityObject.GetEntityId(); #else diff --git a/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs.meta b/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs.meta new file mode 100644 index 000000000..d5526d53d --- /dev/null +++ b/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6c0079dd96933453285941f49016354c From 7f1b35ed9308c4b6ef3bd115cbcb0162fd1150d6 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 14:41:08 +0900 Subject: [PATCH 04/25] Handle destroyed Unity objects in identifier adapter --- .../PausePoint/SourcePausePointUnityObjectClassifier.cs | 1 + Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointUnityObjectClassifier.cs b/Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointUnityObjectClassifier.cs index 727a0cc3f..c4f3705f0 100644 --- a/Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointUnityObjectClassifier.cs +++ b/Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointUnityObjectClassifier.cs @@ -2,6 +2,7 @@ using UnityEngine; using io.github.hatayama.UnityCliLoop.Runtime; +using io.github.hatayama.UnityCliLoop.ToolContracts; namespace io.github.hatayama.UnityCliLoop.FirstPartyTools { diff --git a/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs b/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs index c2e9a2183..7ea5e23f1 100644 --- a/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs +++ b/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace io.github.hatayama.UnityCliLoop.FirstPartyTools +namespace io.github.hatayama.UnityCliLoop.ToolContracts { /// /// Provides the integer object handle required by the current pause-point response contract. @@ -12,7 +12,7 @@ internal static class UnityObjectIdentifier /// public static int GetInstanceId(Object unityObject) { - Debug.Assert(unityObject != null, "unityObject must not be null."); + Debug.Assert(unityObject is not null, "unityObject must not be null."); #if UNITY_6000_4_OR_NEWER return (int)unityObject.GetEntityId(); #else From 0dab8e4649abab2bae721aba352edd6928ba2dd2 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 14:46:31 +0900 Subject: [PATCH 05/25] Use raw EntityId value for Unity 6000.5 --- .github/workflows/unity-compile-check-and-test-runner.yml | 5 +++++ Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index 146f9ac2d..3300ab3ba 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -92,6 +92,10 @@ jobs: restore-keys: | Library-${{ matrix.unity-version }}- + - name: Prepare Unity log directory + if: env.HAS_UNITY_LICENSE == 'true' + run: mkdir -p artifacts + - name: Compile Unity project if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' id: compile @@ -106,6 +110,7 @@ jobs: unityVersion: ${{ matrix.unity-version }} targetPlatform: StandaloneLinux64 buildMethod: '' + customParameters: -logFile artifacts/unity-build.log allowDirtyBuild: true continue-on-error: true diff --git a/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs b/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs index 7ea5e23f1..60817a91f 100644 --- a/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs +++ b/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs @@ -14,7 +14,7 @@ public static int GetInstanceId(Object unityObject) { Debug.Assert(unityObject is not null, "unityObject must not be null."); #if UNITY_6000_4_OR_NEWER - return (int)unityObject.GetEntityId(); + return unchecked((int)EntityId.ToULong(unityObject.GetEntityId())); #else return unityObject.GetInstanceID(); #endif From ac0576c813923ea28c98d0238f8546fc5c25ff6f Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 14:47:30 +0900 Subject: [PATCH 06/25] Handle Unity 6000.5 obsolete API diagnostics --- .../FirstPartyTools/Common/MouseUi/UiRaycastHelper.cs | 4 ++++ .../FirstPartyTools/Common/Overlay/OverlayCanvasFactory.cs | 4 ++++ .../SimulateMouseUi/MouseUiPointerTargetResolver.cs | 4 ++++ Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs | 6 ++---- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Packages/src/Editor/FirstPartyTools/Common/MouseUi/UiRaycastHelper.cs b/Packages/src/Editor/FirstPartyTools/Common/MouseUi/UiRaycastHelper.cs index 166447a8c..ea15937d0 100644 --- a/Packages/src/Editor/FirstPartyTools/Common/MouseUi/UiRaycastHelper.cs +++ b/Packages/src/Editor/FirstPartyTools/Common/MouseUi/UiRaycastHelper.cs @@ -28,7 +28,11 @@ internal static class UiRaycastHelper private static List CollectCanvasRaycastSources() { +#if UNITY_6000_4_OR_NEWER + Canvas[] canvases = Object.FindObjectsByType(); +#else Canvas[] canvases = Object.FindObjectsByType(FindObjectsSortMode.None); +#endif List canvasRaycastSources = new List(); foreach (Canvas canvas in canvases) diff --git a/Packages/src/Editor/FirstPartyTools/Common/Overlay/OverlayCanvasFactory.cs b/Packages/src/Editor/FirstPartyTools/Common/Overlay/OverlayCanvasFactory.cs index aa9f351c5..486649be2 100644 --- a/Packages/src/Editor/FirstPartyTools/Common/Overlay/OverlayCanvasFactory.cs +++ b/Packages/src/Editor/FirstPartyTools/Common/Overlay/OverlayCanvasFactory.cs @@ -38,8 +38,12 @@ public void EnsureExists() } // Domain Reload resets _instance but DontDestroyOnLoad objects survive; reclaim one and destroy duplicates +#if UNITY_6000_4_OR_NEWER + InputVisualizationCanvas[] existing = Object.FindObjectsByType(); +#else InputVisualizationCanvas[] existing = Object.FindObjectsByType(FindObjectsSortMode.None); +#endif for (int i = 0; i < existing.Length; i++) { if (_instance == null) diff --git a/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiPointerTargetResolver.cs b/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiPointerTargetResolver.cs index d588d8e5f..2dedc3bd7 100644 --- a/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiPointerTargetResolver.cs +++ b/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiPointerTargetResolver.cs @@ -185,7 +185,11 @@ private static TargetPathLookupResult FindActiveGameObjectByPath(string targetPa return new TargetPathLookupResult(null, 0); } +#if UNITY_6000_4_OR_NEWER + GameObject[] gameObjects = UnityEngine.Object.FindObjectsByType(); +#else GameObject[] gameObjects = UnityEngine.Object.FindObjectsByType(FindObjectsSortMode.None); +#endif GameObject? matchedTarget = null; int matchCount = 0; diff --git a/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs b/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs index 60817a91f..9b6e89504 100644 --- a/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs +++ b/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs @@ -13,11 +13,9 @@ internal static class UnityObjectIdentifier public static int GetInstanceId(Object unityObject) { Debug.Assert(unityObject is not null, "unityObject must not be null."); -#if UNITY_6000_4_OR_NEWER - return unchecked((int)EntityId.ToULong(unityObject.GetEntityId())); -#else +#pragma warning disable 618, 619 // The public and Go contracts remain int, and Unity provides no supported EntityId-to-int conversion. return unityObject.GetInstanceID(); -#endif +#pragma warning restore 618, 619 } } } From 4adfc2433693db5998549c94e33b30e5713e29ba Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 14:49:42 +0900 Subject: [PATCH 07/25] Use raw EntityId bits for compatibility handles --- .../src/Editor/ToolContracts/UnityObjectIdentifier.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs b/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs index 9b6e89504..c5c9b2207 100644 --- a/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs +++ b/Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs @@ -13,9 +13,13 @@ internal static class UnityObjectIdentifier public static int GetInstanceId(Object unityObject) { Debug.Assert(unityObject is not null, "unityObject must not be null."); -#pragma warning disable 618, 619 // The public and Go contracts remain int, and Unity provides no supported EntityId-to-int conversion. +#if UNITY_6000_4_OR_NEWER + // The wire contract remains int, so extract the same lower 32 bits as Unity's obsolete int cast. + // Unity 6000.5 stores a version marker in the upper 32 bits; future IDs may collide in this int shape. + return unchecked((int)EntityId.ToULong(unityObject.GetEntityId())); +#else return unityObject.GetInstanceID(); -#pragma warning restore 618, 619 +#endif } } } From 7721cd5ead57b869d4409b6df5e255ede739a073 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 14:54:59 +0900 Subject: [PATCH 08/25] Clear remaining Unity 6000.5 compiler warnings --- .github/workflows/unity-compile-check-and-test-runner.yml | 2 +- .../AssemblyBuilderFallbackCompilerBackend.cs | 2 ++ .../Editor/FirstPartyTools/Screenshot/UIElementAnnotator.cs | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index 3300ab3ba..1add57ba5 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -110,7 +110,7 @@ jobs: unityVersion: ${{ matrix.unity-version }} targetPlatform: StandaloneLinux64 buildMethod: '' - customParameters: -logFile artifacts/unity-build.log + customParameters: -logFile /github/workspace/artifacts/unity-build.log allowDirtyBuild: true continue-on-error: true diff --git a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/AssemblyBuilderFallbackCompilerBackend.cs b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/AssemblyBuilderFallbackCompilerBackend.cs index 570a2e065..998e6f665 100644 --- a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/AssemblyBuilderFallbackCompilerBackend.cs +++ b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/AssemblyBuilderFallbackCompilerBackend.cs @@ -28,11 +28,13 @@ public static async Task CompileAsync( ? DynamicReferenceSetBuilder.MergeReferencesByAssemblyName(Array.Empty(), references) : Array.Empty(); +#pragma warning disable 618 // Unity's fallback compiler API has no supported replacement on older editor versions. AssemblyBuilder builder = new(dllPath, sourcePath) { referencesOptions = ReferencesOptions.UseEngineModules, additionalReferences = referenceArray }; +#pragma warning restore 618 builder.buildFinished += (string assemblyPath, CompilerMessage[] compilerMessages) => { diff --git a/Packages/src/Editor/FirstPartyTools/Screenshot/UIElementAnnotator.cs b/Packages/src/Editor/FirstPartyTools/Screenshot/UIElementAnnotator.cs index 77569a572..635faa518 100644 --- a/Packages/src/Editor/FirstPartyTools/Screenshot/UIElementAnnotator.cs +++ b/Packages/src/Editor/FirstPartyTools/Screenshot/UIElementAnnotator.cs @@ -122,7 +122,11 @@ private static void CollectEventHandlers( HashSet processedObjects, UiRaycastHelper.RaycastContext? raycastContext) { +#if UNITY_6000_4_OR_NEWER + MonoBehaviour[] allBehaviours = Object.FindObjectsByType(); +#else MonoBehaviour[] allBehaviours = Object.FindObjectsOfType(); +#endif foreach (MonoBehaviour behaviour in allBehaviours) { if (!behaviour.isActiveAndEnabled) From 2d9a156788597297a17903914aa168e9f46ed7da Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 14:59:53 +0900 Subject: [PATCH 09/25] Validate Unity package assemblies when logs are unavailable --- .../unity-compile-check-and-test-runner.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index 1add57ba5..70c113854 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -129,6 +129,15 @@ jobs: ERROR_COUNT=0 WARNING_COUNT=0 + if [ "${{ matrix.package-warning-scope }}" == "true" ]; then + PACKAGE_ASSEMBLY_COUNT=$(find "${{ matrix.project-path }}/Library/ScriptAssemblies" -maxdepth 1 -type f -name 'UnityCLILoop*.dll' 2>/dev/null | wc -l | tr -d ' ') + if [ "$PACKAGE_ASSEMBLY_COUNT" -eq 0 ]; then + echo "::error::Unity did not resolve or compile the io.github.hatayama.uloopmcp package" + exit 1 + fi + echo "Package assembly evidence found: $PACKAGE_ASSEMBLY_COUNT assembly(s)." + fi + if [ -f "$LOG_FILE" ]; then echo "Analyzing log file: $LOG_FILE" @@ -179,8 +188,8 @@ jobs: echo "✅ No compile errors or warnings found!" else echo "::warning::Could not find Unity log file for analysis" - # Fall back to checking if build step failed - if [ "${{ steps.compile.outcome }}" == "failure" ]; then + # Unity 6000.5's builder reports an untitled-scene build failure after successful script compilation. + if [ "${{ matrix.package-warning-scope }}" != "true" ] && [ "${{ steps.compile.outcome }}" == "failure" ]; then echo "::error::Unity compilation failed" exit 1 fi From 7517f01f3e95eaf5e2e09ef3f5ae752e285e3921 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 15:08:57 +0900 Subject: [PATCH 10/25] Fail Unity 6000.5 checks without compiler logs --- .github/workflows/unity-compile-check-and-test-runner.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index 70c113854..cdc38a7e3 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -189,7 +189,7 @@ jobs: else echo "::warning::Could not find Unity log file for analysis" # Unity 6000.5's builder reports an untitled-scene build failure after successful script compilation. - if [ "${{ matrix.package-warning-scope }}" != "true" ] && [ "${{ steps.compile.outcome }}" == "failure" ]; then + if [ "${{ matrix.package-warning-scope }}" == "true" ] || [ "${{ steps.compile.outcome }}" == "failure" ]; then echo "::error::Unity compilation failed" exit 1 fi From 82e15064f8596585ce9bf4f40f461cde712e5012 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 15:13:44 +0900 Subject: [PATCH 11/25] Preserve Unity compiler log output --- .github/workflows/unity-compile-check-and-test-runner.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index cdc38a7e3..b894323aa 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -110,7 +110,7 @@ jobs: unityVersion: ${{ matrix.unity-version }} targetPlatform: StandaloneLinux64 buildMethod: '' - customParameters: -logFile /github/workspace/artifacts/unity-build.log + customParameters: -logFile=/github/workspace/artifacts/unity-build.log allowDirtyBuild: true continue-on-error: true From 9596aba977b704b33bb9ca95b31d56a16f09c988 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 15:17:45 +0900 Subject: [PATCH 12/25] Pass Unity log path as separate arguments --- .github/workflows/unity-compile-check-and-test-runner.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index b894323aa..2313b0c06 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -110,7 +110,7 @@ jobs: unityVersion: ${{ matrix.unity-version }} targetPlatform: StandaloneLinux64 buildMethod: '' - customParameters: -logFile=/github/workspace/artifacts/unity-build.log + customParameters: -logfile /github/workspace/artifacts/unity-build.log allowDirtyBuild: true continue-on-error: true From 5b5469f71fc59cde2949b43e7145a12d231fa93f Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 15:21:47 +0900 Subject: [PATCH 13/25] Write Unity logs outside build artifacts --- .github/workflows/unity-compile-check-and-test-runner.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index 2313b0c06..48c7df327 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -110,7 +110,7 @@ jobs: unityVersion: ${{ matrix.unity-version }} targetPlatform: StandaloneLinux64 buildMethod: '' - customParameters: -logfile /github/workspace/artifacts/unity-build.log + customParameters: -logFile /github/workspace/unity-build.log allowDirtyBuild: true continue-on-error: true @@ -121,7 +121,7 @@ jobs: if [ -z "$LOG_FILE" ]; then echo "No Unity log file found, checking artifacts..." - LOG_FILE="artifacts/unity-build.log" + LOG_FILE="unity-build.log" fi echo "=== Checking Unity compilation output ===" From 21fe66efe726d9588c52db9ac27302dc643dbc3e Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 15:26:07 +0900 Subject: [PATCH 14/25] Capture compiler diagnostics from Unity job logs --- .../unity-compile-check-and-test-runner.yml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index 48c7df327..fbc667666 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -114,6 +114,35 @@ jobs: allowDirtyBuild: true continue-on-error: true + - name: Capture Unity job log + if: always() && steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' + continue-on-error: true + env: + GH_TOKEN: ${{ github.token }} + run: | + JOB_NAME="Compile Check (${{ matrix.unity-version }})" + JOB_ID=$(curl --fail --silent --show-error \ + -H "Authorization: Bearer $GH_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/jobs?per_page=100" \ + | jq -r --arg job_name "$JOB_NAME" '.jobs[] | select(.name == $job_name) | .id') + if [ -z "$JOB_ID" ]; then + echo "::error::Could not resolve the current Unity job id" + exit 1 + fi + for attempt in 1 2 3 4 5; do + if curl --fail --silent --show-error -L \ + -H "Authorization: Bearer $GH_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/jobs/${JOB_ID}/logs" \ + > artifacts/unity-build.log && [ -s artifacts/unity-build.log ]; then + exit 0 + fi + sleep 5 + done + echo "::error::Could not capture the Unity job log" + exit 1 + - name: Check for compile errors and warnings if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' run: | From db5dcbeddaead1039c1ce4eb676de8dae09abede Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 15:33:17 +0900 Subject: [PATCH 15/25] Compile Unity 6000.5 directly for diagnostics --- .../unity-compile-check-and-test-runner.yml | 55 +++++++++---------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index fbc667666..b62c748be 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -92,12 +92,16 @@ jobs: restore-keys: | Library-${{ matrix.unity-version }}- + - name: Purge cached script assemblies + if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.package-warning-scope == true + run: rm -rf "${{ matrix.project-path }}/Library/ScriptAssemblies" + - name: Prepare Unity log directory if: env.HAS_UNITY_LICENSE == 'true' run: mkdir -p artifacts - - name: Compile Unity project - if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' + - name: Compile Unity project (2022.3) + if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.package-warning-scope == false id: compile uses: game-ci/unity-builder@1d4ee0697f193f54668e98961d79907911f4b4f2 timeout-minutes: 30 @@ -110,38 +114,29 @@ jobs: unityVersion: ${{ matrix.unity-version }} targetPlatform: StandaloneLinux64 buildMethod: '' - customParameters: -logFile /github/workspace/unity-build.log allowDirtyBuild: true continue-on-error: true - - name: Capture Unity job log - if: always() && steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' - continue-on-error: true + - name: Compile Unity project (6000.5) + if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.package-warning-scope == true + id: compile-6000-5 + timeout-minutes: 30 env: - GH_TOKEN: ${{ github.token }} + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} run: | - JOB_NAME="Compile Check (${{ matrix.unity-version }})" - JOB_ID=$(curl --fail --silent --show-error \ - -H "Authorization: Bearer $GH_TOKEN" \ - -H "Accept: application/vnd.github+json" \ - "https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/jobs?per_page=100" \ - | jq -r --arg job_name "$JOB_NAME" '.jobs[] | select(.name == $job_name) | .id') - if [ -z "$JOB_ID" ]; then - echo "::error::Could not resolve the current Unity job id" - exit 1 - fi - for attempt in 1 2 3 4 5; do - if curl --fail --silent --show-error -L \ - -H "Authorization: Bearer $GH_TOKEN" \ - -H "Accept: application/vnd.github+json" \ - "https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/jobs/${JOB_ID}/logs" \ - > artifacts/unity-build.log && [ -s artifacts/unity-build.log ]; then - exit 0 - fi - sleep 5 - done - echo "::error::Could not capture the Unity job log" - exit 1 + docker run --rm \ + --workdir /workspace \ + --volume "$GITHUB_WORKSPACE:/workspace" \ + --env UNITY_LICENSE \ + unityci/editor:ubuntu-6000.5.4f1-base-3 \ + /bin/bash -c ' + set -eu + mkdir -p /root/.local/share/unity3d/Unity + printf "%s" "$UNITY_LICENSE" > /root/.local/share/unity3d/Unity/Unity_lic.ulf + unity-editor -batchmode -nographics -quit \ + -projectPath /workspace/ci/unity-projects/6000.5 \ + -logFile /workspace/artifacts/unity-build.log + ' - name: Check for compile errors and warnings if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' @@ -150,7 +145,7 @@ jobs: if [ -z "$LOG_FILE" ]; then echo "No Unity log file found, checking artifacts..." - LOG_FILE="unity-build.log" + LOG_FILE="artifacts/unity-build.log" fi echo "=== Checking Unity compilation output ===" From caac8e1a01024fd25f7f21004b27de582a0dbaa3 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 15:35:11 +0900 Subject: [PATCH 16/25] Separate Unity compile execution modes --- .github/workflows/unity-compile-check-and-test-runner.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index b62c748be..805ee19ab 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -25,11 +25,13 @@ jobs: - unity-version: 2022.3.62f1 project-path: . library-path: Library + compile-mode: legacy-builder package-warning-scope: false run-unit-tests: true - unity-version: 6000.5.4f1 project-path: ci/unity-projects/6000.5 library-path: ci/unity-projects/6000.5/Library + compile-mode: direct-editor package-warning-scope: true run-unit-tests: false # Dependabot PRs cannot access repository secrets (UNITY_LICENSE etc.) @@ -93,7 +95,7 @@ jobs: Library-${{ matrix.unity-version }}- - name: Purge cached script assemblies - if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.package-warning-scope == true + if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.compile-mode == 'direct-editor' run: rm -rf "${{ matrix.project-path }}/Library/ScriptAssemblies" - name: Prepare Unity log directory @@ -101,7 +103,7 @@ jobs: run: mkdir -p artifacts - name: Compile Unity project (2022.3) - if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.package-warning-scope == false + if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.compile-mode == 'legacy-builder' id: compile uses: game-ci/unity-builder@1d4ee0697f193f54668e98961d79907911f4b4f2 timeout-minutes: 30 @@ -118,7 +120,7 @@ jobs: continue-on-error: true - name: Compile Unity project (6000.5) - if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.package-warning-scope == true + if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.compile-mode == 'direct-editor' id: compile-6000-5 timeout-minutes: 30 env: From c496d2e14a875a8d17889dd58e9397da1d99e220 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 15:36:30 +0900 Subject: [PATCH 17/25] Use explicit matrix compile mode conditions --- .../workflows/unity-compile-check-and-test-runner.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index 805ee19ab..45fa65703 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -25,13 +25,13 @@ jobs: - unity-version: 2022.3.62f1 project-path: . library-path: Library - compile-mode: legacy-builder + compile_mode: legacy-builder package-warning-scope: false run-unit-tests: true - unity-version: 6000.5.4f1 project-path: ci/unity-projects/6000.5 library-path: ci/unity-projects/6000.5/Library - compile-mode: direct-editor + compile_mode: direct-editor package-warning-scope: true run-unit-tests: false # Dependabot PRs cannot access repository secrets (UNITY_LICENSE etc.) @@ -95,7 +95,7 @@ jobs: Library-${{ matrix.unity-version }}- - name: Purge cached script assemblies - if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.compile-mode == 'direct-editor' + if: ${{ steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.compile_mode == 'direct-editor' }} run: rm -rf "${{ matrix.project-path }}/Library/ScriptAssemblies" - name: Prepare Unity log directory @@ -103,7 +103,7 @@ jobs: run: mkdir -p artifacts - name: Compile Unity project (2022.3) - if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.compile-mode == 'legacy-builder' + if: ${{ steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.compile_mode == 'legacy-builder' }} id: compile uses: game-ci/unity-builder@1d4ee0697f193f54668e98961d79907911f4b4f2 timeout-minutes: 30 @@ -120,7 +120,7 @@ jobs: continue-on-error: true - name: Compile Unity project (6000.5) - if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.compile-mode == 'direct-editor' + if: ${{ steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.compile_mode == 'direct-editor' }} id: compile-6000-5 timeout-minutes: 30 env: From a69cce5c38c322e8b19fb44ec75e2122b255d96f Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 15:38:42 +0900 Subject: [PATCH 18/25] Reuse matrix unit test leg for editor selection --- .github/workflows/unity-compile-check-and-test-runner.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index 45fa65703..f3dbbd00f 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -25,13 +25,11 @@ jobs: - unity-version: 2022.3.62f1 project-path: . library-path: Library - compile_mode: legacy-builder package-warning-scope: false run-unit-tests: true - unity-version: 6000.5.4f1 project-path: ci/unity-projects/6000.5 library-path: ci/unity-projects/6000.5/Library - compile_mode: direct-editor package-warning-scope: true run-unit-tests: false # Dependabot PRs cannot access repository secrets (UNITY_LICENSE etc.) @@ -95,7 +93,7 @@ jobs: Library-${{ matrix.unity-version }}- - name: Purge cached script assemblies - if: ${{ steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.compile_mode == 'direct-editor' }} + if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.run-unit-tests == false run: rm -rf "${{ matrix.project-path }}/Library/ScriptAssemblies" - name: Prepare Unity log directory @@ -103,7 +101,7 @@ jobs: run: mkdir -p artifacts - name: Compile Unity project (2022.3) - if: ${{ steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.compile_mode == 'legacy-builder' }} + if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.run-unit-tests == true id: compile uses: game-ci/unity-builder@1d4ee0697f193f54668e98961d79907911f4b4f2 timeout-minutes: 30 @@ -120,7 +118,7 @@ jobs: continue-on-error: true - name: Compile Unity project (6000.5) - if: ${{ steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.compile_mode == 'direct-editor' }} + if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.run-unit-tests == false id: compile-6000-5 timeout-minutes: 30 env: From 97c8dc727fd59d8a1332e8e3819b75a8a22b456f Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 15:40:20 +0900 Subject: [PATCH 19/25] Match compile steps by Unity version --- .github/workflows/unity-compile-check-and-test-runner.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index f3dbbd00f..3e95ab9e5 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -93,7 +93,7 @@ jobs: Library-${{ matrix.unity-version }}- - name: Purge cached script assemblies - if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.run-unit-tests == false + if: ${{ steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix['unity-version'] == '6000.5.4f1' }} run: rm -rf "${{ matrix.project-path }}/Library/ScriptAssemblies" - name: Prepare Unity log directory @@ -101,7 +101,7 @@ jobs: run: mkdir -p artifacts - name: Compile Unity project (2022.3) - if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.run-unit-tests == true + if: ${{ steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix['unity-version'] == '2022.3.62f1' }} id: compile uses: game-ci/unity-builder@1d4ee0697f193f54668e98961d79907911f4b4f2 timeout-minutes: 30 @@ -118,7 +118,7 @@ jobs: continue-on-error: true - name: Compile Unity project (6000.5) - if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix.run-unit-tests == false + if: ${{ steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' && matrix['unity-version'] == '6000.5.4f1' }} id: compile-6000-5 timeout-minutes: 30 env: From 1a3586f2514c02209c9de9cf79870b132b24fe02 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 15:42:44 +0900 Subject: [PATCH 20/25] Pass Unity license file explicitly --- .github/workflows/unity-compile-check-and-test-runner.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index 3e95ab9e5..733cad281 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -134,9 +134,11 @@ jobs: mkdir -p /root/.local/share/unity3d/Unity printf "%s" "$UNITY_LICENSE" > /root/.local/share/unity3d/Unity/Unity_lic.ulf unity-editor -batchmode -nographics -quit \ + -manualLicenseFile /root/.local/share/unity3d/Unity/Unity_lic.ulf \ -projectPath /workspace/ci/unity-projects/6000.5 \ -logFile /workspace/artifacts/unity-build.log ' + continue-on-error: true - name: Check for compile errors and warnings if: steps.changes.outputs.csharp == 'true' && env.HAS_UNITY_LICENSE == 'true' From 2eb645a56d71cef09ddd0c1bbd8ba9aa03548390 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 15:46:24 +0900 Subject: [PATCH 21/25] Expose Unity logs when package compilation evidence is missing Print the controlled Unity log tail before failing the strict 6000.5 package evidence assertion so direct-editor failures can be diagnosed from CI output. --- .github/workflows/unity-compile-check-and-test-runner.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index 733cad281..de37fc94a 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -159,6 +159,12 @@ jobs: PACKAGE_ASSEMBLY_COUNT=$(find "${{ matrix.project-path }}/Library/ScriptAssemblies" -maxdepth 1 -type f -name 'UnityCLILoop*.dll' 2>/dev/null | wc -l | tr -d ' ') if [ "$PACKAGE_ASSEMBLY_COUNT" -eq 0 ]; then echo "::error::Unity did not resolve or compile the io.github.hatayama.uloopmcp package" + if [ -f "$LOG_FILE" ]; then + echo "=== Unity log tail ===" + tail -100 "$LOG_FILE" + else + echo "::error::Unity log file is missing: $LOG_FILE" + fi exit 1 fi echo "Package assembly evidence found: $PACKAGE_ASSEMBLY_COUNT assembly(s)." From 362623e3f6d1aa0d3061468299cbed5bee3e9195 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 15:52:43 +0900 Subject: [PATCH 22/25] Activate Unity 6000.5 with a derived serial The UNITY_LICENSE secret contains machine-bound DeveloperData, so direct .ulf placement fails on GitHub-hosted runners. Derive the personal serial inside the container, activate with the existing credentials, compile the fixture, and return the license on every exit. --- .../unity-compile-check-and-test-runner.yml | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index de37fc94a..7e7490ce0 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -123,18 +123,48 @@ jobs: timeout-minutes: 30 env: UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} run: | docker run --rm \ --workdir /workspace \ --volume "$GITHUB_WORKSPACE:/workspace" \ --env UNITY_LICENSE \ + --env UNITY_EMAIL \ + --env UNITY_PASSWORD \ unityci/editor:ubuntu-6000.5.4f1-base-3 \ /bin/bash -c ' set -eu - mkdir -p /root/.local/share/unity3d/Unity - printf "%s" "$UNITY_LICENSE" > /root/.local/share/unity3d/Unity/Unity_lic.ulf + trap '\''unity-editor -batchmode -nographics -quit -returnlicense \ + -username "$UNITY_EMAIL" -password "$UNITY_PASSWORD" \ + -projectPath /BlankProject >/dev/null 2>&1 || true'\'' EXIT + + LICENSE_VALUE=$(printf "%s" "$UNITY_LICENSE" | tr "\\n" " " | sed -n '\''s/.*.*/\1/p'\'') + test -n "$LICENSE_VALUE" + printf "%s" "$LICENSE_VALUE" | base64 -d > /tmp/developer-data.bin + SERIAL=$(tail -c +5 /tmp/developer-data.bin | tr -d "\\r\\n") + test "${#SERIAL}" -eq 27 + if [[ "$SERIAL" == F* ]]; then + dbus-uuidgen > /etc/machine-id + mkdir -p /var/lib/dbus + ln -sf /etc/machine-id /var/lib/dbus/machine-id + fi + + ACTIVATED=false + for ATTEMPT in 1 2 3; do + if unity-editor -batchmode -nographics -quit \ + -serial "$SERIAL" \ + -username "$UNITY_EMAIL" \ + -password "$UNITY_PASSWORD" \ + -projectPath /BlankProject; then + ACTIVATED=true + break + fi + sleep $((ATTEMPT * 5)) + done + test "$ACTIVATED" = true + unity-editor -batchmode -nographics -quit \ - -manualLicenseFile /root/.local/share/unity3d/Unity/Unity_lic.ulf \ -projectPath /workspace/ci/unity-projects/6000.5 \ -logFile /workspace/artifacts/unity-build.log ' From d41e666234372f25d9a0602964a5298aad9b16ee Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 15:56:27 +0900 Subject: [PATCH 23/25] Use the fixture for Unity license activation The base image does not include the builder's BlankProject directory. Reuse the checked-in fixture for activation and license return so the direct 6000.5 container reaches the actual compilation command. --- .github/workflows/unity-compile-check-and-test-runner.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index 7e7490ce0..eb30cbd3a 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -137,7 +137,7 @@ jobs: set -eu trap '\''unity-editor -batchmode -nographics -quit -returnlicense \ -username "$UNITY_EMAIL" -password "$UNITY_PASSWORD" \ - -projectPath /BlankProject >/dev/null 2>&1 || true'\'' EXIT + -projectPath /workspace/ci/unity-projects/6000.5 >/dev/null 2>&1 || true'\'' EXIT LICENSE_VALUE=$(printf "%s" "$UNITY_LICENSE" | tr "\\n" " " | sed -n '\''s/.*.*/\1/p'\'') test -n "$LICENSE_VALUE" @@ -156,7 +156,7 @@ jobs: -serial "$SERIAL" \ -username "$UNITY_EMAIL" \ -password "$UNITY_PASSWORD" \ - -projectPath /BlankProject; then + -projectPath /workspace/ci/unity-projects/6000.5; then ACTIVATED=true break fi From 5a3d83ab64725069d5bfaec778286dcd1aa106c6 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 16:01:41 +0900 Subject: [PATCH 24/25] Avoid duplicate zero counts in compiler diagnostics grep already prints a zero count when no diagnostics match; suppressing only its nonzero exit status keeps the count numeric and removes misleading integer-expression warnings from the 6000.5 check. --- .github/workflows/unity-compile-check-and-test-runner.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index eb30cbd3a..b5d315ab0 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -222,8 +222,8 @@ jobs: WARNING_PATTERN='warning CS[0-9]*:' fi - ERROR_COUNT=$(grep -Ec "$ERROR_PATTERN" "$LOG_FILE" 2>/dev/null || echo "0") - WARNING_COUNT=$(grep -Ec "$WARNING_PATTERN" "$LOG_FILE" 2>/dev/null || echo "0") + ERROR_COUNT=$(grep -Ec "$ERROR_PATTERN" "$LOG_FILE" 2>/dev/null || true) + WARNING_COUNT=$(grep -Ec "$WARNING_PATTERN" "$LOG_FILE" 2>/dev/null || true) echo "" echo "=== Compilation Results ===" From 65e62e412da3539a638e345eb0e636134e5d87a1 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sun, 19 Jul 2026 16:08:58 +0900 Subject: [PATCH 25/25] Isolate Unity license activation from fixture compilation Use the image-local blank project for activation and license return so project compiler failures do not consume activation retries or hide the controlled fixture log. --- .github/workflows/unity-compile-check-and-test-runner.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unity-compile-check-and-test-runner.yml b/.github/workflows/unity-compile-check-and-test-runner.yml index b5d315ab0..976c8dff6 100644 --- a/.github/workflows/unity-compile-check-and-test-runner.yml +++ b/.github/workflows/unity-compile-check-and-test-runner.yml @@ -135,9 +135,11 @@ jobs: unityci/editor:ubuntu-6000.5.4f1-base-3 \ /bin/bash -c ' set -eu + mkdir -p /BlankProject/Assets trap '\''unity-editor -batchmode -nographics -quit -returnlicense \ + -logFile /dev/stdout \ -username "$UNITY_EMAIL" -password "$UNITY_PASSWORD" \ - -projectPath /workspace/ci/unity-projects/6000.5 >/dev/null 2>&1 || true'\'' EXIT + -projectPath /BlankProject >/dev/null 2>&1 || true'\'' EXIT LICENSE_VALUE=$(printf "%s" "$UNITY_LICENSE" | tr "\\n" " " | sed -n '\''s/.*.*/\1/p'\'') test -n "$LICENSE_VALUE" @@ -153,10 +155,11 @@ jobs: ACTIVATED=false for ATTEMPT in 1 2 3; do if unity-editor -batchmode -nographics -quit \ + -logFile /dev/stdout \ -serial "$SERIAL" \ -username "$UNITY_EMAIL" \ -password "$UNITY_PASSWORD" \ - -projectPath /workspace/ci/unity-projects/6000.5; then + -projectPath /BlankProject; then ACTIVATED=true break fi