Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

mdtool errors not displaying?

Discussion in 'Scripting' started by Foam, Apr 25, 2014.

  1. Foam

    Foam

    Joined:
    Jun 13, 2012
    Posts:
    322
    Hello everyone.

    I am attempting to build my project via the command line, and everything seems to be moving along, but when I build the project, I have errors but no detailed error messages.

    For example, I use this command (broken up for readability):

    Code (csharp):
    1. /Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Commands/mono
    2. /Applications/Unity/MonoDevelop.app/Contents/MacOS/lib/monodevelop/bin/mdtool.exe
    3. -v build
    4. -c:Debug
    5. ~/unity_project/unity_project.sln
    And the build process starts but at the end, all I get for error details is

    Code (csharp):
    1. Unrecognized compiler output: 1 warning(s).
    2. Unrecognized compiler output: 1 error(s).
    3.       Build complete -- 1 error, 1 warning
    I don't get the info on the actual errors or warnings.

    I have verbose enabled and I checked stderr and nothing seems to be reported there either so I'm at a bit of a loss as to where MonoDevelop is picking up the actual error messages from (or where mdtool would be reporting them).

    And of course

    Code (csharp):
    1. /Applications/Unity/Unity.app/Contents/MacOS/Unity -batchmode -logFile -projectPath ~/unity_project -quit
    2.  
    gives me full details, as does the MonoDevelop GUI.

    Any suggestions?
     
    Last edited: Apr 25, 2014
  2. Foam

    Foam

    Joined:
    Jun 13, 2012
    Posts:
    322
  3. Foam

    Foam

    Joined:
    Jun 13, 2012
    Posts:
    322
    So, I figured this out, in a way.

    The issue is that /Applications/Unity/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/BackendBindings/Boo/Boo.MonoDevelop.dll isn't outputting the error messages for Boo. You can see in the code https://github.com/bamboo/boo-md-ad...oDevelop/ProjectModel/UnityScriptCompiler.boo that's going on, in ParseBuildResult---the messages are being provided to MonoDevelop via the BuildResult object, but, they are not printed out to the console, which is what we want if we are going to use flycheck/flymake!

    I had a lot of trouble compiling boo-md-addons from the github repo. After struggling with that it occured to me:

    Hell, just take the DLL you have now and edit it directly to put in a print statement!

    So, I grabbed RedGate's .NET Reflector and an addon called Reflexil. With those two tools I was able to examine the IL for the DLL and add a print statement at what would be essentially line 103 in the above boo code. Saved the patched DLL, plopped it where the old one was, and everything worked.

    :p