You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a second build target is run on the same self-hosted MacOS runner (with the same Unity version), the action will detect that the Unity Editor version is already installed, and it will skip the Unity Editor installation. The build will then fail, as the Unity Editor does not have the build target support installed.
This is admittedly a very specific case, so I'm not surprised no one else has hit this yet, or that no one thought of it.
How to reproduce
On a (clean) self-hosted MacOS runner, build some target, like iOS on some Unity version, like 2020.3.44f1.
On the same self-hosted runner, build a different target, like Android on the same Unity version.
Build will skip installing Unity Editor or modules, as the Unity Editor is already installed.
Build will fail with import errors.
Expected behavior
The action detects that the installed Unity Editor does not have the right build target module installed, and installs it before starting the build.
Additional details
Unfortunately, the Unity Hub CLI does not have a way to test what modules are currently installed. However, the install-modules command is idempotent, so it could be called every run without any downsides other than a bit of extra runtime.
Suggested fix
It should be possible to simply ask Unity Hub to install the required module every build. That might look something like this in this block:
privatestaticasyncinstallUnityModules(buildParameters: BuildParameters,silent=false){constmoduleArguments=SetupMac.getModuleParametersForTargetPlatform(buildParameters.targetPlatform);constexecArguments: string[]=['--','--headless','install-modules',
...['--version',buildParameters.editorVersion],
...moduleArguments,'--childModules',];// Ignoring return code because the install-modules command will fail if the modules already are installed.consterrorCode=awaitexec(this.unityHubExecPath,execArguments,{
silent,ignoreReturnCode: true,});if(errorCode){thrownewError(`There was an error installing the Unity Editor modules. See logs above for details.`);}}
This suggested code does not handle the MacOS Editor caching: the cache would likely need to be updated after.
This suggested Unity Hub CLI command is the exact command I used to solve my issue.
The text was updated successfully, but these errors were encountered:
Bug description
If a second build target is run on the same self-hosted MacOS runner (with the same Unity version), the action will detect that the Unity Editor version is already installed, and it will skip the Unity Editor installation. The build will then fail, as the Unity Editor does not have the build target support installed.
This is admittedly a very specific case, so I'm not surprised no one else has hit this yet, or that no one thought of it.
How to reproduce
Expected behavior
The action detects that the installed Unity Editor does not have the right build target module installed, and installs it before starting the build.
Additional details
Unfortunately, the Unity Hub CLI does not have a way to test what modules are currently installed. However, the
install-modules
command is idempotent, so it could be called every run without any downsides other than a bit of extra runtime.Suggested fix
It should be possible to simply ask Unity Hub to install the required module every build. That might look something like this in this block:
unity-builder/src/model/platform-setup/setup-mac.ts
Lines 19 to 21 in ff23166
and the new function:
This suggested code does not handle the MacOS Editor caching: the cache would likely need to be updated after.
This suggested Unity Hub CLI command is the exact command I used to solve my issue.
The text was updated successfully, but these errors were encountered: