Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Task uses macOS Editor location on Linux build agents #180

Open
MattDahEpic opened this issue Sep 5, 2021 · 0 comments
Open

Build Task uses macOS Editor location on Linux build agents #180

MattDahEpic opened this issue Sep 5, 2021 · 0 comments

Comments

@MattDahEpic
Copy link

Issue

When running on a linux build agent (ubuntu in my case) the editor path the Build task tries uses the MacOS path format while the Test task (as an example of a working task) uses the linux format (and behaves as I would expect.)

Reproduction

  1. Have a linux build agent with unity installed via Unity Hub. The default location it installs to, regardless of the location of the hub app is ~/Unity/Hub/Editor/
  2. Note that a Test task uses the expected path format of [customUnityEditorsPath]/<project version>/Editor/Unity while the Build task uses [customUnityEditorsPath]/<project version>/Unity.app/Contents/MacOS/Unity.

In order to get the Build task to work I had to create a symlink from the expected (wrong) location to the real unity executable location. (cd ~/Unity/Hub/editorshims/<version>/Unity.app/MacOS && ln -s ~/Unity/Hub/<version>/Editor/Unity

Example tasks and truncated outputs:

Test task (works as expected)

- task: UnityTestTask@1
  name: tests_editmode
  displayName: "Edit Mode Tests"
  inputs:
    unityEditorsPathMode: 'specify'
    customUnityEditorsPath: '/home/ubuntu/Unity/Hub/Editor'
Starting: Edit Mode Tests
==============================================================================
Task         : Unity Test
Description  : Tests a Unity project and produce the results in NUnit compatible files.
Version      : 1.4.17
Author       : Dinomite Studios
Help         : Use this task to run tests on a Unity project. [More Information](https://unitydevops.com/docs/unity-test-task)
==============================================================================
Determining Unity editor version for project at /home/ubuntu/Desktop/agent/_work/1/s
Success, Unity editor version found 2021.1.19f1, revision=5f5eb8bbdc25, alpha=false, beta=false
/home/ubuntu/Unity/Hub/Editor/2021.1.19f1/Editor/Unity -runTests -testPlatform EditMode [...]
================================ UNITY LOG ===================================
...

Build task (doesn't work as expected and requires symlink to work)

- task: UnityBuildTask@3
  name: build_win64
  displayName: "Win64 Build"
  inputs:
    buildTarget: 'Win64'
    unityEditorsPathMode: 'specify'
    customUnityEditorsPath: '/home/ubuntu/Unity/Hub/editorshims'
    outputPath: '$(Build.BinariesDirectory)/Win64'
    outputFileName: 'Game'
    additionalCmdArgs: '-nographics'
Starting: Win64 Build
==============================================================================
Task         : Unity Build
Description  : Build a Unity project and get the exported output files.
Version      : 3.1.12
Author       : Dinomite Studios
Help         : Use this task to build your Unity project and generate the target platform's output files. [More Information](https://unitydevops.com/docs/unity-build-task)
==============================================================================
Determining Unity editor version for project at /home/ubuntu/Desktop/agent/_work/1/s
Success, Unity editor version found 2021.1.19f1, revision=5f5eb8bbdc25, alpha=false, beta=false
/home/ubuntu/Unity/Hub/editorshims/2021.1.19f1/Unity.app/Contents/MacOS/Unity -batchmode -buildTarget Win64 [...]
================================ UNITY LOG ===================================
...

I did not use it but the "default" location may be affected as well.

Side issue: I had to add -nographics to build tasks but not to test tasks in order to have them run fully. This may be intentional as you need graphics hardware to build GI, but my build agent does not have any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant