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

u3d run does not tail/print Editor.log #411

Open
4 tasks done
creativitRy opened this issue Oct 23, 2020 · 1 comment
Open
4 tasks done

u3d run does not tail/print Editor.log #411

creativitRy opened this issue Oct 23, 2020 · 1 comment

Comments

@creativitRy
Copy link

Issue Checklist

  • I'm using the latest u3d version
  • I ran u3d --help
  • I read the README
  • I made sure that a similar issue doesn't exit

Issue Description

Hello, we're trying to run u3d to execute our build command. Editor.log is not printed to the terminal.

Here's what is printed:

$ C:/Ruby27-x64/bin/u3d.bat run -- -executeMethod CloudCanards.Core.Editor.Cli.CloudCanardsBuilder.Build -quit -batchmode --trace
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/u3d-1.2.3/lib/u3d/installation.rb:350: warning: Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/u3d-1.2.3/lib/u3d/installation.rb:409: warning: Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead
C:/Ruby27-x64/lib/ruby/2.7.0/win32api.rb:10: warning: already initialized constant Win32API::DLL
C:/Ruby27-x64/lib/ruby/2.7.0/Win32API.rb:10: warning: previous definition of DLL was here
C:/Ruby27-x64/lib/ruby/2.7.0/win32api.rb:11: warning: already initialized constant Win32API::TYPEMAP
C:/Ruby27-x64/lib/ruby/2.7.0/Win32API.rb:11: warning: previous definition of TYPEMAP was here
C:/Ruby27-x64/lib/ruby/2.7.0/win32api.rb:12: warning: already initialized constant Win32API::POINTER_TYPE
C:/Ruby27-x64/lib/ruby/2.7.0/Win32API.rb:12: warning: previous definition of POINTER_TYPE was here
C:/Ruby27-x64/lib/ruby/2.7.0/win32api.rb:14: warning: already initialized constant Win32API::WIN32_TYPES
C:/Ruby27-x64/lib/ruby/2.7.0/Win32API.rb:14: warning: previous definition of WIN32_TYPES was here
C:/Ruby27-x64/lib/ruby/2.7.0/win32api.rb:15: warning: already initialized constant Win32API::DL_TYPES
C:/Ruby27-x64/lib/ruby/2.7.0/Win32API.rb:15: warning: previous definition of DL_TYPES was here
[17:44:19] $ "C:/Program Files/Unity_2020.1.3f1/Editor/Unity.exe" -projectPath C:/gitlab-runner/builds/o9ppoxYA/0/cloudcanards/CloudCanards -executeMethod CloudCanards.Core.Editor.Cli.CloudCanardsBuilder.Build -quit -batchmode --trace
[17:44:19] No pty implementation found. Falling back to popen. Output might be buffered
[17:44:20] Failure while trying to pipe C:/Windows/system32/config/systemprofile/AppData/Local/Unity/Editor/Editor.log: end of file reached
[17:44:20]   C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/file-tail-1.2.0/lib/file/tail.rb:185:in `readline'
[17:44:20]   C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/file-tail-1.2.0/lib/file/tail.rb:185:in `rescue in block in tail'
[17:44:20]   C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/file-tail-1.2.0/lib/file/tail.rb:179:in `block in tail'
[17:44:20]   C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/file-tail-1.2.0/lib/file/tail.rb:178:in `loop'
[17:44:20]   C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/file-tail-1.2.0/lib/file/tail.rb:178:in `tail'
[17:44:20]   C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/u3d-1.2.3/lib/u3d/unity_runner.rb:124:in `block in pipe'
[17:44:20]   C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/u3d-1.2.3/lib/u3d/unity_runner.rb:118:in `open'
[17:44:20]   C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/u3d-1.2.3/lib/u3d/unity_runner.rb:118:in `pipe'
[17:44:20]   C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/u3d-1.2.3/lib/u3d/unity_runner.rb:105:in `block in start_tail_thread'

Looking through the code, we thought this was an issue with race condition, and we added sleep(3) at line 118 of unity_runner. Here's the log that was printed afterwards:

$ C:/Ruby27-x64/bin/u3d.bat run -- -executeMethod CloudCanards.Core.Editor.Cli.CloudCanardsBuilder.Build -quit -batchmode --trace
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/u3d-1.2.3/lib/u3d/installation.rb:350: warning: Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/u3d-1.2.3/lib/u3d/installation.rb:409: warning: Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead
C:/Ruby27-x64/lib/ruby/2.7.0/win32api.rb:10: warning: already initialized constant Win32API::DLL
C:/Ruby27-x64/lib/ruby/2.7.0/Win32API.rb:10: warning: previous definition of DLL was here
C:/Ruby27-x64/lib/ruby/2.7.0/win32api.rb:11: warning: already initialized constant Win32API::TYPEMAP
C:/Ruby27-x64/lib/ruby/2.7.0/Win32API.rb:11: warning: previous definition of TYPEMAP was here
C:/Ruby27-x64/lib/ruby/2.7.0/win32api.rb:12: warning: already initialized constant Win32API::POINTER_TYPE
C:/Ruby27-x64/lib/ruby/2.7.0/Win32API.rb:12: warning: previous definition of POINTER_TYPE was here
C:/Ruby27-x64/lib/ruby/2.7.0/win32api.rb:14: warning: already initialized constant Win32API::WIN32_TYPES
C:/Ruby27-x64/lib/ruby/2.7.0/Win32API.rb:14: warning: previous definition of WIN32_TYPES was here
C:/Ruby27-x64/lib/ruby/2.7.0/win32api.rb:15: warning: already initialized constant Win32API::DL_TYPES
C:/Ruby27-x64/lib/ruby/2.7.0/Win32API.rb:15: warning: previous definition of DL_TYPES was here
C:/Users/Administrator/AppData/Local/Unity/Editor/Editor.log
[22:36:13] $ "C:/Program Files/Unity_2020.1.3f1/Editor/Unity.exe" -projectPath C:/gitlab-runner/builds/o9ppoxYA/0/cloudcanards/CloudCanards -executeMethod CloudCanards.Core.Editor.Cli.CloudCanardsBuilder.Build -quit -batchmode --trace
[22:36:13] No pty implementation found. Falling back to popen. Output might be buffered

u3d was installed in a Windows Server 2019 with Ruby installed using Ruby Installer+msys2. The OS is running in a VM (with graphics) within an Ubuntu host. Although the logs were from GitLab, we also tried running u3d manually on cmd only to get the same result. We also checked to make sure that editor.log existed in the correct file path and was getting updated (by Unity) normally.

@TWTristan
Copy link

I am having a similar issue where u3d is not printing the logs into the output in a Jenkins setup. Running on Windows 10. I used the ruby installer.

Command line looks like this:
u3d run -- -quit -accept-apiupdate -batchmode -logFile Builds\\Logs\\GameName.log -projectPath \"GamePath\" -buildTarget Win64 -executeMethod BuildClass.BuildMethod

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

2 participants