Skip to content

ci(audience): expand PlayMode CI matrix to Unity 6000.4.0f1 (SDK-256)#716

Merged
ImmutableJeffrey merged 5 commits intomainfrom
chore/sdk-256-unity6-cells
Apr 29, 2026
Merged

ci(audience): expand PlayMode CI matrix to Unity 6000.4.0f1 (SDK-256)#716
ImmutableJeffrey merged 5 commits intomainfrom
chore/sdk-256-unity6-cells

Conversation

@ImmutableJeffrey
Copy link
Copy Markdown
Collaborator

@ImmutableJeffrey ImmutableJeffrey commented Apr 29, 2026

Summary

  • Adds 4 Unity 6000.4.0f1 cells (Win+Mac × IL2CPP+Mono2x) to the audience PlayMode matrix.
  • Adds a per-OS observability step that promotes Unity compile errors (error CS####:, Compilation failed:) to ::error:: annotations; sanitises :: sequences to prevent workflow-command injection.
  • Tees Unity stdout to artifacts/unity.log and uploads it alongside test-results.xml so cell-compile failures retain a full post-mortem.
  • Wraps Assets/Editor/ScriptingBackendOverride.cs in a new Immutable.Audience.Samples.SampleApp.Editor asmdef so AUDIENCE_SCRIPTING_BACKEND is honoured under Unity 6's sandboxed test-runner build context.
  • Bumps com.unity.test-framework 1.1.33 → 1.4.5; drops com.unity.toolchain.macos-arm64-linux-x86_64; deletes packages-lock.json so each Unity version resolves the manifest fresh.
  • Removes com.unity.feature.development, com.unity.ide.rider, com.unity.ide.visualstudio, com.unity.ide.vscode from the sample manifest. Rider 3.0.40's Windows-side protocol cleanup leaves worker threads alive that mono_thread_manage cannot abort, hanging Editor shutdown for 60 min on Win/IL2CPP/Unity 6.
  • Guards FindObjectOfType<AudienceSample> with #if UNITY_2023_1_OR_NEWER and uses FindFirstObjectByType<T>(FindObjectsInactive.Include) on the new branch to preserve includeInactive: true semantics that APIUpdater would otherwise drop.
  • Replaces two WaitForSecondsRealtime deadline waits in SampleAppLiveFireTests with a WaitForCondition polling helper to avoid UTF 2.x test-runner clock divergence.
  • Replaces three bare catch { } blocks (NotifyErrorCallback, ParseRejectedCount, NotifyError) with catch (Exception ex) { Log.Warn(...) } so IL2CPP linker stripping errors surface in test logs.
  • Adds CancellationToken observation to ParseRejectedCount via ThrowIfCancellationRequested() (the (CancellationToken) overload of HttpContent.ReadAsStringAsync is .NET 5+ only and absent from .NET Standard 2.1).
  • Adds #nullable enable to Json.cs and Log.cs; threads HashSet<object>? through WriteObject/WriteArray/EnterContainer.
  • Replaces reflective Enum.IsDefined in ConsentStore.Load with a bounded range check on ConsentLevel to remove an IL2CPP enum-metadata stripping risk.

Linear: SDK-256

- Adds 4 cells (Win+Mac × IL2CPP+Mono2x) on Unity 6000.4.0f1 / 8cf496087c8f to the audience PlayMode
  matrix.
- Adds a per-OS observability step that surfaces Unity compile errors ('error CS####:' /
  'Compilation failed:') as PR annotations; sanitises '::' so log lines containing workflow commands
  cannot terminate the annotation early.
- macOS PlayMode-test step tees Unity stdout to artifacts/unity.log so the annotation step has a
  file to scan.

Stacked PR 2 will add 4 Unity 2022.3.62f2 cells to reach the 12-cell goal.
…6 (SDK-256)

- Adds Immutable.Audience.Samples.SampleApp.Editor.asmdef pinning ScriptingBackendOverride.cs into a
  discoverable Editor assembly; without an asmdef the implicit Assembly-CSharp-Editor may not be
  picked up by Unity 6's sandboxed test-runner build context.
- Bumps com.unity.test-framework 1.1.33 -> 1.4.5 so [UnityTest] coroutines surface timeouts
  correctly under UTF 2.x.
- Drops com.unity.toolchain.macos-arm64-linux-x86_64 2.0.5; the toolchain naming convention changed
  past 2022 and Unity auto-selects the macOS toolchain anyway.
- Deletes packages-lock.json so each Unity version regenerates a lock matching its own UPM
  resolution.
- Guards FindObjectOfType<AudienceSample> with #if UNITY_2023_1_OR_NEWER so APIUpdater can't
  silently drop the includeInactive parameter when rewriting to FindFirstObjectByType.
- Converts deadline-style WaitForSecondsRealtime in two test methods to a polling pattern
  (Time.realtimeSinceStartup against a budget); adds the WaitForCondition helper used elsewhere in
  the test suite.
@ImmutableJeffrey ImmutableJeffrey force-pushed the chore/sdk-256-unity6-cells branch from 3282bf6 to 1742dd8 Compare April 29, 2026 11:37
…ur CancellationToken (SDK-256)

- Three bare catch { } blocks (NotifyErrorCallback, ParseRejectedCount, NotifyError) previously
  absorbed every exception type, including IL2CPP MissingMethodException / TypeLoadException from
  stripping. Replace each with catch (Exception ex) { Log.Warn(...) } so the failure surfaces in
  test logs without crashing the SDK.
- ParseRejectedCount accepts and honours a CancellationToken propagated from SendBatchAsync, so a
  stalled HTTP body read can be cancelled instead of holding the cell open until the 60-min timeout.
…ConsentStore (SDK-256)

- #nullable enable on Json.cs and Log.cs surfaces the real nullability concerns: HashSet<object>?
  for the Json visited-set first call from Serialize, and Action<string>? for Log.Writer (null until
  AudienceUnityHooks.Install runs).
- Replaces reflective Enum.IsDefined in ConsentStore.Load with an explicit range check (raw >=
  ConsentLevel.None && raw <= ConsentLevel.Full); IL2CPP-safe under aggressive stripping where enum
  metadata may be dropped even with link.xml preserve="all".
@ImmutableJeffrey ImmutableJeffrey force-pushed the chore/sdk-256-unity6-cells branch from 1742dd8 to 672337f Compare April 29, 2026 12:18
…indows shutdown (SDK-256)

The Windows IL2CPP / Unity 6 cell hit GitHub's 60-min wall-clock timeout despite all 39 PlayMode
tests passing. Tests completed in 36s; the hang was during Editor shutdown.

Root cause: com.unity.ide.rider@3.0.40 (resolved fresh by Unity 6 from the manifest's pinned 3.0.31
after packages-lock.json was deleted) has a Windows-specific bug in its protocol cleanup. The plugin
runs `RiderPlugin AppDomain.CurrentDomain.DomainUnload lifetimeDefinition.Terminate` during Editor
shutdown, then leaves 3 worker threads alive that `mono_thread_manage` cannot abort
("abort_threads: Failed aborting id: ..."). The same plugin version on macOS Unity 6 IL2CPP shut
down cleanly in 4m28s — only Windows hangs.

The Rider, Visual Studio, and VSCode IDE-integration packages exist solely to generate .csproj/.sln
files for IDE project navigation. Headless `-batchmode -runTests` does not need them; the SDK and
sample code reference no symbol from any of the three plugins. com.unity.feature.development is a
meta-package that pulls them in transitively; with com.unity.test-framework already listed
explicitly, the feature is redundant.

Local developers who want IDE integration can install whichever plugin matches their toolchain
without it being pinned in the sample's manifest.
@ImmutableJeffrey ImmutableJeffrey merged commit 87e5081 into main Apr 29, 2026
27 checks passed
@ImmutableJeffrey ImmutableJeffrey deleted the chore/sdk-256-unity6-cells branch April 29, 2026 23:12
@github-actions github-actions Bot added the chore label Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants