Search Unity

Does --burst-force-sync-compilation actually work?

Discussion in 'Burst' started by Ziks, Jan 11, 2022.

  1. Ziks

    Ziks

    Joined:
    Aug 20, 2014
    Posts:
    3
    (Unity 2020.3.13f1, com.unity.burst@1.6.3)

    We've got a build step on our CI that involves playing back some gameplay recordings in the editor, and we need Burst to be enabled and compiling synchronously for determinism.

    Docs say to use --burst-force-sync-compilation, but that doesn't seem to have any effect. There's also a --burst-disable-compilation, but not one to enable compilation so I would assume it's enabled by default.

    Looking at the package source, it seems to only use the first option I mentioned to set
    ForceBurstCompilationSynchronously to false. I can't see any code that sets it to true.

    Code (CSharp):
    1. foreach (var arg in Environment.GetCommandLineArgs())
    2. {
    3.     switch (arg)
    4.     {
    5.         case DisableCompilationArg:
    6.             ForceDisableBurstCompilation = true;
    7.             break;
    8.         case ForceSynchronousCompilationArg:
    9.             ForceBurstCompilationSynchronously = false;
    10.             break;
    11.     }
    12. }
    As a workaround I'm doing this before the recording playback step:

    Code (CSharp):
    1. EditorPrefs.SetBool("BurstCompilation", true);
    2. EditorPrefs.SetBool("BurstCompileSynchronously", true);
    Which works, but I'm wondering if I found a bug with the command line option.
     
  2. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    287
    @Ziks this looks like a bug - thank you reporting it. We'll get this fixed.