Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Vicas · Apr 11, 2013 at 04:35 PM · build-errorlinuxcompilercommand-line

Error building a Unity Linux app through Cygwin

I've made a small bash script in Cygwin for building my Unity project.

When I do that, curiosities arise.

This is my command:

 $ "/cygdrive/c/Program Files (x86)/Unity/Editor/Unity.exe" -batchmode -nographics -projectPath "C:\Users\user\git\sandbox\game\Rainbow" -buildLinux64Player "C:\Users\user\git\sandbox\game\.build_linux/rainbow" -quit -logFile buildlog.txt


When I run this through Cygwin, it fails. When I run this through a Windows command shell (with the Unity.exe windows-path) everything works fine.

This is an excerpt of the errorlog, which holds the error:

 - starting compile Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll, for buildtarget 24
 Could not start compilationArgumentException: Key duplication when adding: TMP
   at System.Collections.Hashtable.PutImpl (System.Object key, System.Object value, Boolean overwrite) [0x00137] in /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System.Collections/Hashtable.cs:831 
 
   at System.Collections.Hashtable.Add (System.Object key, System.Object value) [0x00000] in /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System.Collections/Hashtable.cs:474 
 
   at System.Collections.Specialized.ProcessStringDictionary.Add (System.String key, System.String value) [0x00000] in <filename unknown>:0 
 
   at System.Diagnostics.ProcessStartInfo.get_EnvironmentVariables () [0x00000] in <filename unknown>:0 
 
   at UnityEditor.Scripting.ManagedProgram..ctor (System.String monodistribution, System.String profile, System.String executable, System.String arguments, Boolean setMonoEnvironmentVariables) [0x000c5] in C:\BuildAgent\work\812c4f5049264fad\Editor\Mono\Utils\ManagedProgram.cs:36 
 
   at UnityEditor.Scripting.Compilers.MonoScriptCompilerBase.StartCompiler (BuildTarget target, System.String compiler, System.Collections.Generic.List`1 arguments, Boolean setMonoEnvironmentVariables) [0x00024] in C:\BuildAgent\work\812c4f5049264fad\Editor\Mono\Scripting\Compilers\MonoScriptCompilerBase.cs:30 
 
   at UnityEditor.Scripting.Compilers.MonoScriptCompilerBase.StartCompiler (BuildTarget target, System.String compiler, System.Collections.Generic.List`1 arguments) [0x00000] in C:\BuildAgent\work\812c4f5049264fad\Editor\Mono\Scripting\Compilers\MonoScriptCompilerBase.cs:20 
 
   at UnityEditor.Scripting.Compilers.MonoCSharpCompiler.StartCompiler () [0x00102] in C:\BuildAgent\work\812c4f5049264fad\Editor\Mono\Scripting\Compilers\MonoCSharpCompiler.cs:35 
 
   at UnityEditor.Scripting.Compilers.ScriptCompilerBase.BeginCompiling () [0x00016] in C:\BuildAgent\work\812c4f5049264fad\Editor\Mono\Scripting\Compilers\ScriptCompilerBase.cs:40 
  
 (Filename: /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System.Collections/Hashtable.cs Line: 831)
 
 - Finished compile Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll
 Compilation failed because the compiler couldn't be executed!

Now, Cygwin has a "run" command, which runs a Windows command through Cygwin. If I run the command through here, it also works!

The only problem is, that run returns immediately, so my build script can't wait for it.

Run has an argument -wait, which makes run return only when the execution is done.

Only problem is, when I apply the -wait argument as specified in the manual:

 $ run "/cygdrive/c/Program Files (x86)/Unity/Editor/Unity.exe" -wait -batchmode -nographics -projectPath "C:\Users\user\git\sandbox\game\Rainbow" -buildLinux64Player "C:\Users\user\git\sandbox\game\.build_linux/rainbow" -quit -logFile buildlog.txt

I get the same error.

The error looks to be something regarding a path or strings, but I am not sure why the -wait parameter would make this go bad.

Regards

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image lvictorino · Mar 26, 2014 at 09:55 AM 0
Share

Hey @Vicas have you found a solution to your problem?

avatar image Vicas · May 01, 2014 at 08:06 AM 0
Share

I sort of gave up, but @jester23's answer seemed to make sense to me. $$anonymous$$aybe that can help you.

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by jester23 · Aug 03, 2013 at 12:59 PM

The problem is caused by the already set environment variables of cygwin. Haven't checked all the details, but "echo $TMP" should show that TMP is set and with "unset TMP" you should overcome this error.

Longterm solutions should be in the hands of the mono developers, but I think its rooted in the quite old version of mono used for unity.

cheers

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by sebtoun · Jul 07, 2017 at 02:01 PM

I noticed that when TMP is unset, Unity builds either :

  • produce an empty folder in project named something like ''$'\340\246\210\343\216\224\347\277\274' (displayed as ঈ㎔翼 in explorer)

  • pop up a "Power Shell has stopped working" message dialog.

In either case, the project is successfully built but I find it inconvenient to have garbage folders that need cleanup once in a while.

If the TMP variable is set (to /tmp), the "Key duplication when adding: TMP" error prevents build to succeed.

Has any one encountered this issue ? (and maybe solved it)

I am on Windows 10 in a git-bash (MSYS2) environment, using zshell and Unity 5.6.1

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

13 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Android Build Support Install failed: Installation Failed 1 Answer

No builtin shaders in Linux command line WebGL build 0 Answers

Linux build error: The type or namespace name `VRSettings` does not exist in the namespace `UnityEngine.VR` 0 Answers

How to check error when Unity build by command line 1 Answer

Unity at fedora linux,Unity at fedora. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges