Building through command line has worked great all the way through Unity 5.6. On Unity 2018.1.0b13 it seems like projectPath is ignored and it always opens the last opened project on that machine instead.
Is there any reason this would be failing and should we be doing something different? Load Previous Project on Startup is also turned off in Unity preferences.
We use this very heavily internally, so it’s unlikely to be broken. Most likely reason is that your project is not actually present at the path you are providing. What does the start of the log file say?
The directory definitely exists. We use it before invoking Unity and I double checked on disk just in case. I will try to give as much of the log as I can but unfortunately the path contains code names and other sensitive data, so hopefully not too much is omitted:
Launching external process: /Applications/Unity-2018.1.0b13/Unity.app/Contents/Resources/PackageManager/Server/upm-macos
LICENSE SYSTEM [2018423 13:58:36] Next license update check is after 2017-07-18T22:46:46
COMMAND LINE ARGUMENTS:
/Applications/Unity-2018.1.0b13/Unity.app/Contents/MacOS/Unity
-quit
-batchmode
-executeMethod
<omitted>
-buildTarget
osx
-projectPath
/Users/<user>/workspace/<omitted>/desktop/branch/<omitted>
-logFile
/Users/<user>/<omitted>/osx-unity-build.log
-nographics
/Users/<user>/New Unity Project
Loading GUID <-> Path mappings...0.000055 seconds
Loading Asset Database...0.016462 seconds
Audio: FMOD Profiler initialized on port 54900
AssetDatabase consistency checks...Timestamps (432) and assets (403) maps out of sync - repairing...```
In this example even though it was passed /Users/<user>/workspace/<omitted>/desktop/branch/<omitted> for projectPath it ends up loading and trying to build /Users/<user>/New Unity Project which fails because an empty project does not have code for our executeMethod.
I should have clarified as well but we only see this on Mac. Windows is working just fine. Unity is running under the same user that owns the files. While I can't rule out a permission issue the same path builds under Unity 5.6 just fine if we simply change the branch that specifies what version of Unity to use. The files are checked out into the exact same path.
EDIT: I actually was unable to reproduce this locally, only on the remote build server. I will keep trying to narrow down the variables and update with what the cause ended up being.
This behaviour looks quite similar to a bug we saw recently which involved a license issue. Do you have a fully activated license on your remote build server?
That was it! Somehow the build server had a weird license file. I was able to delete /Libary/Application Support/Unity/Unity_lic.ulf and then open Unity 2018.1.0b13 again and it correctly imported the valid license file from /Libary/Application Support/Unity/Unity_v5.x.ulf.