Repository navigation
fix(unity): call BuildPlayer without dynamic - #306
Open
webbertakken wants to merge 1 commit into
Open
webbertakken wants to merge 1 commit into
webbertakken wants to merge 1 commit into
Conversation
Passing BuildPlayerOptions through a dynamic variable corrupts it on the Windows editors of Unity 2019 and 2020: the build fails at once with "Error building player because build target was unsupported", or with "The build target does not support build appending". Capture the typed options in a Func<BuildReport> per branch instead.
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters: 3
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including
|
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: This PR was written by my clanker. While I try to verify its steps as much as possible, it might not be 100% correct.
Builds on the Windows editors of Unity 2019 and 2020 fail within a second, with
Error building player because build target was unsupported. It happens for every target, including the Windows host target. Thegame-ci/dockertest workflow hits it on all 25 Windows jobs from 2019.3 to 2020.3, for example this run on main. Ubuntu editors of the same versions, and Windows editors from 2021.3 up, build fine.The cause is the
dynamic buildPlayerOptionsinBuilder.BuildProject. On these Windows editors, theBuildPlayerOptionspassed throughdynamicreaches Unity corrupted. I compared the two in the same editor session (diagnostic run, Windows 2019.4):BuildPipeline.BuildPlayer(options), succeeded three times in a row. That included after settingPlayerSettings.bundleVersionandPlayerSettings.macOS.buildNumberasVersionApplicatordoes.dynamic, threwInvalidOperationException: The build target does not support build appending. The options never setAcceptExternalModificationsToPlayer.Before that, an earlier diagnostic showed the target as supported, licensed and loaded at editor start. So the image, the licence and the build path aren't the cause.
Changes
Func<BuildReport>, soBuildPlayeris never bound throughdynamic. Build profiles and the addressables step behave as before.dist/default-build-scriptand to the two identical copies underplugins/unity.Verification
UnityBuilderActionas the custombuildMethod, through the released CLI. All four jobs, Windows 2019.4.41f2 and 2020.3.49f1 withStandaloneWindows64andAndroid, logBuild succeeded!. They fail onmaintoday.mcsagainst Unity 2022.1'sUnityEditor.dll/UnityEngine.dll, with and withoutUNITY_2021_2_OR_NEWER. I could not compile theUNITY_6000_0_OR_NEWERbranch locally. Its change mirrors the other branch.