Godot version: 3.1 be98a6e (latest master at the time of this issue)
OS/device including version: Debian buster/sid x86_64
Mono JIT compiler version 5.18.0.240
Microsoft (R) Build Engine version 16.0.0.0 for Mono
NuGet Version: 4.7.0.514
_(Up-to-date in apt as of the creation of this issue)_
Issue description: I'm unable to build the engine with mono support using the command scons p=x11 tools=yes module_mono_enabled=yes mono_glue=no. When I reach the end of the build it fails with
[100%] progress_finish(["progress_finish"], [])
[100%] Linking Static Library ==> core/libcore.x11.tools.64.a
Ranlib Library ==> core/libcore.x11.tools.64.a
[100%] Linking Program ==> bin/godot.x11.tools.64.mono
Index was outside the bounds of the array.
scons: *** [bin/GodotSharp/Tools/GodotSharpTools.dll] RuntimeError : GodotSharpTools: NuGet restore failed
Traceback (most recent call last):
File "/usr/lib/scons/SCons/Action.py", line 1197, in execute
result = self.execfunction(target=target, source=rsources, env=env)
File "/home/dj/Dev/cloned/godot_fork/modules/mono/SCsub", line 315, in mono_build_solution
raise RuntimeError('GodotSharpTools: NuGet restore failed')
RuntimeError: GodotSharpTools: NuGet restore failed
scons: building terminated because of errors.
Subsequent attempts to retry resulted in a huge slew of nuget errors; I've attached the full output to this issue. One thing that stands out is WARNING: Error reading msbuild project information, ensure that your input solution or project file is valid. NETCore and UAP projects will be skipped, only packages.config files will be restored. I've attached the
GodotSharpTools.sln./.csproj and packages.config found in modules/mono/editor/GodotSharpTools/.
I rebooted to clear up anything in /tmp/ that might be an issue, but the failure persists. Attempting to run nuget restore manually in modules/mono/editor/GodotSharpTools/ fails with the same output; I attached the verbose output of that command as well, though it seems to be more of the same.
Despite this error I still have a bin/godot.x11.tools.64.mono executable. I tried running the next step, bin/godot.x11.tools.64.mono --generate-mono-glue modules/mono/glue, but the editor completely ignores the --generate-mono-glue flag and tries to import modules/mono/glue as a resource. This is the "real" issue here I'd suppose, but I can only assume it is linked to the build failing so I've made that the focus.
Steps to reproduce:
scons p=x11 tools=yes module_mono_enabled=yes mono_glue=noMinimal reproduction project: N/A
Thanks!
Update: After pulling 325efb6, thebin/godot.x11.tools.64.mono does not appear in bin/ after the failed compilation; however, the error logs remain the same.
I have also tried with the latest stable NuGet version (4.9.3.5777, following these instructions on SO for getting the latest version) but output was identical.
@neikeq responded on IRC, he was unable to repro with NuGet 4.9.3 nor with the default provided with Mono 5.18 (v4.8.1.5435). I guess I'll need to find some other workaround. If anyone else runs in to this please share your set up too and let's see if we can't diagnose it together!
Tested the exact fork with all the necessary software on an Ubuntu machine with no issues. I think I've narrowed it down to not having the dotnet-sdk-2.2 on my machine - which for various package manager reasons I cannot install on Debian Testing. I'll have to look into resolving that.
Closing this issue but I'll come back here if/when I find a fix.
I had the same issue with the same warning error about msbuild and ending error "NuGet restore failed" but on Windows 10. The full output looks different, though, and it cleary says it couldn't restore the DotNet.Glob package.
璀﹀憡: Error reading msbuild project information, ensure that your input solution or project file is valid. NETCore and UAP projects will be skipped, only packages.config files will be restored.
Restoring NuGet package DotNet.Glob.2.1.1.
璀﹀憡: Unable to find version '2.1.1' of package 'DotNet.Glob'.
C:\Users\CHRISTIAN.nuget\packages\: Package 'DotNet.Glob.2.1.1' is not found on source 'C:\Users\CHRISTIAN.nuget\packages\'.
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'DotNet.Glob.2.1.1' is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'.
https://api.nuget.org/v3/index.json: Unable to load the service index for source https://api.nuget.org/v3/index.json.
An error occurred while sending the request
Error: TrustFailure (The authentication or decryption has failed.)
The authentication or decryption has failed.
Invalid certificate received from server. Error code: 0xffffffff800b0109
Command: scons p=windows tools=yes module_mono_enabled=yes mono_glue=no
Full output: scon_output.log
Fix:
I opened modules/mono/editor/GodotSharpTools/GodotSharpTools.sln in Visual Studio 2017, went to Project > Manage NuGet Packages where I got a warning about lacking packages (DotNet.Glob), and restored it there. I still get the warning about msbuild but now it builds fine and all the other steps work as well.
My only guess is that build is looking for the package on the wrong path. It's looking at C:\Users\user\.nuget\packages\ or C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\ but after I restored it on Visual Studio, it only appears at modules\mono\editor\GodotSharpTools\packages
I was able to manually fix this by running this NuGet command:
nuget.exe install DotNet.Glob -Version 2.1.1
I was able to manually fix this by running this NuGet command:
nuget.exe install DotNet.Glob -Version 2.1.1
I had the same issue and this solved the problem. Is this step necessary for all users? If so, maybe this should be mentioned in the Compiling with Mono doc.
Just ran into this issue. Is this going to get fixed?
If you can still reproduce this, please mention your OS, version of MSBuild and Nuget, Godot version and commit. If on Windows, are you using Mono's MSBuild or System/VisualStudio's? Also, please include the SCons output.
I was able to manually fix this by running this NuGet command:
nuget.exe install DotNet.Glob -Version 2.1.1I had the same issue and this solved the problem. Is this step necessary for all users? If so, maybe this should be mentioned in the Compiling with Mono doc.
This shouldn't be needed. If you have trouble without doing that, please provide the info I commented above.
Set up a new computer today, same problem. Mono "6.4.0 (Visual Studio built mono)" (if I try to run the "mono-6.4.0.198-x64-0.msi" installer from the website, it only allows me to "Repair" the installation or remove it, I also tried removing and re-installing, it still says "(Visual Studio built mono)").
Visual Studio 2019 Community version 16.3.10 with C++ and .NET support (from the about page: Microsoft .NET Framework version 4.8.03752, C# Tools version 3.3.1-beta3-19461, NuGet Package Manager 5.3.1), Windows 10 version 1909 64-bit OS build 18363.476, MSVC 14.2, nuget 5.3.1 from https://www.nuget.org/downloads, running msbuild on the command line says "Microsoft (R) Build Engine version 16.3.0-ci for Mono", running pkg-config gives no output.
But also, after running nuget.exe install DotNet.Glob -Version 2.1.1, I'm getting this error:
Utils\OS.cs(8, 7): error CS0246: The type or namespace 'Mono' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\John\workspace\godot\modules\mono\editor\GodotTools\GodotTools\GodotTools.csproj]
Building without glue works, and generating glue works, but building with glue after generating glue doesn't work and gives the above error. Python 3.8.0 64-bit, scons 3.1.1 from 2019-08-08, building Godot without Mono works fine.
Build script I'm using: https://github.com/aaronfranke/Windows-tools/blob/master/Software/Libraries/Godot%20scripts/build-godot-mono.ps1
Output with this new problem: https://pastebin.com/xWGzRcVh
I don't know if this new problem is a result of installing DotNet.Glob when I should have installed something else or what, but also, I can't figure out how to reverse it. In nuget.exe install DotNet.Glob -Version 2.1.1 replacing "install" with "uninstall" or "remove" or "delete" doesn't work.
@aaronfranke were you able to fix the 'Mono' could not be found error on windows 10? Having the same issue. Visual Studio 2019 with Nuget Package Manager 5.4.0.
This is unrelated to this issue, but the issue with OS.cs is a regression due to using Mono.Posix which is not available in VS on Windows. @neikeq had a patch to fix it, not PR'ed yet.
I just made a PR with the patch @akien-mga mentions above: #34514
Most helpful comment
I had the same issue with the same warning error about msbuild and ending error "NuGet restore failed" but on Windows 10. The full output looks different, though, and it cleary says it couldn't restore the DotNet.Glob package.
Command:
scons p=windows tools=yes module_mono_enabled=yes mono_glue=noFull output: scon_output.log
Fix:
I opened
modules/mono/editor/GodotSharpTools/GodotSharpTools.slnin Visual Studio 2017, went toProject > Manage NuGet Packageswhere I got a warning about lacking packages (DotNet.Glob), and restored it there. I still get the warning about msbuild but now it builds fine and all the other steps work as well.My only guess is that build is looking for the package on the wrong path. It's looking at
C:\Users\user\.nuget\packages\orC:\Program Files (x86)\Microsoft SDKs\NuGetPackages\but after I restored it on Visual Studio, it only appears atmodules\mono\editor\GodotSharpTools\packages