Skip to content

Fix ARM64 build define injection#1291

Open
JessTello wants to merge 3 commits into
release-6.1.0from
ARM64
Open

Fix ARM64 build define injection#1291
JessTello wants to merge 3 commits into
release-6.1.0from
ARM64

Conversation

@JessTello
Copy link
Copy Markdown
Contributor

  • Replace ScriptingDefineUtility.AddDefine + DisplayDialog with BuildPlayerOptions.extraScriptingDefines for ARM64 builds, injecting the symbol per-build and avoiding an extra rebuild when switching from the UI.
  • For x64 define removal, replace EditorUtility.DisplayDialog with an Application.isBatchMode check: show dialog in interactive mode and throw BuildFailedException in CI/batch mode to prevent headless build freezes.
  • Add ExtraDefineInjected flag to WindowsArm64Define so the WindowsBuilderArm64 pre-build check does not abort UI-initiated ARM64 builds using extraScriptingDefines.

NOTE: extraScriptingDefines only contributes additional symbols for the current build, it cannot remove symbols already persisted in PlayerSettings. Because of that, the remove path still has to update PlayerSettings through ScriptingDefineUtility.RemoveDefine and stop/retry the build when needed. The full bidirectional solution using CompilationPipeline.RequestScriptCompilation can be handled as a follow up. This PR keeps the safer partial change: inject via extraScriptingDefines only for the add path, while replacing DisplayDialog with a BuildFailedException in batch mode.

- Replace ScriptingDefineUtility.AddDefine + DisplayDialog with BuildPlayerOptions.extraScriptingDefines for ARM64 builds, injecting the symbol per-build and avoiding an extra rebuild when switching from the UI.
- For x64 define removal, replace EditorUtility.DisplayDialog with an Application.isBatchMode check: show dialog in interactive mode and throw BuildFailedException in CI/batch mode to prevent headless build freezes.
- Add ExtraDefineInjected flag to WindowsArm64Define so the WindowsBuilderArm64 pre-build check does not abort UI-initiated ARM64 builds using extraScriptingDefines.
@JessTello JessTello requested review from a team and matt-clarke May 15, 2026 14:40
@@ -292,7 +305,7 @@ public override void PreBuild(BuildReport report)
: "Targeting Windows x64 (Intel/AMD)");

// Safety net for scripted/CI builds that bypass RegisterBuildPlayerHandler.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this suggest that all headless builds will skip RegisterBuildPlayerHandler? Or is this a check just in case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants