Fix ARM64 build define injection#1291
Open
JessTello wants to merge 3 commits into
Open
Conversation
- 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.
matt-clarke
reviewed
May 15, 2026
| @@ -292,7 +305,7 @@ public override void PreBuild(BuildReport report) | |||
| : "Targeting Windows x64 (Intel/AMD)"); | |||
|
|
|||
| // Safety net for scripted/CI builds that bypass RegisterBuildPlayerHandler. | |||
Contributor
There was a problem hiding this comment.
Does this suggest that all headless builds will skip RegisterBuildPlayerHandler? Or is this a check just in case?
Update comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.