Search Issue Tracker

Won't Fix

Votes

0

Found in

6000.0.23f1

6000.3.0a6

6000.4.0a1

Issue ID

UUM-114951

Regression

No

[CI/CD]Build cache not invalidated when building targets with different defines

-

Steps to reproduce:

  1. Download unity project "[^Build Test.zip]
  2. Run CLI build in sequence:

{code:java}
<unity.app> -batchmode -quit -projectPath <path> -executeMethod BuildScript.BuildRetail → OK
{code}
{code:java}
<unity.app> -batchmode -quit -projectPath <path> -executeMethod BuildScript.BuildDemo → FAIL{code}
{code:java}
<unity.app> -batchmode -quit -projectPath <path> -executeMethod BuildScript.BuildRetail → FAIL {code}
 

Actual results: The second Retail build commands fail.

Expected results: The second Retail build should succeed even after a failing build, as a result of switching defines.

Reproducible with versions: 6000.0.23f1, 6000.3.0a5

Tested on (OS): macOS

Notes:

  • The build fails due to an error in code compilation from the previous "BuildDemo" failure.
  • Adding {{BuildOptions.CleanBuildCache}} to the options does not resolve the issue.
  • Using the {{-rebuildLibrary}} CLI argument also does not "fix" the third build. To reset the state, the library folder must be manually deleted.

*
Deleting Library/EditorUserBuildSettings.asset, fixes the issue.
(tracks the build configuration for Player or AssetBundles builds.)

  1. Resolution Note:

    tl;dr when switching bps, user need to wait for a domain reload. Otherwise, the build pipeline would stop the building due the the editor errored out from last build. A domain reload would recompile the scripts so when building from failed to success scripts, the scripts would get recompiled to clear the previous error state.

    2 workarounds available around this use case.

    1. from CLI, use -activeBuildProfile to build.

    2. from the editor, surround the profile switching code with EditorApplication.delayCall += () +> {}

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.