Code Monkey home page Code Monkey logo

Comments (4)

nothingTVatYT avatar nothingTVatYT commented on May 27, 2024

I just discovered the line in the log file saying it's going to use dotnet 8. Interestingly dotnet 7 is listed as the only sdk and runtime:

 ╭─me@garuda1 in ~ took 7ms
 ╰─λ dotnet --list-sdks
7.0.114 [/usr/share/dotnet/sdk]

 ╭─me@garuda1 in ~ took 6ms
 ╰─λ dotnet --list-runtimes
Microsoft.NETCore.App 7.0.14 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

from flaxengine.

mafiesto4 avatar mafiesto4 commented on May 27, 2024

Compiled for Dev Environment - indicates that's a Source-Build so forced dotnet=7 flag is disabled:

#if OFFICIAL_BUILD
// Use the fixed .NET SDK version in packaged builds for compatibility (FlaxGame is precompiled with it)
#define GAME_BUILD_DOTNET_VER TEXT("-dotnet=7")
#else
#define GAME_BUILD_DOTNET_VER TEXT("")
#endif

We pass that GAME_BUILD_DOTNET_VER into build tool so it picks the dotnet version that was used by the engine to build.
We could do better job at selecting versions depending on the version that built engine binaries.

from flaxengine.

nothingTVatYT avatar nothingTVatYT commented on May 27, 2024

According to dotnet --list-sdks and dotnet --list-runtimes there is only a dotnet 7 installed and the flax editor is built with dotnet 7 so I don't think the passing or not passing down a dotnet version is the issue here.

from flaxengine.

nothingTVatYT avatar nothingTVatYT commented on May 27, 2024

After more investigation the problem seems to be:
The version of the libhostfxr does not necessarily match a version of an installed runtime.
DeployDataStep.Perform assumes there is a runtime with the same version it found a host/fxr folder.
It copies the libhostfxr but cannot copy any other files if there is no runtime version 8 installed. It won't report that as an error.
Further down the process DotNetAOT.RunClassLibStripping tries to access the files it should have copied and fails.

The relevant excerpt from the log file is:

[ 02:39:41.863 ]: [Info] Command: /home/me/Flax/FlaxEngine/Binaries/Tools/Flax.Build -log -logMessagesOnly -logFileWithConsole -logfile=SDKs.txt -printSDKs 
[ 02:39:41.863 ]: [Info] Working directory: /home/me/Documents/flax-projects/WeirdWorld/Cache/Cooker/Linux
[ 02:39:41.879 ]: [Info] /home/me/Flax/FlaxEngine/Binaries/Tools/Flax.Build -log -logMessagesOnly -logFileWithConsole -logfile=SDKs.txt -printSDKs  started, pid=2396317
[ 02:39:42.209 ]: [Info] Missing Android SDK. Cannot build for Android platform.
[ 02:39:42.214 ]: [Info] DotNetSdk, 7.0.114.9999, /usr/share/dotnet
[ 02:39:42.214 ]: [Info] AndroidNdk, missing
[ 02:39:42.214 ]: [Info] AndroidSdk, missing
[ 02:39:42.214 ]: [Info] XCode, missing
[ 02:39:42.214 ]: [Info] GDK, missing
[ 02:39:42.226 ]: [Info] Using .NET Runtime 8.0.0 at /usr/share/dotnet
[ 02:39:42.227 ]: [Info] Optimizing .NET class library size to include only used assemblies
[ 02:39:42.227 ]: [Info] Command: /home/me/Flax/FlaxEngine/Binaries/Tools/Flax.Build -log -logfile="/home/me/Documents/flax-projects/WeirdWorld/Cache/Cooker/Linux/StripDotnetLibs.txt" -runDotNetClassLibStripping -mutex -binaries="/home/me/Documents/flax-projects/WeirdWorld/Output/Linux" 
[ 02:39:42.244 ]: [Info] /home/me/Flax/FlaxEngine/Binaries/Tools/Flax.Build -log -logfile="/home/me/Documents/flax-projects/WeirdWorld/Cache/Cooker/Linux/StripDotnetLibs.txt" -runDotNetClassLibStripping -mutex -binaries="/home/me/Documents/flax-projects/WeirdWorld/Output/Linux"  started, pid=2396341
[ 02:39:42.359 ]: [Info] Flax.Build 1.0.0
[ 02:39:42.459 ]: [Info] Missing Android SDK. Cannot build for Android platform.
[ 02:39:42.525 ]: [Info] Running .NET class Library stripping
[ 02:39:42.545 ]: [Info] Exception: Exception has been thrown by the target of an invocation.
[ 02:39:42.545 ]: [Info] Stack trace:
[ 02:39:42.552 ]: [Info]    at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
[ 02:39:42.553 ]: [Info]    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
[ 02:39:42.553 ]: [Info]    at Flax.Build.Program.Main() in /home/me/Flax/FlaxEngine/Source/Tools/Flax.Build/Program.cs:line 123
[ 02:39:42.553 ]: [Info] Inner exception:
[ 02:39:42.553 ]: [Info] Exception: Invalid C# class library setup in /home/me/Documents/flax-projects/WeirdWorld/Output/Linux/Dotnet
[ 02:39:42.553 ]: [Info] Stack trace:
[ 02:39:42.553 ]: [Info]    at Flax.Build.DotNetAOT.RunClassLibStripping() in /home/me/Flax/FlaxEngine/Source/Tools/Flax.Build/Build/DotNet/DotNetAOT.cs:line 98
[ 02:39:42.553 ]: [Info]    at Flax.Build.Configuration.RunDotNetClassLibStripping() in /home/me/Flax/FlaxEngine/Source/Tools/Flax.Build/Build/DotNet/DotNetAOT.cs:line 70
[ 02:39:42.553 ]: [Info]    at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
[ 02:39:42.553 ]: [Info]    at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)

from flaxengine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.