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:
- Download unity project "[^Build Test.zip]
- 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.)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
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 += () +> {}